diff options
author | joeycastillo <joeycastillo@utexas.edu> | 2022-10-11 22:11:58 -0500 |
---|---|---|
committer | joeycastillo <joeycastillo@utexas.edu> | 2022-10-11 22:11:58 -0500 |
commit | f79741a85fa08dff34a41ae7c804d80dc800343c (patch) | |
tree | 924916e675f80645797b4ec282ffa8c49495b59c | |
parent | b399f4ca459d0487139f642c7b526fb4144cac8b (diff) | |
download | Sensor-Watch-f79741a85fa08dff34a41ae7c804d80dc800343c.tar.gz Sensor-Watch-f79741a85fa08dff34a41ae7c804d80dc800343c.tar.bz2 Sensor-Watch-f79741a85fa08dff34a41ae7c804d80dc800343c.zip |
add delay_ms function for simulator
-rw-r--r-- | apps/starter-project/app.c | 4 | ||||
-rw-r--r-- | watch-library/simulator/main.c | 4 | ||||
-rw-r--r-- | watch-library/simulator/watch/watch_main_loop.h | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/apps/starter-project/app.c b/apps/starter-project/app.c index 2efa6e72..9a4ef4fe 100644 --- a/apps/starter-project/app.c +++ b/apps/starter-project/app.c @@ -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; diff --git a/watch-library/simulator/main.c b/watch-library/simulator/main.c index ac9db6ac..6898fd06 100644 --- a/watch-library/simulator/main.c +++ b/watch-library/simulator/main.c @@ -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(); diff --git a/watch-library/simulator/watch/watch_main_loop.h b/watch-library/simulator/watch/watch_main_loop.h index 82351919..7599f727 100644 --- a/watch-library/simulator/watch/watch_main_loop.h +++ b/watch-library/simulator/watch/watch_main_loop.h @@ -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); |