Hello All,
Currently, I am working on a project that is semi-confidential, so I can't show code snippets, but I am using a Teensy LC (for reasons that are definitely not my fault, my teensy 4 burnt out
- or I don't know how the on/off pin works well. either way, I am on the LC now) and am powering the Teensy LC on from an external source (a 4.2-3.3v lipo).
When power is recieved, it seems like the teensy is resuming operation from where it last was (the middle of void loop) rather than running void setup and then moving to void loop. Is this expected behavior, or is there something I can do to make the device run void setup after power-on?
My current idea for a solution involves using a voltage divider connected to an RC timer circuit so that I can use an analog pin at some voltage less than 3v to read the startup in void loop and then trigger a software reset using the SCB_AIRCR = 0x05FA0004; method, but I would much appreciate being able to instead handle this issue in software instead of having to find a capacitor that matches the time needed for the teensy to start across all of 4.2-3.3v.
my other potential solution involves using millis() to check how long it is since the device was powered on, and use the same software reset listed above on it when the time is less than maybe 1000ms. If I am right about execution continuing from where it left off though, I don't believe this would work (within 50 days at least, iirc. micros() would be better at like 2hrs though, lmao).
For context, I am using an I2C peripheral (a version of the SSD1306) that requires a signal from a teensy to restart, which I have built into void setup, as the restart takes about a second and I am looking for continuous screen functionality.
Thanks in advance, whoever gets this!
Currently, I am working on a project that is semi-confidential, so I can't show code snippets, but I am using a Teensy LC (for reasons that are definitely not my fault, my teensy 4 burnt out

When power is recieved, it seems like the teensy is resuming operation from where it last was (the middle of void loop) rather than running void setup and then moving to void loop. Is this expected behavior, or is there something I can do to make the device run void setup after power-on?
My current idea for a solution involves using a voltage divider connected to an RC timer circuit so that I can use an analog pin at some voltage less than 3v to read the startup in void loop and then trigger a software reset using the SCB_AIRCR = 0x05FA0004; method, but I would much appreciate being able to instead handle this issue in software instead of having to find a capacitor that matches the time needed for the teensy to start across all of 4.2-3.3v.
my other potential solution involves using millis() to check how long it is since the device was powered on, and use the same software reset listed above on it when the time is less than maybe 1000ms. If I am right about execution continuing from where it left off though, I don't believe this would work (within 50 days at least, iirc. micros() would be better at like 2hrs though, lmao).
For context, I am using an I2C peripheral (a version of the SSD1306) that requires a signal from a teensy to restart, which I have built into void setup, as the restart takes about a second and I am looking for continuous screen functionality.
Thanks in advance, whoever gets this!