Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Snooze Lib compiling error at low CPU Speeds

  1. #1
    Junior Member
    Join Date
    Jan 2021
    Posts
    9

    Snooze Lib compiling error at low CPU Speeds

    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

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    8,680
    It should be enough to use the correct #ifdef around this line:
    https://github.com/duff2013/Snooze/b...SBSerial.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 by Frank B; 07-07-2021 at 10:37 AM.

  3. #3
    Junior Member
    Join Date
    Jan 2021
    Posts
    9
    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...

  4. #4
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    8,680
    Ok. Seems to be solved, then!
    But a fix would be good.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •