_settings_loop() never handled EVENT_TIMEOUT, so leaving the watch
face parked in settings mode (4Hz tick, blinking abbreviation) with
no button presses meant it stayed there indefinitely instead of
returning to the clock display like every other face's settings mode
does on timeout.
Factor the existing EVENT_MODE_BUTTON_UP transition logic into
_exit_settings_mode() and reuse it for EVENT_TIMEOUT.
Improvements:
- The name of the time zone is displayed for a brief movement when cycling through the selected time zones.
- The face now comes with pre-selected zones to show-case its functionality: Seattle, New York, UTC, Shanghai, and Tokyo.
_monitor_display() used %C (wide character, expects wint_t) instead
of %c (plain char/int) to print the X/Y/Z axis label. Every other
single-character display in the codebase uses %c; on the embedded
build, without wide-char support in the C library, %C is not a
valid conversion for the char actually being passed.
state->settings was malloc'd in lis2dw_monitor_face_setup() outside
the guard that only runs on first allocation of the face's context.
setup() is called again every time the watch wakes from deep sleep
(movement.c's app_setup() re-runs watch_faces[i].setup() for every
face on wake), so each wake cycle allocated a new settings array and
abandoned the previous pointer with no matching free.
Since NUM_SETTINGS is a compile-time constant, make settings a
fixed-size array embedded directly in lis2dw_monitor_state_t instead
of a separately malloc'd pointer, so it's allocated exactly once
along with the rest of the state and never leaks.
The Frq page used remainderf to extract the fractional part of the
correction value, but remainderf rounds to the nearest integer and
returns negative results when the fraction exceeds 0.5. This caused
values like 0.965 ppm to render as " 0-350" instead of " 09650".
Switch to fmodf, matching the DELtA page above.
Python is needed to run uf2conv, so the final build step will fail
without it. Most folks will have a global Python to fall back to, but
this change fixes the build for those who don't, and makes the Nix
environment more complete.
With double tap enabled, one had to tap not too fast on
the watch to increment the minutes regularly. Otherwise,
some taps would be discarded.
This made using the countdown face without looking at the
screen for acknowledgement of taps impossible.
It was also impossible to increment minutes quickly, every second tap
would be discarded.