diff --git a/movement.c b/movement.c index f71ee58f..bae267b3 100644 --- a/movement.c +++ b/movement.c @@ -326,13 +326,13 @@ static void _movement_handle_button_presses(uint32_t pending_events) { } // If a long press occurred - if (pending_events & (1 << button->down_event + 2)) { + if (pending_events & (1 << (button->down_event + 2))) { watch_rtc_register_comp_callback_no_schedule(button->cb_longpress, button->down_timestamp + MOVEMENT_REALLY_LONG_PRESS_TICKS, button->timeout_index); any_long = true; } // If a really long press occurred - if (pending_events & (1 << button->down_event + 4)) { + if (pending_events & (1 << (button->down_event + 4))) { watch_rtc_register_comp_callback_no_schedule(button->cb_longpress, button->down_timestamp + MOVEMENT_MAX_LONG_PRESS_TICKS, button->timeout_index); any_long = true; } diff --git a/watch-faces/demo/rtccount_face.c b/watch-faces/demo/rtccount_face.c index 72a3055a..6e7cb08c 100644 --- a/watch-faces/demo/rtccount_face.c +++ b/watch-faces/demo/rtccount_face.c @@ -93,7 +93,7 @@ static void _rtccount_face_draw(movement_event_t event, rtccount_state_t* state) switch (state->status) { case RTCCOUNT_STATUS_COUNTER: { - snprintf(buf, sizeof(buf), "%u", counter & COUNTER_MASK); + snprintf(buf, sizeof(buf), "%lu", counter & COUNTER_MASK); size_t len = strlen(buf); @@ -102,7 +102,7 @@ static void _rtccount_face_draw(movement_event_t event, rtccount_state_t* state) } case RTCCOUNT_STATUS_COUNTER_SUB: { - snprintf(buf, sizeof(buf), "%u", counter & 127); + snprintf(buf, sizeof(buf), "%lu", counter & 127); size_t len = strlen(buf); @@ -111,7 +111,7 @@ static void _rtccount_face_draw(movement_event_t event, rtccount_state_t* state) } case RTCCOUNT_STATUS_MINUTES: { - snprintf(buf, sizeof(buf), "%u", state->n_top_of_minute & COUNTER_MASK); + snprintf(buf, sizeof(buf), "%lu", state->n_top_of_minute & COUNTER_MASK); size_t len = strlen(buf); @@ -122,7 +122,7 @@ static void _rtccount_face_draw(movement_event_t event, rtccount_state_t* state) case RTCCOUNT_STATUS_MINUTES_DIFF: { uint32_t elapsed_minutes = (movement_get_utc_timestamp() - state->ref_timestamp) / 60; - snprintf(buf, sizeof(buf), "%u", (elapsed_minutes - state->n_top_of_minute) & COUNTER_MASK); + snprintf(buf, sizeof(buf), "%lu", (elapsed_minutes - state->n_top_of_minute) & COUNTER_MASK); size_t len = strlen(buf); diff --git a/watch-library/hardware/watch/watch_rtc.c b/watch-library/hardware/watch/watch_rtc.c index 114c1ee4..7cfa81c2 100644 --- a/watch-library/hardware/watch/watch_rtc.c +++ b/watch-library/hardware/watch/watch_rtc.c @@ -37,7 +37,6 @@ static const uint32_t RTC_CNT_HZ = RTC_OSC_HZ >> RTC_PRESCALER_DIV; // 1024 / 2^ static const uint32_t RTC_CNT_SUBSECOND_MASK = RTC_CNT_HZ - 1; static const uint32_t RTC_CNT_DIV = RTC_OSC_DIV - RTC_PRESCALER_DIV; // 7 static const uint32_t RTC_CNT_TICKS_PER_MINUTE = RTC_CNT_HZ * 60; -static const uint32_t RTC_CNT_TICKS_PER_HOUR = RTC_CNT_TICKS_PER_MINUTE * 60; static const uint32_t RTC_COMP_GRACE_PERIOD = 4; diff --git a/watch-library/simulator/watch/watch_rtc.c b/watch-library/simulator/watch/watch_rtc.c index 1347d797..4927ba14 100644 --- a/watch-library/simulator/watch/watch_rtc.c +++ b/watch-library/simulator/watch/watch_rtc.c @@ -34,7 +34,6 @@ static const uint32_t RTC_CNT_HZ = 128; static const uint32_t RTC_CNT_SUBSECOND_MASK = RTC_CNT_HZ - 1; static const uint32_t RTC_CNT_DIV = 7; static const uint32_t RTC_CNT_TICKS_PER_MINUTE = RTC_CNT_HZ * 60; -static const uint32_t RTC_CNT_TICKS_PER_HOUR = RTC_CNT_TICKS_PER_MINUTE * 60; static uint32_t counter_interval; static uint32_t counter;