summaryrefslogtreecommitdiffstats
path: root/Sensor Watch Starter Project/app/app.h
diff options
context:
space:
mode:
authorJoey Castillo <jose.castillo@gmail.com>2021-08-01 18:40:03 -0400
committerJoey Castillo <jose.castillo@gmail.com>2021-08-01 18:40:42 -0400
commit7e330befffdc2783207b83f12f30f328f5f3318d (patch)
tree92bc6d757d4dc0409d95b40efcd40ccd7372e049 /Sensor Watch Starter Project/app/app.h
parenta547d78c1edfaeb9075934c87753b3352a4ece46 (diff)
downloadSensor-Watch-7e330befffdc2783207b83f12f30f328f5f3318d.tar.gz
Sensor-Watch-7e330befffdc2783207b83f12f30f328f5f3318d.tar.bz2
Sensor-Watch-7e330befffdc2783207b83f12f30f328f5f3318d.zip
move user application code to app folder
Diffstat (limited to 'Sensor Watch Starter Project/app/app.h')
-rw-r--r--Sensor Watch Starter Project/app/app.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/Sensor Watch Starter Project/app/app.h b/Sensor Watch Starter Project/app/app.h
new file mode 100644
index 00000000..b025725c
--- /dev/null
+++ b/Sensor Watch Starter Project/app/app.h
@@ -0,0 +1,29 @@
+/**
+ * Header file for Sensor Watch application
+ *
+ * Ideally you should implement your app entirely within these functions, as well as any
+ * interrupt callbacks you register with the watch API. The general flow is as follows:
+ *
+ * 1. main.c configures the watch
+ * 2. main.c calls your app_init() function.
+ * - You may wish to enable some functionality and peripherals here.
+ * - You should definitely set up some wake-up sources here.
+ * 3. main.c calls your app_loop() function.
+ * - Run code and update your UI here.
+ * 4. main.c calls your app_prepare_for_sleep() function.
+ * - Consider resetting any state that was set in your wakeup callback here.
+ * - You may also want to disable / depower external sensors or peripherals here.
+ * 5. main.c enters the STANDBY sleep mode.
+ * - No user code will run, and the watch will enter a low power mode.
+ * - The watch will remain in this state until something from (2) wakes it.
+ * 6. main.c calls your app_wake_from_sleep() function.
+ * - You may wish to re-enable any peripherals you disabled.
+ * - After this, execution resumes at step (3).
+ */
+
+#include "watch.h"
+
+void app_init();
+void app_loop();
+void app_prepare_for_sleep();
+void app_wake_from_sleep();