]> git.earman.xyz Git - sensor-watch.git/commitdiff
add delay_ms function for simulator
authorjoeycastillo <joeycastillo@utexas.edu>
Wed, 12 Oct 2022 03:11:58 +0000 (22:11 -0500)
committerjoeycastillo <joeycastillo@utexas.edu>
Wed, 12 Oct 2022 03:11:58 +0000 (22:11 -0500)
apps/starter-project/app.c
watch-library/simulator/main.c
watch-library/simulator/watch/watch_main_loop.h

index 2efa6e722419fb3307259874b489b955a7d4628f..9a4ef4fecbb14cb8d83f31e0b10fcc56314af81b 100644 (file)
@@ -156,13 +156,13 @@ bool app_loop(void) {
 
     if (application_state.enter_sleep_mode) {
         // wait a moment for the user's finger to be off the button
-        main_loop_sleep(250);
+        delay_ms(250);
 
         // nap time :)
         watch_enter_deep_sleep_mode();
 
         // we just woke up; wait a moment again for the user's finger to be off the button...
-        main_loop_sleep(250);
+        delay_ms(250);
 
         // and prevent ourselves from going right back to sleep.
         application_state.enter_sleep_mode = false;
index ac9db6ac156703102d3331057350b43cff406da1..6898fd06d590ab9acc85b98524db03d047f7c190 100644 (file)
@@ -101,6 +101,10 @@ static void main_loop_set_sleeping(bool sleeping) {
     }, sleeping);
 }
 
+void delay_ms(const uint16_t ms) {
+    main_loop_sleep(ms);
+}
+
 int main(void) {
     app_init();
     _watch_init();
index 823519195aff7790b1fbe530670aeb16d6c27784..7599f7275541d289674de1f4a20b7992eb23fd07 100644 (file)
@@ -31,3 +31,5 @@ void resume_main_loop(void);
 void main_loop_sleep(uint32_t ms);
 
 bool main_loop_is_sleeping(void);
+
+void delay_ms(const uint16_t ms);