Missing #include in usb_serial.h

hemsy

Active member
The problematic code is:

Code:
#include <usb_serial.h>
usb_serial_class usbcs;

The error message is:

Code:
Arduino: 1.6.5 (Windows 7), TD: 1.28, Board: "Teensy 3.2 / 3.1, Serial, 96 MHz optimized (overclock), US English"

In file included from usbserialtest01.ino:1:0:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/usb_serial.h: In member function 'size_t usb_serial_class::readBytes(char*, size_t)':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/usb_serial.h:102:38: error: 'millis' was not declared in this scope
unsigned long startMillis = millis();
^
Error compiling.

I added to the file at line 35 of usb_serial.h

Code:
include "core_pins.h"

Now it compiles, and my subsequent code works just fine.
 
Thanks. I was poking around to see if using the functions in usb_serial.h would affect the transmission speed, which it didn't, so it was a blind alley. The more I work with the Teensy 3.2 and TeensyDuino, the better I like it. Thanks for a great effort.
 
Teensy 3.2 should be able to easily achieve about 1 Mbyte/sec transmission speed, assuming the software on the PC side can keep up. Slow PC software, like the Arduino Serial Monitor, can limit the overall speed, even if you have a very fast PC. You might think a fast PC couldn't be the limiting factor, but environments like Java can impose a tremendous amount of overhead.

If you're seeing much less than 1 MByte/sec speed, start a new thread and post the code you're testing and details about how you're capturing on the PC side, and how you're measuring. Think "reproducible" when writing your message!
 
Back
Top