ENTS-tock
Environmental NeTworked Sensor firmware on Tock OS
Loading...
Searching...
No Matches
example_deepsleep.cpp File Reference
#include <Arduino.h>
#include <ArduinoLog.h>
#include "driver/gpio.h"
#include "esp_sleep.h"

Go to the source code of this file.

Functions

void print_wakeup_reason ()
 
void setup ()
 
void loop ()
 

Variables

RTC_DATA_ATTR int bootCount = 0
 

Function Documentation

◆ loop()

void loop ( )

Definition at line 101 of file example_deepsleep.cpp.

◆ print_wakeup_reason()

void print_wakeup_reason ( )

Definition at line 25 of file example_deepsleep.cpp.

Referenced by setup().

◆ setup()

void setup ( )

Definition at line 71 of file example_deepsleep.cpp.

References bootCount, and print_wakeup_reason().

Variable Documentation

◆ bootCount

RTC_DATA_ATTR int bootCount = 0

Example code for wakeup from deep sleep.

Load example code on the stm32 that triggers the wakeup pin every 5 seoncds and observe the boot count increasing.

Some of this code is taken from esp32duino eamples. https://docs.espressif.com/projects/arduino-esp32/en/latest/api/deepsleep.html

Author
John Madden
Date
2025-11-04 Number of times the esp32 has been booted

Definition at line 21 of file example_deepsleep.cpp.

Referenced by setup().