From f95cd68b2587e1372e8e9cd237ffb7bc6dc1b98f Mon Sep 17 00:00:00 2001 From: oliverpool Date: Mon, 24 Nov 2025 19:26:38 +0100 Subject: [PATCH 1/3] deadline_face: move description to .h file See #152 --- watch-faces/complication/deadline_face.c | 74 ------------------------ watch-faces/complication/deadline_face.h | 74 ++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 74 deletions(-) diff --git a/watch-faces/complication/deadline_face.c b/watch-faces/complication/deadline_face.c index d3204f20..b145a618 100644 --- a/watch-faces/complication/deadline_face.c +++ b/watch-faces/complication/deadline_face.c @@ -23,80 +23,6 @@ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* - * # Deadline Face - * - * This is a watch face for tracking deadlines. It draws inspiration from - * other watch faces of the project but focuses on keeping track of - * deadlines. You can enter and monitor up to four different deadlines by - * providing their respective date and time. The face has two modes: - * *running mode* and *settings mode*. - * - * ## Running Mode - * - * When the watch face is activated, it defaults to running mode. The top - * right corner shows the current deadline number, and the main display - * presents the time left until the deadline. The format of the display - * varies depending on the remaining time. - * - * - When less than a day is left, the display shows the remaining hours, - * minutes, and seconds in the form `HH:MM:SS`. - * - * - When less than a month is left, the display shows the remaining days - * and hours in the form `DD:HH` with the unit `dy` for days. - * - * - When less than a year is left, the display shows the remaining months - * and days in the form `MM:DD` with the unit `mo` for months. - * - * - When more than a year is left, the years and months are displayed in - * the form `YY:MM` with the unit `yr` for years. - * - * - When a deadline has passed in the last 24 hours, the display shows - * `over` to indicate that the deadline has just recently been reached. - * - * - When no deadline is set for a particular slot, or if a deadline has - * already passed by more than 24 hours, `--:--` is displayed. - * - * The user can navigate in running mode using the following buttons: - * - * - The *alarm button* moves the next deadline. There are currently four - * slots available for deadlines. When the last slot has been reached, - * pressing the button moves to the first slot. - * - * - A *long press* on the *alarm button* activates settings mode and - * enables configuring the currently selected deadline. - * - * - A *long press* on the *light button* activates a deadline alarm. The - * bell icon is displayed, and the alarm will ring upon reaching any of - * the deadlines set. It is important to note that the watch will not - * enter low-energy sleep mode while the alarm is enabled. - * - * - * ## Settings Mode - * - * In settings mode, the currently selected slot for a deadline can be - * configured by providing the date and the time. Like running mode, the - * top right corner of the display indicates the current deadline number. - * The main display shows the date and, on the next page, the time to be - * configured. - * - * The user can use the following buttons in settings mode. - * - * - The *light button* navigates through the different date and time - * settings, going from year, month, day, hour, to minute. The selected - * position is blinking. - * - * - A *long press* on the light button resets the date and time to the next - * day at midnight. This is the default deadline. - * - * - The *alarm button* increments the currently selected position. A *long - * press* on the *alarm button* changes the value faster. - * - * - The *mode button* exists setting mode and returns to *running mode*. - * Here the selected deadline slot can be changed. - * - */ - #include #include #include "deadline_face.h" diff --git a/watch-faces/complication/deadline_face.h b/watch-faces/complication/deadline_face.h index 98a50d2d..6da3c893 100644 --- a/watch-faces/complication/deadline_face.h +++ b/watch-faces/complication/deadline_face.h @@ -26,6 +26,80 @@ #ifndef DEADLINE_FACE_H_ #define DEADLINE_FACE_H_ +/* + * # Deadline Face + * + * This is a watch face for tracking deadlines. It draws inspiration from + * other watch faces of the project but focuses on keeping track of + * deadlines. You can enter and monitor up to four different deadlines by + * providing their respective date and time. The face has two modes: + * *running mode* and *settings mode*. + * + * ## Running Mode + * + * When the watch face is activated, it defaults to running mode. The top + * right corner shows the current deadline number, and the main display + * presents the time left until the deadline. The format of the display + * varies depending on the remaining time. + * + * - When less than a day is left, the display shows the remaining hours, + * minutes, and seconds in the form `HH:MM:SS`. + * + * - When less than a month is left, the display shows the remaining days + * and hours in the form `DD:HH` with the unit `dy` for days. + * + * - When less than a year is left, the display shows the remaining months + * and days in the form `MM:DD` with the unit `mo` for months. + * + * - When more than a year is left, the years and months are displayed in + * the form `YY:MM` with the unit `yr` for years. + * + * - When a deadline has passed in the last 24 hours, the display shows + * `over` to indicate that the deadline has just recently been reached. + * + * - When no deadline is set for a particular slot, or if a deadline has + * already passed by more than 24 hours, `--:--` is displayed. + * + * The user can navigate in running mode using the following buttons: + * + * - The *alarm button* moves the next deadline. There are currently four + * slots available for deadlines. When the last slot has been reached, + * pressing the button moves to the first slot. + * + * - A *long press* on the *alarm button* activates settings mode and + * enables configuring the currently selected deadline. + * + * - A *long press* on the *light button* activates a deadline alarm. The + * bell icon is displayed, and the alarm will ring upon reaching any of + * the deadlines set. It is important to note that the watch will not + * enter low-energy sleep mode while the alarm is enabled. + * + * + * ## Settings Mode + * + * In settings mode, the currently selected slot for a deadline can be + * configured by providing the date and the time. Like running mode, the + * top right corner of the display indicates the current deadline number. + * The main display shows the date and, on the next page, the time to be + * configured. + * + * The user can use the following buttons in settings mode. + * + * - The *light button* navigates through the different date and time + * settings, going from year, month, day, hour, to minute. The selected + * position is blinking. + * + * - A *long press* on the light button resets the date and time to the next + * day at midnight. This is the default deadline. + * + * - The *alarm button* increments the currently selected position. A *long + * press* on the *alarm button* changes the value faster. + * + * - The *mode button* exists setting mode and returns to *running mode*. + * Here the selected deadline slot can be changed. + * + */ + #include "movement.h" /* Modes of face */ From 9b93db7fa6f5ca88afb5ec612d380a064afa1755 Mon Sep 17 00:00:00 2001 From: voloved <36523934+voloved@users.noreply.github.com> Date: Mon, 1 Dec 2025 08:19:05 -0500 Subject: [PATCH 2/3] Revert "Fix for wrong date being shown on sunrise/sunset complication." --- watch-faces/complication/sunrise_sunset_face.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/watch-faces/complication/sunrise_sunset_face.c b/watch-faces/complication/sunrise_sunset_face.c index d19dcb61..7dcb3350 100644 --- a/watch-faces/complication/sunrise_sunset_face.c +++ b/watch-faces/complication/sunrise_sunset_face.c @@ -84,7 +84,7 @@ static void _sunrise_sunset_face_update(sunrise_sunset_state_t *state) { watch_date_time_t date_time = movement_get_local_date_time(); // the current local date / time watch_date_time_t utc_now = watch_utility_date_time_convert_zone(date_time, movement_get_current_timezone_offset(), 0); // the current date / time in UTC watch_date_time_t scratch_time; // scratchpad, contains different values at different times - scratch_time.reg = date_time.reg; + scratch_time.reg = utc_now.reg; // Weird quirky unsigned things were happening when I tried to cast these directly to doubles below. // it looks redundant, but extracting them to local int16's seemed to fix it. @@ -200,7 +200,7 @@ static void _sunrise_sunset_face_update(sunrise_sunset_state_t *state) { } // it's after sunset. we need to display sunrise/sunset for tomorrow. - uint32_t timestamp = watch_utility_date_time_to_unix_time(date_time, 0); + uint32_t timestamp = watch_utility_date_time_to_unix_time(utc_now, 0); timestamp += 86400; scratch_time = watch_utility_date_time_from_unix_time(timestamp, 0); } From 3bd1254b5fbb53ce84bddd1fb806da3237a8f245 Mon Sep 17 00:00:00 2001 From: voloved <36523934+voloved@users.noreply.github.com> Date: Mon, 1 Dec 2025 20:09:34 -0500 Subject: [PATCH 3/3] Revert "Added double-tap capabilities to LIS2DW" --- movement.c | 5 ++--- watch-library/shared/driver/lis2dw.c | 14 -------------- watch-library/shared/driver/lis2dw.h | 4 ---- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/movement.c b/movement.c index e81ccb94..ec54a9ba 100644 --- a/movement.c +++ b/movement.c @@ -514,7 +514,7 @@ bool movement_enable_tap_detection_if_available(void) { if (movement_state.has_lis2dw) { // configure tap duration threshold and enable Z axis lis2dw_configure_tap_threshold(0, 0, 12, LIS2DW_REG_TAP_THS_Z_Z_AXIS_ENABLE); - lis2dw_configure_tap_duration(2, 2, 2); + lis2dw_configure_tap_duration(10, 2, 2); // ramp data rate up to 400 Hz and high performance mode lis2dw_set_low_noise_mode(true); @@ -525,7 +525,7 @@ bool movement_enable_tap_detection_if_available(void) { delay_ms(3); // enable tap detection on INT1/A3. - lis2dw_configure_int1(LIS2DW_CTRL4_INT1_SINGLE_TAP | LIS2DW_CTRL4_INT1_DOUBLE_TAP); + lis2dw_configure_int1(LIS2DW_CTRL4_INT1_SINGLE_TAP | LIS2DW_CTRL4_INT1_6D); return true; } @@ -539,7 +539,6 @@ bool movement_disable_tap_detection_if_available(void) { lis2dw_set_low_noise_mode(false); lis2dw_set_data_rate(movement_state.accelerometer_background_rate); lis2dw_set_mode(LIS2DW_MODE_LOW_POWER); - lis2dw_disable_double_tap(); // ...disable Z axis (not sure if this is needed, does this save power?)... lis2dw_configure_tap_threshold(0, 0, 0, 0); diff --git a/watch-library/shared/driver/lis2dw.c b/watch-library/shared/driver/lis2dw.c index 1c89f244..b716f790 100644 --- a/watch-library/shared/driver/lis2dw.c +++ b/watch-library/shared/driver/lis2dw.c @@ -302,20 +302,6 @@ void lis2dw_clear_fifo(void) { #endif } -void lis2dw_enable_double_tap(void) { -#ifdef I2C_SERCOM - uint8_t configuration = watch_i2c_read8(LIS2DW_ADDRESS, LIS2DW_REG_WAKE_UP_THS); - watch_i2c_write8(LIS2DW_ADDRESS, LIS2DW_REG_WAKE_UP_THS, configuration | LIS2DW_WAKE_UP_THS_ENABLE_DOUBLE_TAP); -#endif -} - -void lis2dw_disable_double_tap(void) { -#ifdef I2C_SERCOM - uint8_t configuration = watch_i2c_read8(LIS2DW_ADDRESS, LIS2DW_REG_WAKE_UP_THS); - watch_i2c_write8(LIS2DW_ADDRESS, LIS2DW_REG_WAKE_UP_THS, configuration & ~LIS2DW_WAKE_UP_THS_ENABLE_DOUBLE_TAP); -#endif -} - void lis2dw_enable_sleep(void) { #ifdef I2C_SERCOM uint8_t configuration = watch_i2c_read8(LIS2DW_ADDRESS, LIS2DW_REG_WAKE_UP_THS); diff --git a/watch-library/shared/driver/lis2dw.h b/watch-library/shared/driver/lis2dw.h index 3b017c65..57ff05b2 100644 --- a/watch-library/shared/driver/lis2dw.h +++ b/watch-library/shared/driver/lis2dw.h @@ -343,10 +343,6 @@ bool lis2dw_read_fifo(lis2dw_fifo_t *fifo_data); void lis2dw_clear_fifo(void); -void lis2dw_enable_double_tap(void); - -void lis2dw_disable_double_tap(void); - void lis2dw_enable_sleep(void); void lis2dw_disable_sleep(void);