From e353d4760f951031723bc8e06d5a139b63c82c03 Mon Sep 17 00:00:00 2001 From: Alessandro Genova Date: Wed, 26 Nov 2025 13:23:42 -0500 Subject: [PATCH] disable REALLY_LONG_UP event for now --- movement.c | 16 +++++++++------- movement.h | 6 +++--- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/movement.c b/movement.c index bae267b3..f0fb9609 100644 --- a/movement.c +++ b/movement.c @@ -63,9 +63,9 @@ watch_date_time_t scheduled_tasks[MOVEMENT_NUM_FACES]; const int32_t movement_le_inactivity_deadlines[8] = {INT_MAX, 600, 3600, 7200, 21600, 43200, 86400, 604800}; const int16_t movement_timeout_inactivity_deadlines[4] = {60, 120, 300, 1800}; -const uint32_t _movement_mode_button_events_mask = 0b111111 << EVENT_MODE_BUTTON_DOWN; -const uint32_t _movement_light_button_events_mask = 0b111111 << EVENT_LIGHT_BUTTON_DOWN; -const uint32_t _movement_alarm_button_events_mask = 0b111111 << EVENT_ALARM_BUTTON_DOWN; +const uint32_t _movement_mode_button_events_mask = 0b11111 << EVENT_MODE_BUTTON_DOWN; +const uint32_t _movement_light_button_events_mask = 0b11111 << EVENT_LIGHT_BUTTON_DOWN; +const uint32_t _movement_alarm_button_events_mask = 0b11111 << EVENT_ALARM_BUTTON_DOWN; const uint32_t _movement_button_events_mask = _movement_mode_button_events_mask | _movement_light_button_events_mask | _movement_alarm_button_events_mask; typedef struct { @@ -340,8 +340,8 @@ static void _movement_handle_button_presses(uint32_t pending_events) { // If a button up or button long up occurred if (pending_events & ( (1 << (button->down_event + 1)) | - (1 << (button->down_event + 3)) | - (1 << (button->down_event + 5)) + (1 << (button->down_event + 3)) + // (1 << (button->down_event + 5)) )) { // We cancel the timeout if it hasn't fired yet watch_rtc_disable_comp_callback_no_schedule(button->timeout_index); @@ -1408,7 +1408,8 @@ static movement_event_type_t _process_button_event(bool pin_level, movement_butt button->up_timestamp = counter; #endif if ((counter - button->down_timestamp) >= MOVEMENT_REALLY_LONG_PRESS_TICKS) { - event_type = button->down_event + 5; + // event_type = button->down_event + 5; + event_type = button->down_event + 3; // TODO: swith to REALLY_LONG_UP } else if ((counter - button->down_timestamp) >= MOVEMENT_LONG_PRESS_TICKS) { event_type = button->down_event + 3; } else { @@ -1462,7 +1463,8 @@ static movement_event_type_t _process_button_longpress_timeout(bool pin_level, m #endif button->is_down = false; if (max_long_press) { - return button->down_event + 5; // event_really_long_up + // return button->down_event + 5; // event_really_long_up + return button->down_event + 3; // event_long_up TODO: use really_long_up } else if (really_long_press) { return button->down_event + 3; // event_long_up } else { diff --git a/movement.h b/movement.h index 305a2e8c..1bbd9638 100644 --- a/movement.h +++ b/movement.h @@ -122,19 +122,19 @@ typedef enum { EVENT_LIGHT_LONG_PRESS, // The light button was held for over half a second, but not yet released. EVENT_LIGHT_LONG_UP, // The light button was held for over half a second, and released. EVENT_LIGHT_REALLY_LONG_PRESS, // The light button was held for more than 1.5 second, note yet released. - EVENT_LIGHT_REALLY_LONG_UP, // The light button was held for more than 1.5 second, and released. + // EVENT_LIGHT_REALLY_LONG_UP, // The light button was held for more than 1.5 second, and released. EVENT_MODE_BUTTON_DOWN, // The mode button has been pressed, but not yet released. EVENT_MODE_BUTTON_UP, // The mode button was pressed for less than half a second, and released. EVENT_MODE_LONG_PRESS, // The mode button was held for over half a second, but not yet released. EVENT_MODE_LONG_UP, // The mode button was held for over half a second, and released. NOTE: your watch face will resign immediately after receiving this event. EVENT_MODE_REALLY_LONG_PRESS, // The mode button was held for more than 1.5 second, note yet released. - EVENT_MODE_REALLY_LONG_UP, // The mode button was held for more than 1.5 second, and released. + // EVENT_MODE_REALLY_LONG_UP, // The mode button was held for more than 1.5 second, and released. EVENT_ALARM_BUTTON_DOWN, // The alarm button has been pressed, but not yet released. EVENT_ALARM_BUTTON_UP, // The alarm button was pressed for less than half a second, and released. EVENT_ALARM_LONG_PRESS, // The alarm button was held for over half a second, but not yet released. EVENT_ALARM_LONG_UP, // The alarm button was held for over half a second, and released. EVENT_ALARM_REALLY_LONG_PRESS, // The alarm button was held for more than 1.5 second, note yet released. - EVENT_ALARM_REALLY_LONG_UP, // The alarm button was held for more than 1.5 second, and released. + // EVENT_ALARM_REALLY_LONG_UP, // The alarm button was held for more than 1.5 second, and released. EVENT_ACCELEROMETER_WAKE, // The accelerometer has detected motion and woken up. EVENT_SINGLE_TAP, // Accelerometer detected a single tap. This event is not yet implemented.