Commit Graph
19 Commits
Author SHA1 Message Date
Daniel BergmanandJoey Castillo 6f08545e12 Fix compiler warnings: missing prototype, unused variables, implicit declaration 2025-11-18 11:43:53 -05:00
Daniel Bergman 647457f27a Add a defensive check for negative values - silences compiler warnings 2025-08-09 19:52:35 +02:00
Daniel BergmanandJoey Castillo bc02072250 Blank day field on reset 2025-08-03 13:08:47 -04:00
Daniel BergmanandGitHub 4d45fcde30 Tally face: fix build warnings (#43)
Clamp tally index values in print_tally function to ensure they remain within defined limits, silencing compiler warnings
2025-07-07 19:14:07 -04:00
Daniel BergmanandJoey Castillo a74cfd547a Fix compiler warnings by casting centibeats to unsigned int in beats_face.c. Also make precedence explicit in ms calculation. 2025-07-06 16:15:14 -04:00
a729f04f13 Update README to contain git and make information (#37)
* Grab parts of the main sensor-watch README, and update with second-movement git and build info

* add BOARD and DISPLAY to emmake instructions

---------

Co-authored-by: Joey Castillo <joeycastillo@utexas.edu>
2025-07-06 15:28:17 -04:00
Daniel BergmanandGitHub 73e62bbc18 New watchface: ish face (#21) 2025-07-06 12:00:56 -04:00
Daniel BergmanandGitHub bdc6f98daa Port Breathing face to second movement, also add LED notification. General fixes. (#34) 2025-07-06 11:58:16 -04:00
Daniel Bergman fff73a8806 Update beats face to use UTC+1. Simplify clock2beats function. 2025-06-30 21:39:21 +02:00
Daniel Bergman bca2fd396a Move emscripten targets to gossamer's rules.mk 2025-06-29 11:00:47 +02:00
Daniel BergmanandGitHub 1d9917c40d Remove stray spaces from sunrise_sunset_face.c 2025-06-28 18:50:58 +02:00
Daniel Bergman 741e25db0d Handle hour overflow 2025-06-28 18:28:57 +02:00
Daniel Bergman e711fd3e60 Cut the corruption checks. When the user updates the location we should be writing correct values to file. 2025-06-28 18:17:34 +02:00
Daniel Bergman 0234f7a391 Better hundreds handling 2025-06-28 17:50:08 +02:00
Daniel Bergman 0b7f53f99d INCLUDES project root in a Windows friendly way 2025-06-28 14:29:05 +02:00
Daniel Bergman 182db67aeb Stray lf 2025-06-28 12:08:42 +02:00
Daniel Bergman 39ca51eeaa Fix handling of longitude data > 100, including longitude data recovery in sunrise/sunset face
- Added functions to detect and recover from corrupted longitude data.
- Updated the activation process to handle potential corruption by recovering and saving corrected longitude values.
- Ensured that longitude values are reset to zero when exceeding valid limits.
2025-06-28 12:07:04 +02:00
Daniel Bergman 1c89baa8d1 Update Makefile to conditionally require BOARD and DISPLAY only for non-clean targets 2025-06-26 20:48:03 +02:00
Daniel BergmanandGitHub 7f9a00ef35 fix(lis2dw): Re-initialize accelerometer after waking from sleep (#16)
* fix(lis2dw): Re-initialize accelerometer after waking from sleep

The LIS2DW accelerometer was not being re-initialized correctly after the device woke from sleep mode. When entering sleep, `watch_enter_sleep_mode` disables peripherals and pins, including those for I²C, to conserve power.

Upon waking, the `app_setup` function was designed to re-initialize the hardware. However, the logic only performed the I²C device check once on the initial boot. On subsequent wakes, the `movement_state.has_lis2dw` flag would prevent the I²C bus and the LIS2DW driver from being set up again. This caused any watch face functionality that relied on the accelerometer, such as the countdown face's tap detection, to fail after a sleep/wake cycle.

This commit refactors the initialization logic within `app_setup`. It now uses a static boolean `lis2dw_initialized` to ensure the sensor is detected only once at boot time. On subsequent wakes, if the sensor was originally found to be present, the I²C bus is explicitly re-enabled and the driver is re-initialized with `lis2dw_begin()` before its configuration is reapplied. This ensures the accelerometer is reliably available after every wake-up.

* fix(lis2dw): only check for accelerometer presence once per boot

Previously, devices without the LIS2DW sensor would re-enable I2C and attempt to detect the sensor on every wake from sleep, wasting power and CPU cycles. This change introduces a static `lis2dw_checked` flag that is set after the first detection attempt, regardless of whether the sensor is found. Now, the presence check and I2C enable/disable only occur once per boot, ensuring that devices without the sensor do not repeatedly attempt detection, improving efficiency and battery life.
2025-06-25 09:18:33 -04:00