add delay_ms function for simulator
This commit is contained in:
parent
b399f4ca45
commit
f79741a85f
@ -156,13 +156,13 @@ bool app_loop(void) {
|
|||||||
|
|
||||||
if (application_state.enter_sleep_mode) {
|
if (application_state.enter_sleep_mode) {
|
||||||
// wait a moment for the user's finger to be off the button
|
// wait a moment for the user's finger to be off the button
|
||||||
main_loop_sleep(250);
|
delay_ms(250);
|
||||||
|
|
||||||
// nap time :)
|
// nap time :)
|
||||||
watch_enter_deep_sleep_mode();
|
watch_enter_deep_sleep_mode();
|
||||||
|
|
||||||
// we just woke up; wait a moment again for the user's finger to be off the button...
|
// 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.
|
// and prevent ourselves from going right back to sleep.
|
||||||
application_state.enter_sleep_mode = false;
|
application_state.enter_sleep_mode = false;
|
||||||
|
@ -101,6 +101,10 @@ static void main_loop_set_sleeping(bool sleeping) {
|
|||||||
}, sleeping);
|
}, sleeping);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void delay_ms(const uint16_t ms) {
|
||||||
|
main_loop_sleep(ms);
|
||||||
|
}
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
app_init();
|
app_init();
|
||||||
_watch_init();
|
_watch_init();
|
||||||
|
@ -31,3 +31,5 @@ void resume_main_loop(void);
|
|||||||
void main_loop_sleep(uint32_t ms);
|
void main_loop_sleep(uint32_t ms);
|
||||||
|
|
||||||
bool main_loop_is_sleeping(void);
|
bool main_loop_is_sleeping(void);
|
||||||
|
|
||||||
|
void delay_ms(const uint16_t ms);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user