add delay_ms function for simulator

This commit is contained in:
joeycastillo 2022-10-11 22:11:58 -05:00
parent b399f4ca45
commit f79741a85f
3 changed files with 8 additions and 2 deletions

View 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;

View 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();

View 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);