Skip to content

Commit

Permalink
main: use correct format specifiers for uint32_t
Browse files Browse the repository at this point in the history
Fixes clang-tidy warnings like these:

/willow/main/system.c:89:51: error: format specifies type 'unsigned long' but the argument has type 'uint32_t' (aka 'unsigned int') [clang-diagnostic-format]
    ESP_LOGI(TAG, "restarting after %lu seconds", delay);
                                    ~~~           ^
                                    %u

Reported-by: clang-tidy
  • Loading branch information
stintel committed Dec 15, 2023
1 parent 129658c commit 25c7781
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion main/ota.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void ota_task(void *data)
pt_new = esp_ota_get_next_update_partition(NULL);

if (pt_boot != pt_cur) {
ESP_LOGW(TAG, "boot partition (offset='0x%08lu') does not match running partition (offset='0x%08lu')",
ESP_LOGW(TAG, "boot partition (offset='0x%08" PRIu32 "') does not match running partition (offset='0x%08" PRIu32 "')",
pt_boot->address, pt_cur->address);
}

Expand Down
4 changes: 2 additions & 2 deletions main/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ void restart_delayed(void)
delay = 6;
}

ESP_LOGI(TAG, "restarting after %lu seconds", delay);
ESP_LOGI(TAG, "restarting after %" PRIu32 " seconds", delay);

if (lvgl_port_lock(lvgl_lock_timeout)) {
lv_label_set_text_fmt(lbl_ln4, "Restarting in %lu seconds", delay);
lv_label_set_text_fmt(lbl_ln4, "Restarting in %" PRIu32 " seconds", delay);
lv_obj_clear_flag(lbl_ln4, LV_OBJ_FLAG_HIDDEN);
lvgl_port_unlock();
}
Expand Down
2 changes: 1 addition & 1 deletion main/was.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ static void IRAM_ATTR cb_ws_event(const void *arg_evh, const esp_event_base_t *b
init_was();
break;
default:
ESP_LOGD(TAG, "unhandled WebSocket event - ID: %lu", id_ev);
ESP_LOGD(TAG, "unhandled WebSocket event - ID: %" PRIu32, id_ev);
break;
}
}
Expand Down

0 comments on commit 25c7781

Please sign in to comment.