Adafruit Feather 32u4 LoRa - long transmission time after deep sleep

Couldn’t resist :slight_smile:

After reading the linked infos I added

extern volatile unsigned long timer0_overflow_count;

to my sketch and after the deep sleep I inserted

timer0_overflow_count += 3E6;

Thats it! timer0_overflow_count comes from wiring.c in the arduino core and is used for micros().
Adding at least 3E6 microseconds did the job. Could be adjusted depending on the real sleep time.

Sounds so easy - did I miss something? Maybe there will be some trouble when micros rollover.

With this modification my node now needs less than three seconds for wake up, doing some measuring, sending data and going to deep sleep again.

4 Likes