This watch face monitors daily hydration by tracking and logging water intake.
In tracking mode: Display current water intake and percentage
- Alarm button: +100ml (or configured glass size)
- Light button: -100ml (or configured glass size)
- Alarm long press: Display deviation from estimate
- Light long press: Switch to settings mode
- Alarm really long press: Switch to log mode
In settings mode: Configure glass size, daily goal, wake time, sleep time, alert interval
- Light button: Switch to next setting
- Alarm button: Advance current setting
- Alarm long press: Reset to default value
- Mode button: Switch to tracking mode
In log mode: Display log entries of water intake, date and deviation from goal
- Alarm button: Switch to next log entry
- Light button: Cycle through intake, date and deviation
- Mode button: Switch to tracking mode
Background tasks:
- Automatic reset at wake time
- Alert if intake below estimate at sleep time
- Alert at interval if intake below estimate, waking the watch if asleep
_increment_date() kept its own copy of the days-per-month table
and leap-year check, duplicating _days_in_month() in the same
file. Two sources of truth is how the July day-count typo went
unnoticed. Call _days_in_month() directly instead, leaving one
table in the file.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PSucp94GA31sshe5AjvSzQ
date_time.unit.day is a 5-bit bitfield (max 31). Incrementing 31
directly in the bitfield wrapped to 0 via truncation before the
day > days_in_month bounds check ever ran, so the overflow was
never caught. The result decoded as "day 0" of the current month,
i.e. the last day of the previous month, silently rolling the
displayed date backwards (e.g. Aug 31 -> Jul 31 -> Jun 30).
Compute the incremented day in a plain uint8_t local first, compare
it against the month length, and only then write the final value
into the bitfield.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PSucp94GA31sshe5AjvSzQ
The local days_in_month table in _increment_date() listed July as
having 30 days instead of 31, diverging from the correct table in
_days_in_month(). This made July 31 unreachable when incrementing
the day field in settings mode.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PSucp94GA31sshe5AjvSzQ
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.