chore(demo/indev): fix warning (#3583)

* chore(demo/indev): fix warning

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>

* fix 'Micropython CI / Build rp2 port' warning

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com>
This commit is contained in:
_VIFEXTech
2022-08-17 18:32:51 +08:00
committed by GitHub
parent b08bc4c775
commit 1de64ade88
2 changed files with 9 additions and 8 deletions
+1 -1
View File
@@ -225,7 +225,7 @@ static void auto_step_cb(lv_timer_t * t)
lv_obj_t * num = lv_label_create(bg); lv_obj_t * num = lv_label_create(bg);
lv_obj_set_style_text_font(num, font_large, 0); lv_obj_set_style_text_font(num, font_large, 0);
#if LV_USE_PERF_MONITOR #if LV_USE_PERF_MONITOR
lv_label_set_text_fmt(num, "%d", lv_refr_get_fps_avg()); lv_label_set_text_fmt(num, "%" LV_PRIu32, lv_refr_get_fps_avg());
#endif #endif
lv_obj_align(num, LV_ALIGN_TOP_MID, 0, 120); lv_obj_align(num, LV_ALIGN_TOP_MID, 0, 120);
+8 -7
View File
@@ -356,16 +356,16 @@ static void indev_pointer_proc(lv_indev_t * i, lv_indev_data_t * data)
/*Simple sanity check*/ /*Simple sanity check*/
if(data->point.x < 0) { if(data->point.x < 0) {
LV_LOG_WARN("X is %d which is smaller than zero", data->point.x); LV_LOG_WARN("X is %d which is smaller than zero", (int)data->point.x);
} }
if(data->point.x >= lv_disp_get_hor_res(i->driver->disp)) { if(data->point.x >= lv_disp_get_hor_res(i->driver->disp)) {
LV_LOG_WARN("X is %d which is greater than hor. res", data->point.x); LV_LOG_WARN("X is %d which is greater than hor. res", (int)data->point.x);
} }
if(data->point.y < 0) { if(data->point.y < 0) {
LV_LOG_WARN("Y is %d which is smaller than zero", data->point.y); LV_LOG_WARN("Y is %d which is smaller than zero", (int)data->point.y);
} }
if(data->point.y >= lv_disp_get_ver_res(i->driver->disp)) { if(data->point.y >= lv_disp_get_ver_res(i->driver->disp)) {
LV_LOG_WARN("Y is %d which is greater than ver. res", data->point.y); LV_LOG_WARN("Y is %d which is greater than ver. res", (int)data->point.y);
} }
/*Move the cursor if set and moved*/ /*Move the cursor if set and moved*/
@@ -779,10 +779,10 @@ static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data)
static lv_indev_state_t prev_state = LV_INDEV_STATE_RELEASED; static lv_indev_state_t prev_state = LV_INDEV_STATE_RELEASED;
if(prev_state != data->state) { if(prev_state != data->state) {
if(data->state == LV_INDEV_STATE_PRESSED) { if(data->state == LV_INDEV_STATE_PRESSED) {
LV_LOG_INFO("button %" LV_PRIu32 " is pressed (x:%d y:%d)", data->btn_id, x, y); LV_LOG_INFO("button %" LV_PRIu32 " is pressed (x:%d y:%d)", data->btn_id, (int)x, (int)y);
} }
else { else {
LV_LOG_INFO("button %" LV_PRIu32 " is released (x:%d y:%d)", data->btn_id, x, y); LV_LOG_INFO("button %" LV_PRIu32 " is released (x:%d y:%d)", data->btn_id, (int)x, (int)y);
} }
} }
@@ -816,7 +816,8 @@ static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data)
*/ */
static void indev_proc_press(_lv_indev_proc_t * proc) static void indev_proc_press(_lv_indev_proc_t * proc)
{ {
LV_LOG_INFO("pressed at x:%d y:%d", proc->types.pointer.act_point.x, proc->types.pointer.act_point.y); LV_LOG_INFO("pressed at x:%d y:%d", (int)proc->types.pointer.act_point.x,
(int)proc->types.pointer.act_point.y);
indev_obj_act = proc->types.pointer.act_obj; indev_obj_act = proc->types.pointer.act_obj;
if(proc->wait_until_release != 0) return; if(proc->wait_until_release != 0) return;