Could you explain in a little more detail how the following two statements work in the ExternalWakeUp_ext_with_GPIO program?
esp_sleep_wakeup_cause_t wakeup_reason; wakeup_reason = esp_sleep_get_wakeup_cause();
Not sure what is going on in the first, whereas the second statement seems to save the output of a library function to a (undefined) data type? I am still learning c and python, so appreciate a little help.
In simple words, the first sentence creates a variable called wakeup_reason of type esp_sleep_wakeup_cause_t.
This type of variable can save the output of the esp_sleep_get_wakeup_cause() function. This function returns what caused the ESP32 to wake up.
I hope this helps.