Snooze Lib compiling error at low CPU Speeds

Status
Not open for further replies.

RASTA_SUG

Member
Hi all,
I'm trying to run the Snooze Library from @duff on a Teensy 3.6
Everything works fine until I lower the CPU Speed under 24MHz.
For my project I don't need the USB connection anyway.

When compiling at 16MHz or lower I get the following errors

Code:
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Snooze\src/hal/TEENSY_36/hal.h:47:0,
                 from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Snooze\src/Snooze.h:43,
                 from C:\Users\Louis\Documents\Uni\MASTER\SENSOR\Programming\Master_sketch_v3\Master_sketch_v3.ino:61:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Snooze\src/hal/TEENSY_36/SnoozeUSBSerial.h: In member function 'SnoozeUSBSerial::operator bool()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Snooze\src/hal/TEENSY_36/SnoozeUSBSerial.h:59:16: error: 'usb_configuration' was not declared in this scope
         return usb_configuration && ( usb_cdc_line_rtsdtr & USB_SERIAL_DTR ) && ( ( uint32_t )( systick_millis_count - usb_cdc_line_rtsdtr_millis ) >= 15 );
                ^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Snooze\src/hal/TEENSY_36/SnoozeUSBSerial.h:59:39: error: 'usb_cdc_line_rtsdtr' was not declared in this scope
         return usb_configuration && ( usb_cdc_line_rtsdtr & USB_SERIAL_DTR ) && ( ( uint32_t )( systick_millis_count - usb_cdc_line_rtsdtr_millis ) >= 15 );
                                       ^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Snooze\src/hal/TEENSY_36/SnoozeUSBSerial.h:59:61: error: 'USB_SERIAL_DTR' was not declared in this scope
         return usb_configuration && ( usb_cdc_line_rtsdtr & USB_SERIAL_DTR ) && ( ( uint32_t )( systick_millis_count - usb_cdc_line_rtsdtr_millis ) >= 15 );
                                                             ^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Snooze\src/hal/TEENSY_36/SnoozeUSBSerial.h:59:120: error: 'usb_cdc_line_rtsdtr_millis' was not declared in this scope
         return usb_configuration && ( usb_cdc_line_rtsdtr & USB_SERIAL_DTR ) && ( ( uint32_t )( systick_millis_count - usb_cdc_line_rtsdtr_millis ) >= 15 );

Is there a workaround or am I missing something? From other posts it seems like the lower CPU speeds are not supported for Teensy 3.6 but work for Teensy 3.2?
Is there a possibility I can fix that myself as I'm a bit in a hurry cause the project belongs to my master thesis.

best regards
RASTA
 
It should be enough to use the correct #ifdef around this line:
https://github.com/duff2013/Snooze/blob/master/src/hal/TEENSY_36/SnoozeUSBSerial.h#L58
You can find the #define in usb_desc.h (or perhaps boards.txt)
I think, as it is for a master thesis, you are able to do it and I don't need to dig deeper :)
Shouldn't take longer than 15 minutes.

Please do a PR for duff (for the other Teensies, too) - other users would profit.
Thank you.
 
Last edited:
Hi Frank,
thanks for the quick reply!
I'll definitly check this out :)
In the mean time I've found that this error only occurs when using the Arduino IDE 1.8.13 (Teensy Loader 1.53). (needed to update for the usage of T4.1)
When using Arduino 1.8.7 everything works fine...
 
Status
Not open for further replies.
Back
Top