Kód: Vybrat vše
RTC_DATA_ATTR int pocetBootovani = 0;
void vypisZdrojProbuzeni(){
esp_sleep_wakeup_cause_t zdrojProbuzeni;
zdrojProbuzeni = esp_sleep_get_wakeup_cause();
switch(zdrojProbuzeni)
{
case ESP_SLEEP_WAKEUP_EXT0 : Serial.println("Cip probuzen externím signálem - RTC_IO"); break;
case ESP_SLEEP_WAKEUP_EXT1 : Serial.println("Cip probuzen externím signálem - RTC_CNTL"); break;
case ESP_SLEEP_WAKEUP_TIMER : Serial.println("Cip probuzen casovacem"); break;
case ESP_SLEEP_WAKEUP_TOUCHPAD : Serial.println("Cip probuzen dotykovym senzorem"); break;
default : Serial.printf("Jiny zdroj probuzeni: %d\n",zdrojProbuzeni); break;
}
}
void setup(){
Serial.begin(115200);
++pocetBootovani;
Serial.println(String(pocetBootovani)+ ". nabootovani");
vypisZdrojProbuzeni();
esp_sleep_enable_ext0_wakeup(GPIO_NUM_3,HIGH);
Serial.println("Aktivuji mod hlubokeho spanku...");
esp_deep_sleep_start();
}
void loop(){
}
Kód: Vybrat vše
E:\ESP32_pgm\probuzeni_gpio\probuzeni_gpio.ino: In function 'void setup()':
E:\ESP32_pgm\probuzeni_gpio\probuzeni_gpio.ino:23:5: error: 'esp_sleep_enable_ext0_wakeup' was not declared in this scope; did you mean 'esp_sleep_enable_bt_wakeup'?
23 | esp_sleep_enable_ext0_wakeup(GPIO_NUM_3,HIGH);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| esp_sleep_enable_bt_wakeup
exit status 1
Compilation error: 'esp_sleep_enable_ext0_wakeup' was not declared in this scope; did you mean 'esp_sleep_enable_bt_wakeup'?