mirror of
https://github.com/firewalkwithm3/Sensor-Watch.git
synced 2024-11-22 19:20:30 +08:00
Make starter project work in simulator
Use the higher abstraction level sleeping.
This commit is contained in:
parent
95f2f25ee6
commit
be1f3d3631
|
@ -1,6 +1,7 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "watch.h"
|
||||
#include "watch_main_loop.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// This section sets up types and storage for our application state.
|
||||
|
@ -156,13 +157,13 @@ bool app_loop(void) {
|
|||
|
||||
if (application_state.enter_sleep_mode) {
|
||||
// wait a moment for the user's finger to be off the button
|
||||
delay_ms(250);
|
||||
main_loop_sleep(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...
|
||||
delay_ms(250);
|
||||
main_loop_sleep(250);
|
||||
|
||||
// and prevent ourselves from going right back to sleep.
|
||||
application_state.enter_sleep_mode = false;
|
||||
|
|
Loading…
Reference in a new issue