diff options
author | Joey Castillo <jose.castillo@gmail.com> | 2021-09-18 12:57:21 -0400 |
---|---|---|
committer | Joey Castillo <jose.castillo@gmail.com> | 2021-09-18 14:50:20 -0400 |
commit | 5ff4a88374986f3e74dd17f2c17b8532c88debb1 (patch) | |
tree | 9fe6ce15403b5c53b1c7b3605067628799681b0a /apps | |
parent | d97e74058f8b6a1c69d1da1c08176cb52ab2db24 (diff) | |
download | Sensor-Watch-5ff4a88374986f3e74dd17f2c17b8532c88debb1.tar.gz Sensor-Watch-5ff4a88374986f3e74dd17f2c17b8532c88debb1.tar.bz2 Sensor-Watch-5ff4a88374986f3e74dd17f2c17b8532c88debb1.zip |
add a new deep sleep mode alongside backup mode
Diffstat (limited to 'apps')
-rw-r--r-- | apps/Sensor Watch Starter Project/app.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/Sensor Watch Starter Project/app.c b/apps/Sensor Watch Starter Project/app.c index 82ee26d5..d2ddd6a6 100644 --- a/apps/Sensor Watch Starter Project/app.c +++ b/apps/Sensor Watch Starter Project/app.c @@ -61,6 +61,9 @@ void app_wake_from_deep_sleep() { application_state.mode = (ApplicationMode)watch_get_backup_data(0); application_state.color = (LightColor)watch_get_backup_data(1); application_state.wake_count = (uint8_t)watch_get_backup_data(2) + 1; + + // wait a moment for the user's finger to be off the button + delay_ms(250); } /** @@ -160,10 +163,10 @@ bool app_loop() { watch_set_led_off(); // wait a moment for the user's finger to be off the button - delay_ms(1000); + delay_ms(250); // nap time :) - watch_enter_deep_sleep(); + watch_enter_deep_sleep(NULL); } return true; @@ -188,8 +191,5 @@ void cb_mode_pressed() { } void cb_alarm_pressed() { - // boo: http://ww1.microchip.com/downloads/en/DeviceDoc/SAM_L22_Family_Errata_DS80000782B.pdf - // Reference 15010. doesn't say it applies to PA02 but it seems it does? - // anyway can't deep sleep now :( - // application_state.enter_deep_sleep = true; + application_state.enter_deep_sleep = true; } |