ESP32-basiertes Kraftort-Suchger�t mit GPS, LED-Ring und PlatformIO-Firmware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
435B

  1. #include "power.h"
  2. #ifdef ARDUINO
  3. #include <esp_sleep.h>
  4. #endif
  5. #include "config.h"
  6. namespace kraftort::power {
  7. void PowerManager::begin() {
  8. #ifdef ARDUINO
  9. esp_sleep_enable_ext0_wakeup(
  10. static_cast<gpio_num_t>(kraftort::config::kButtonPin),
  11. kraftort::config::kButtonActiveLow ? 0 : 1);
  12. #endif
  13. }
  14. void PowerManager::enterDeepSleep() {
  15. #ifdef ARDUINO
  16. esp_deep_sleep_start();
  17. #endif
  18. }
  19. } // namespace kraftort::power