}
// 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;
}
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);
}
case RTCCOUNT_STATUS_COUNTER_SUB: {
- snprintf(buf, sizeof(buf), "%u", counter & 127);
+ snprintf(buf, sizeof(buf), "%lu", counter & 127);
size_t len = strlen(buf);
}
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);
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);
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;
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;