summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--pico-watch.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bcb8b4c..a921604 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -60,7 +60,7 @@ target_link_libraries(pico-watch pico_stdlib)
target_link_libraries(pico-watch
Oled
hardware_rtc
-# hardware_clocks
+ hardware_sync # For use of __wfi()
)
pico_add_extra_outputs(pico-watch)
diff --git a/pico-watch.cpp b/pico-watch.cpp
index e36c211..e04be23 100644
--- a/pico-watch.cpp
+++ b/pico-watch.cpp
@@ -1,6 +1,7 @@
#include <stdio.h>
#include "pico/stdlib.h"
#include "hardware/i2c.h"
+#include "hardware/sync.h"
#include "hardware/rtc.h"
#include "pico/util/datetime.h"
@@ -125,7 +126,8 @@ int main() {
app_api.display_write_backbuffer();
app_rendering = false;
}
- sleep_ms(app_api.performance_render_interval_get());
+ if (is_sleeping) __wfi();
+ else sleep_ms(app_api.performance_render_interval_get());
}
return 0;
}