]> git.earman.xyz Git - sensor-watch.git/commitdiff
Removed all of the compiler warnings
authorDavid Volovskiy <devolov@gmail.com>
Sun, 23 Nov 2025 17:27:00 +0000 (12:27 -0500)
committerAlessandro Genova <ales.genova@gmail.com>
Sat, 3 Jan 2026 01:07:56 +0000 (20:07 -0500)
movement.c
watch-faces/demo/rtccount_face.c
watch-library/hardware/watch/watch_rtc.c
watch-library/simulator/watch/watch_rtc.c

index f71ee58f058035e9ed304653ed039fabbd854b6e..bae267b388cae9d8bf1aea263574d3ccdd265d2c 100644 (file)
@@ -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;
         }
index 72a3055a6a259d36d643a9ebbfd999d0d63b0a9c..6e7cb08c704c4d3165ed11569e5f1653d4bb4132 100644 (file)
@@ -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);
 
index 114c1ee458d5572e8200ad6dadc9403e321829f9..7cfa81c2dd155bac4035ceb240221cfa0af4ba70 100644 (file)
@@ -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;
 
index 1347d797f662ec567a607b8aeec70ae9bd6589fc..4927ba147eb6df87ced533c9c95aab33a972fe86 100644 (file)
@@ -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;