What does the statement
esp_sleep_wakeup_cause_t wakeup_reason;
do in the function
void print_wakeup_reason()
Thanks
1 Answers
Hi jawilson,
Within the print_wakeup_reason() function:
void print_wakeup_reason() {
esp_sleep_wakeup_cause_t wakeup_reason;
wakeup_reason = esp_sleep_get_wakeup_cause();
}
The first line declares the variable wakeup_reason of type esp_sleep_wakeup_cause_t.
The second defines the value of this variable.
We could have written the equivalent in a single line:
void print_wakeup_reason() {
esp_sleep_wakeup_cause_t wakeup_reason = esp_sleep_get_wakeup_cause();
}
Regards,
Steph