106 Commits

Author SHA1 Message Date
David Volovskiy
23038c3f74 Reapply "Added double-tap capabilities to LIS2DW"
This reverts commit 3bd1254b5fbb53ce84bddd1fb806da3237a8f245.
2025-12-01 20:14:54 -05:00
David Volovskiy
eb3f02419e Merge branch 'main' into double-tap 2025-12-01 20:14:02 -05:00
David Volovskiy
a907760cc1 We forgot to enable the actual double tap 2025-12-01 20:11:40 -05:00
voloved
3bd1254b5f
Revert "Added double-tap capabilities to LIS2DW" 2025-12-01 20:09:34 -05:00
David Volovskiy
e7225e1d5c Merge branch 'main' into double-tap 2025-11-22 08:50:44 -05:00
David Volovskiy
5b6b415b86 Removed 6D interrupt 2025-11-22 08:49:54 -05:00
voloved
77ced0e666
Merge pull request #98 from voloved/default_temp_in_simulator
Added default temp of 25C in simulator
2025-11-21 08:49:38 -05:00
voloved
6f60806168
Merge pull request #105 from voloved/remove-duplicate-includes
Removed duplicate includes
2025-11-20 18:28:24 -05:00
David Volovskiy
eaae42cca9 Added double-tap capabilities to LIS2DW 2025-11-15 14:49:56 -05:00
David Volovskiy
6609b3f79a LIS2DW tap mode uses low-power mode 2025-11-15 14:13:22 -05:00
David Volovskiy
6374045c69 Removed duplicate include 2025-08-27 07:44:59 -04:00
David Volovskiy
d5eb32bc74 Removed duplicate includes 2025-08-27 07:42:54 -04:00
David Volovskiy
018c94f23d movement_get_temperature no longer returns early in case logic after reading will ever be needed 2025-08-24 08:58:49 -04:00
Joey Castillo
5ecc3d6384 increase delay before checking VBUS_DET 2025-08-24 08:28:50 -04:00
David Volovskiy
877d972190 Temperature now can be set by simulator 2025-08-23 11:45:53 -04:00
David Volovskiy
fb6978fde8 Added default temp of 25C in simulator 2025-08-19 08:41:18 -04:00
Alessandro Genova
d903a827e9 Fix simulator deep sleep mode 2025-08-03 13:20:53 -04:00
James Haggerty
78eb0c0c97 Fix command line in simulator
In the original movement, the 'usb enabled' check was overridden
to true for the simulator such that shell_task() would always
be executed. In the new 'dummy' device in gossamer used by the
simulator, this usb check returns false.

Seemed like a slightly cleaner thing to do was to call
shell_task() regardless rather than to incorrectly
pretend that USB was connected.
2025-07-28 09:23:54 -04:00
Joey Castillo
39d605204f mark movement_state as volatile 2025-07-27 12:39:31 -04:00
Joey Castillo
991a4a1dc5 add delay before sampling VBUS_DET 2025-07-27 11:30:49 -04:00
voloved
154bd54510
Set time on make (#35)
* Time can get set from makefile

* Added setting make time into simulator

* Added  Hash in settings

* Added default location

* Cuts the Githash to 6 characters in the settings in case the makefile didn't do that already

* bump gossamer commit

* remove automatic timezone setting

* automatic time set: rename MAKEFILE_ to BUILD_ to match gossamer

* Revert "Added default location"

This reverts commit c24f69450fd40472c4f6cebb790a56c3f0d69cb6.

* silence warning

* watch_get_init_date_time: explicitly initialize all fields to 0

---------

Co-authored-by: Joey Castillo <joeycastillo@utexas.edu>
2025-07-06 10:56:27 -04:00
Joey Castillo
37a8a92f58 bugfix: maintain accelerometer background sampling rate after wake from sleep 2025-07-03 17:14:08 -04:00
Joey Castillo
b1c67bea94 accelerometer: keep threshold across sleeps by tracking it in movement 2025-06-25 17:22:17 -04:00
Daniel Bergman
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
Joey Castillo
1a5ccd34a0 accelerometer: don't initialize on wake if already set up 2025-06-11 23:25:08 -04:00
Joey Castillo
ca46cb4988 for testing: add NOSLEEP build option to remove sleep mode entirely 2025-05-29 07:22:04 -04:00
Joey Castillo
69b8048790 power down accelerometer unless a watch face requests it 2025-05-26 10:51:11 -04:00
Joey Castillo
5ee0de27cf movement: fire top of minute at top of minute, not bottom of last minute 2025-05-21 15:08:00 -04:00
Joey Castillo
acdc32ffb4 movement: add loudness setting for button press 2025-05-20 17:27:32 -04:00
Joey Castillo
7d8ad1b87b simplify activity tracking, just active minutes for now 2025-05-17 13:54:37 -04:00
Joey Castillo
40a0308059 fix long press bug (seems related to disabling an interrupt) 2025-05-17 11:55:03 -04:00
Joey Castillo
47fbaccc77 add movement_get_temperature, works across different sensor boards 2025-05-17 11:03:51 -04:00
Joey Castillo
80cbb0fe30 automatically detect temperature sensor 2025-05-17 10:23:38 -04:00
Joey Castillo
c5bda0faeb auto-detect accelerometer sensor (and don't fail build for lack of a temperature sensor) 2025-05-16 00:07:15 -04:00
Joey Castillo
374a93846d FREQCORR is now handled in _watch_rtc_init 2025-05-15 21:33:26 -04:00
Joey Castillo
0739382fb8 remove orientation change counter 2025-05-13 18:21:58 -04:00
Joey Castillo
956b8601f6 enable filtering on button inputs 2025-05-12 22:25:27 -04:00
Joey Castillo
ff3b69a38b accelerometer: disable wake on motion, has awkward user experience 2025-04-28 18:29:57 -04:00
Joey Castillo
b0dbff4172 accelerometer: stop sleeping after inactivity, use LE settings 2025-04-28 18:29:57 -04:00
Joey Castillo
e435969b51 WIP: accelerometer activity tracking 2025-04-20 13:47:04 -04:00
Joey Castillo
29547227ee actually, set the time after loading settings (need to convert to UTC) 2025-03-15 18:30:37 -04:00
Joey Castillo
32086bc499 happy (belated) new year 2025-03-15 18:15:08 -04:00
Joey Castillo
7d129ba6c3 world clock: support longer cities on custom LCD 2025-03-15 15:20:22 -04:00
Joey Castillo
ecc633fab4 second movement: persist settings to file system 2025-03-15 11:44:00 -04:00
Joey Castillo
c1efea4db7 lcd autodetect: use buttons as a backup option 2025-03-15 09:48:53 -04:00
Joey Castillo
185b9b1b97 move activity logging into Movement core 2025-03-12 23:05:06 -04:00
Joey Castillo
99a28dc886 accelerometer: have been using a threshold of 8 for latest tests 2024-12-16 16:41:26 -05:00
Joey Castillo
4b5e15cc1d accelrometer: add tap event, test by adding tap to set countdown 2024-11-27 18:04:17 -05:00
joeycastillo
c6af677b79 accel: count orientation changes with TC2 instead of waking up 2024-11-18 23:50:21 -05:00
joeycastillo
548260b13e accelerometer: vibe check complete, no need for these diagnostic beeps 2024-11-18 22:26:45 -05:00