Teensyduino 1.25 & Snooze library errors

Phyixel

New member
As I mentioned in must previous post about Teensy LC & clock speeds https://forum.pjrc.com/threads/30304-Teensy-LC-8-amp-16-MHz-Options?p=83787#post83787 the current teensyduino 1.25 gives warnings with the Snooze library when using Teensy 3.1 and gives and error when using a Teensy LC, testing with the 'deepSleep all wakeups' example.

Teensy 3.1, Compiles with warnings:
Code:
In file included from C:\Users\Phyixel\Documents\Arduino\libraries\Snooze/utility/mcg.h:11:0,
from C:\Users\Phyixel\Documents\Arduino\libraries\Snooze/Snooze.h:38,
from deepSleep_all_wakeups.ino:6:
C:\Users\Phyixel\Documents\Arduino\libraries\Snooze/utility/kinetis_ext.h:854:0: warning: "SIM_SOPT1_OSC32KSEL" redefined [enabled by default]
#define SIM_SOPT1_OSC32KSEL(x)                   (((uint32_t)(((uint32_t)(x))<<SIM_SOPT1_OSC32KSEL_SHIFT))&SIM_SOPT1_OSC32KSEL_MASK)
^
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/core_pins.h:34:0,
from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/wiring.h:33,
from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WProgram.h:15,
from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/Arduino.h:1,
from C:\Users\Phyixel\Documents\Arduino\libraries\Snooze/Snooze.h:36,
from deepSleep_all_wakeups.ino:6:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/kinetis.h:823:0: note: this is the location of the previous definition
#define SIM_SOPT1_OSC32KSEL(n)  ((uint32_t)(((n) & 3) << 18)) // 32K oscillator clock, 0=system osc, 2=rtc osc, 3=lpo
^
In file included from C:\Users\Phyixel\Documents\Arduino\libraries\Snooze\utility/mcg.h:11:0,
from C:\Users\Phyixel\Documents\Arduino\libraries\Snooze\Snooze.h:38,
from C:\Users\Phyixel\Documents\Arduino\libraries\Snooze\Snooze.cpp:10:
C:\Users\Phyixel\Documents\Arduino\libraries\Snooze\utility/kinetis_ext.h:854:0: warning: "SIM_SOPT1_OSC32KSEL" redefined [enabled by default]
#define SIM_SOPT1_OSC32KSEL(x)                   (((uint32_t)(((uint32_t)(x))<<SIM_SOPT1_OSC32KSEL_SHIFT))&SIM_SOPT1_OSC32KSEL_MASK)
^
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/core_pins.h:34:0,
from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/wiring.h:33,
from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WProgram.h:15,
from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/Arduino.h:1,
from C:\Users\Phyixel\Documents\Arduino\libraries\Snooze\Snooze.h:36,
from C:\Users\Phyixel\Documents\Arduino\libraries\Snooze\Snooze.cpp:10:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/kinetis.h:823:0: note: this is the location of the previous definition
#define SIM_SOPT1_OSC32KSEL(n)  ((uint32_t)(((n) & 3) << 18)) // 32K oscillator clock, 0=system osc, 2=rtc osc, 3=lpo
^
In file included from C:\Users\Phyixel\Documents\Arduino\libraries\Snooze\utility\mcg.h:11:0,
from C:\Users\Phyixel\Documents\Arduino\libraries\Snooze\utility\mcg.c:18:
C:\Users\Phyixel\Documents\Arduino\libraries\Snooze\utility\kinetis_ext.h:854:0: warning: "SIM_SOPT1_OSC32KSEL" redefined [enabled by default]
#define SIM_SOPT1_OSC32KSEL(x)                   (((uint32_t)(((uint32_t)(x))<<SIM_SOPT1_OSC32KSEL_SHIFT))&SIM_SOPT1_OSC32KSEL_MASK)
^
In file included from C:\Users\Phyixel\Documents\Arduino\libraries\Snooze\utility\mcg.h:10:0,
from C:\Users\Phyixel\Documents\Arduino\libraries\Snooze\utility\mcg.c:18:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/kinetis.h:823:0: note: this is the location of the previous definition
#define SIM_SOPT1_OSC32KSEL(n)  ((uint32_t)(((n) & 3) << 18)) // 32K oscillator clock, 0=system osc, 2=rtc osc, 3=lpo
^

Sketch uses 17,280 bytes (6%) of program storage space. Maximum is 262,144 bytes.
Global variables use 2,708 bytes (4%) of dynamic memory, leaving 62,828 bytes for local variables. Maximum is 65,536 bytes.

Teensy LC, Doesn't Compile with error:
Code:
In file included from C:\Users\Phyixel\Documents\Arduino\libraries\Snooze/utility/mcg.h:11:0,
from C:\Users\Phyixel\Documents\Arduino\libraries\Snooze/Snooze.h:38,
from deepSleep_all_wakeups.ino:6:
C:\Users\Phyixel\Documents\Arduino\libraries\Snooze/utility/kinetis_ext.h:854:0: warning: "SIM_SOPT1_OSC32KSEL" redefined [enabled by default]
#define SIM_SOPT1_OSC32KSEL(x)                   (((uint32_t)(((uint32_t)(x))<<SIM_SOPT1_OSC32KSEL_SHIFT))&SIM_SOPT1_OSC32KSEL_MASK)
^
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/core_pins.h:34:0,
from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/wiring.h:33,
from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WProgram.h:15,
from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/Arduino.h:1,
from C:\Users\Phyixel\Documents\Arduino\libraries\Snooze/Snooze.h:36,
from deepSleep_all_wakeups.ino:6:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/kinetis.h:823:0: note: this is the location of the previous definition
#define SIM_SOPT1_OSC32KSEL(n)  ((uint32_t)(((n) & 3) << 18)) // 32K oscillator clock, 0=system osc, 2=rtc osc, 3=lpo
^
In file included from C:\Users\Phyixel\Documents\Arduino\libraries\Snooze/Snooze.h:49:0,
from deepSleep_all_wakeups.ino:6:
C:\Users\Phyixel\Documents\Arduino\libraries\Snooze/utility/peripheral.h:64:20: error: 'SIM_SCGC6_PDB' was not declared in this scope
PDB_OFF      = SIM_SCGC6_PDB,
^
C:\Users\Phyixel\Documents\Arduino\libraries\Snooze/utility/peripheral.h:77:19: error: 'SIM_SCGC6_PDB' was not declared in this scope
PDB_ON      = SIM_SCGC6_PDB,
^
In file included from C:\Users\Phyixel\Documents\Arduino\libraries\Snooze/Snooze.h:49:0,
from deepSleep_all_wakeups.ino:6:
C:\Users\Phyixel\Documents\Arduino\libraries\Snooze/utility/peripheral.h: In function 'void pdbEnable()':
C:\Users\Phyixel\Documents\Arduino\libraries\Snooze/utility/peripheral.h:333:26: error: 'SIM_SCGC6_PDB' was not declared in this scope
if ((SIM_SCGC6 & SIM_SCGC6_PDB) == 0x00) {
^
C:\Users\Phyixel\Documents\Arduino\libraries\Snooze/utility/peripheral.h: In function 'void pdbDisable()':
C:\Users\Phyixel\Documents\Arduino\libraries\Snooze/utility/peripheral.h:347:25: error: 'SIM_SCGC6_PDB' was not declared in this scope
if (SIM_SCGC6 & SIM_SCGC6_PDB) {
^
Error compiling.

This worked fine in 1.24 and I'm guessing with the addition of the Teensy 3.2 something must have been changed around, the code still works on the 3.1 when using the example as it wakes up every 5000ms and when the button is pressed.
 
As I mentioned in must previous post about Teensy LC & clock speeds https://forum.pjrc.com/threads/30304-Teensy-LC-8-amp-16-MHz-Options?p=83787#post83787 the current teensyduino 1.25 gives warnings with the Snooze library when using Teensy 3.1 and gives and error when using a Teensy LC, testing with the 'deepSleep all wakeups' example.
Fixed warnings and errors, download the latest release on github and use Teensyduino 1.25.

Paul, can you update to this version for the next Teensyduino release, Thanks!
 
Back
Top