summaryrefslogtreecommitdiffstats
path: root/movement
diff options
context:
space:
mode:
authorJoey Castillo <joeycastillo@utexas.edu>2022-01-25 17:36:04 -0500
committerJoey Castillo <joeycastillo@utexas.edu>2022-01-25 17:36:04 -0500
commit71ea3b9de98de7034c081adaae2e1e1ff79390d4 (patch)
treef7b5a59613169f09207b2435a2f145ecf39cd6cd /movement
parent2a59ae950f653a1730686ede8f77d74aea125efe (diff)
downloadSensor-Watch-71ea3b9de98de7034c081adaae2e1e1ff79390d4.tar.gz
Sensor-Watch-71ea3b9de98de7034c081adaae2e1e1ff79390d4.tar.bz2
Sensor-Watch-71ea3b9de98de7034c081adaae2e1e1ff79390d4.zip
movement: add documentation mentioned in #42
Diffstat (limited to 'movement')
-rw-r--r--movement/README.md4
1 files changed, 4 insertions, 0 deletions
diff --git a/movement/README.md b/movement/README.md
index 5d5b0e2f..152921aa 100644
--- a/movement/README.md
+++ b/movement/README.md
@@ -31,6 +31,8 @@ To create a new watch face, you should create a new C header and source file in
})
```
+You will also have to add your watch face to the `Makefile` so that it will be compiled in, and to `movement_faces.h` so that it will be available to add to the carousel. A good example of the changes required [can be found here](https://github.com/joeycastillo/Sensor-Watch/commit/2a59ae950f653a1730686ede8f77d74aea125efe).
+
This section will go over how each function works. The section headings use the watch_face prefix, but know that you should implement each function with your own prefix as described above.
### watch_face_setup
@@ -59,6 +61,8 @@ There is also a `subsecond` property on the event that contains the fractional s
You should set up a switch statement that handles, at the very least, the `EVENT_TICK` and `EVENT_MODE_BUTTON_UP` event types. The mode button up event occurs when the user presses the MODE button. **Your loop function SHOULD call the movement_move_to_next_face function in response to this event.** If you have a very good reason to override this behavior (e.g. your user interface requires all three buttons), you may do so, but the user will have to long-press the Mode button to advance to the next watch face.
+Note that `watch_face_loop` returns a boolean value. This boolean value indicates to Movement whether the watch can enter standby mode after handling your loop (true), or whether it should stay awake (false). You SHOULD almost always return true here, as the watch uses significantly more power when idling as opposed to standing by. The only times you would return false here are if you are PWM'ing the LED or emitting a sound from the buzzer. Your watch face would want to keep the watch awake in this case because the PWM driver does not run in standby.
+
### watch_face_resign
This function is called just before your watch face goes off screen. You should disable any peripherals you enabled in `watch_face_activate`. The watch_face_resign function is passed the same settings and context as the other functions.