diff --git a/src/core/lv_global.h b/src/core/lv_global.h index c32c96af1..cd3a1bfb5 100644 --- a/src/core/lv_global.h +++ b/src/core/lv_global.h @@ -74,7 +74,7 @@ typedef struct _lv_global_t { lv_ll_t style_trans_ll; bool style_refresh; uint32_t style_custom_table_size; - uint16_t style_last_custom_prop_id; + uint32_t style_last_custom_prop_id; uint8_t * style_custom_prop_flag_lookup_table; lv_ll_t group_ll; @@ -185,7 +185,7 @@ typedef struct _lv_global_t { #endif #if LV_USE_IME_PINYIN != 0 - uint16_t ime_cand_len; + size_t ime_cand_len; #endif } lv_global_t; diff --git a/src/core/lv_refr.c b/src/core/lv_refr.c index 244642d1f..7c1d4ac12 100644 --- a/src/core/lv_refr.c +++ b/src/core/lv_refr.c @@ -486,7 +486,7 @@ static void refr_invalid_areas(void) disp_refr->last_part = 0; disp_refr->rendering_in_progress = true; - for(i = 0; i < disp_refr->inv_p; i++) { + for(i = 0; i < (int32_t)disp_refr->inv_p; i++) { /*Refresh the unjoined areas*/ if(disp_refr->inv_area_joined[i] == 0) { diff --git a/src/display/lv_display_private.h b/src/display/lv_display_private.h index cdc4cae69..b1084b5f4 100644 --- a/src/display/lv_display_private.h +++ b/src/display/lv_display_private.h @@ -89,7 +89,7 @@ struct _lv_display_t { /** Invalidated (marked to redraw) areas*/ lv_area_t inv_areas[LV_INV_BUF_SIZE]; uint8_t inv_area_joined[LV_INV_BUF_SIZE]; - uint16_t inv_p; + uint32_t inv_p; int32_t inv_en_cnt; /*--------------------- diff --git a/src/lv_init.c b/src/lv_init.c index 588672471..33bc50be9 100644 --- a/src/lv_init.c +++ b/src/lv_init.c @@ -74,7 +74,7 @@ static inline void lv_global_init(lv_global_t * global) global->memory_zero = ZERO_MEM_SENTINEL; global->style_refresh = true; global->layout_count = _LV_LAYOUT_LAST; - global->style_last_custom_prop_id = (uint16_t)_LV_STYLE_LAST_BUILT_IN_PROP; + global->style_last_custom_prop_id = (uint32_t)_LV_STYLE_LAST_BUILT_IN_PROP; global->area_trans_cache.angle_prev = INT32_MIN; global->event_last_register_id = _LV_EVENT_LAST; global->math_rand_seed = 0x1234ABCD; diff --git a/src/others/file_explorer/lv_file_explorer.c b/src/others/file_explorer/lv_file_explorer.c index 622f25856..ffaffb41c 100644 --- a/src/others/file_explorer/lv_file_explorer.c +++ b/src/others/file_explorer/lv_file_explorer.c @@ -484,8 +484,8 @@ static void browser_file_event_handler(lv_event_t * e) if(code == LV_EVENT_VALUE_CHANGED) { char file_name[LV_FILE_EXPLORER_PATH_MAX_LEN]; const char * str_fn = NULL; - uint16_t row; - uint16_t col; + uint32_t row; + uint32_t col; lv_memzero(file_name, sizeof(file_name)); lv_table_get_selected_cell(explorer->file_table, &row, &col); diff --git a/src/widgets/animimage/lv_animimage.c b/src/widgets/animimage/lv_animimage.c index 39a0da491..3b949e084 100644 --- a/src/widgets/animimage/lv_animimage.c +++ b/src/widgets/animimage/lv_animimage.c @@ -64,13 +64,13 @@ lv_obj_t * lv_animimg_create(lv_obj_t * parent) return obj; } -void lv_animimg_set_src(lv_obj_t * obj, const void * dsc[], uint8_t num) +void lv_animimg_set_src(lv_obj_t * obj, const void * dsc[], size_t num) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_animimg_t * animimg = (lv_animimg_t *)obj; animimg->dsc = dsc; animimg->pic_count = num; - lv_anim_set_values(&animimg->anim, 0, num - 1); + lv_anim_set_values(&animimg->anim, 0, (int32_t)num - 1); } void lv_animimg_start(lv_obj_t * obj) @@ -92,7 +92,7 @@ void lv_animimg_set_duration(lv_obj_t * obj, uint32_t duration) lv_anim_set_playback_delay(&animimg->anim, duration); } -void lv_animimg_set_repeat_count(lv_obj_t * obj, uint16_t count) +void lv_animimg_set_repeat_count(lv_obj_t * obj, uint32_t count) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_animimg_t * animimg = (lv_animimg_t *)obj; @@ -124,7 +124,7 @@ uint32_t lv_animimg_get_duration(lv_obj_t * obj) return lv_anim_get_time(&animimg->anim); } -uint16_t lv_animimg_get_repeat_count(lv_obj_t * obj) +uint32_t lv_animimg_get_repeat_count(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_animimg_t * animimg = (lv_animimg_t *)obj; diff --git a/src/widgets/animimage/lv_animimage.h b/src/widgets/animimage/lv_animimage.h index cdda39092..99bf2632c 100644 --- a/src/widgets/animimage/lv_animimage.h +++ b/src/widgets/animimage/lv_animimage.h @@ -76,7 +76,7 @@ lv_obj_t * lv_animimg_create(lv_obj_t * parent); * @param dsc pointer to a series images * @param num images' number */ -void lv_animimg_set_src(lv_obj_t * img, const void * dsc[], uint8_t num); +void lv_animimg_set_src(lv_obj_t * img, const void * dsc[], size_t num); /** * Startup the image animation. @@ -96,7 +96,7 @@ void lv_animimg_set_duration(lv_obj_t * img, uint32_t duration); * @param img pointer to an animation image object * @param count the number of times to repeat the animation */ -void lv_animimg_set_repeat_count(lv_obj_t * img, uint16_t count); +void lv_animimg_set_repeat_count(lv_obj_t * img, uint32_t count); /*===================== * Getter functions @@ -128,7 +128,7 @@ uint32_t lv_animimg_get_duration(lv_obj_t * img); * @param img pointer to an animation image object * @return the repeat count */ -uint16_t lv_animimg_get_repeat_count(lv_obj_t * img); +uint32_t lv_animimg_get_repeat_count(lv_obj_t * img); #endif /*LV_USE_ANIMIMG*/ diff --git a/src/widgets/arc/lv_arc.c b/src/widgets/arc/lv_arc.c index 6156328e3..9b7d16fba 100644 --- a/src/widgets/arc/lv_arc.c +++ b/src/widgets/arc/lv_arc.c @@ -33,7 +33,7 @@ static void lv_arc_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); static void lv_arc_draw(lv_event_t * e); static void lv_arc_event(const lv_obj_class_t * class_p, lv_event_t * e); -static void inv_arc_area(lv_obj_t * arc, uint16_t start_angle, uint16_t end_angle, lv_part_t part); +static void inv_arc_area(lv_obj_t * arc, uint32_t start_angle, uint32_t end_angle, lv_part_t part); static void inv_knob_area(lv_obj_t * obj); static void get_center(const lv_obj_t * obj, lv_point_t * center, lv_coord_t * arc_r); static lv_coord_t get_angle(const lv_obj_t * obj); @@ -80,7 +80,7 @@ lv_obj_t * lv_arc_create(lv_obj_t * parent) * Setter functions *====================*/ -void lv_arc_set_start_angle(lv_obj_t * obj, uint16_t start) +void lv_arc_set_start_angle(lv_obj_t * obj, uint32_t start) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_arc_t * arc = (lv_arc_t *)obj; @@ -104,14 +104,14 @@ void lv_arc_set_start_angle(lv_obj_t * obj, uint16_t start) inv_knob_area(obj); } -void lv_arc_set_end_angle(lv_obj_t * obj, uint16_t end) +void lv_arc_set_end_angle(lv_obj_t * obj, uint32_t end) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_arc_t * arc = (lv_arc_t *)obj; if(end > 360) end -= 360; - int16_t old_delta = arc->indic_angle_end - arc->indic_angle_start; - int16_t new_delta = end - arc->indic_angle_start; + int32_t old_delta = arc->indic_angle_end - arc->indic_angle_start; + int32_t new_delta = end - arc->indic_angle_start; if(old_delta < 0) old_delta = 360 + old_delta; if(new_delta < 0) new_delta = 360 + new_delta; @@ -127,21 +127,21 @@ void lv_arc_set_end_angle(lv_obj_t * obj, uint16_t end) inv_knob_area(obj); } -void lv_arc_set_angles(lv_obj_t * obj, uint16_t start, uint16_t end) +void lv_arc_set_angles(lv_obj_t * obj, uint32_t start, uint32_t end) { lv_arc_set_end_angle(obj, end); lv_arc_set_start_angle(obj, start); } -void lv_arc_set_bg_start_angle(lv_obj_t * obj, uint16_t start) +void lv_arc_set_bg_start_angle(lv_obj_t * obj, uint32_t start) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_arc_t * arc = (lv_arc_t *)obj; if(start > 360) start -= 360; - int16_t old_delta = arc->bg_angle_end - arc->bg_angle_start; - int16_t new_delta = arc->bg_angle_end - start; + int32_t old_delta = arc->bg_angle_end - arc->bg_angle_start; + int32_t new_delta = arc->bg_angle_end - start; if(old_delta < 0) old_delta = 360 + old_delta; if(new_delta < 0) new_delta = 360 + new_delta; @@ -155,15 +155,15 @@ void lv_arc_set_bg_start_angle(lv_obj_t * obj, uint16_t start) value_update(obj); } -void lv_arc_set_bg_end_angle(lv_obj_t * obj, uint16_t end) +void lv_arc_set_bg_end_angle(lv_obj_t * obj, uint32_t end) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_arc_t * arc = (lv_arc_t *)obj; if(end > 360) end -= 360; - int16_t old_delta = arc->bg_angle_end - arc->bg_angle_start; - int16_t new_delta = end - arc->bg_angle_start; + int32_t old_delta = arc->bg_angle_end - arc->bg_angle_start; + int32_t new_delta = end - arc->bg_angle_start; if(old_delta < 0) old_delta = 360 + old_delta; if(new_delta < 0) new_delta = 360 + new_delta; @@ -177,13 +177,13 @@ void lv_arc_set_bg_end_angle(lv_obj_t * obj, uint16_t end) value_update(obj); } -void lv_arc_set_bg_angles(lv_obj_t * obj, uint16_t start, uint16_t end) +void lv_arc_set_bg_angles(lv_obj_t * obj, uint32_t start, uint32_t end) { lv_arc_set_bg_end_angle(obj, end); lv_arc_set_bg_start_angle(obj, start); } -void lv_arc_set_rotation(lv_obj_t * obj, uint16_t rotation) +void lv_arc_set_rotation(lv_obj_t * obj, uint32_t rotation) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_arc_t * arc = (lv_arc_t *)obj; @@ -198,7 +198,7 @@ void lv_arc_set_mode(lv_obj_t * obj, lv_arc_mode_t type) LV_ASSERT_OBJ(obj, MY_CLASS); lv_arc_t * arc = (lv_arc_t *)obj; - int16_t val = arc->value; + int32_t val = arc->value; arc->type = type; arc->value = -1; /** Force set_value handling*/ @@ -222,14 +222,14 @@ void lv_arc_set_mode(lv_obj_t * obj, lv_arc_mode_t type) lv_arc_set_value(obj, val); } -void lv_arc_set_value(lv_obj_t * obj, int16_t value) +void lv_arc_set_value(lv_obj_t * obj, int32_t value) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_arc_t * arc = (lv_arc_t *)obj; if(arc->value == value) return; - int16_t new_value; + int32_t new_value; new_value = value > arc->max_value ? arc->max_value : value; new_value = new_value < arc->min_value ? arc->min_value : new_value; @@ -239,7 +239,7 @@ void lv_arc_set_value(lv_obj_t * obj, int16_t value) value_update(obj); } -void lv_arc_set_range(lv_obj_t * obj, int16_t min, int16_t max) +void lv_arc_set_range(lv_obj_t * obj, int32_t min, int32_t max) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_arc_t * arc = (lv_arc_t *)obj; @@ -259,7 +259,7 @@ void lv_arc_set_range(lv_obj_t * obj, int16_t min, int16_t max) value_update(obj); /*value has changed relative to the new range*/ } -void lv_arc_set_change_rate(lv_obj_t * obj, uint16_t rate) +void lv_arc_set_change_rate(lv_obj_t * obj, uint32_t rate) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_arc_t * arc = (lv_arc_t *)obj; @@ -267,7 +267,7 @@ void lv_arc_set_change_rate(lv_obj_t * obj, uint16_t rate) arc->chg_rate = rate; } -void lv_arc_set_knob_offset(lv_obj_t * obj, int16_t offset) +void lv_arc_set_knob_offset(lv_obj_t * obj, int32_t offset) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_arc_t * arc = (lv_arc_t *)obj; @@ -279,43 +279,43 @@ void lv_arc_set_knob_offset(lv_obj_t * obj, int16_t offset) * Getter functions *====================*/ -uint16_t lv_arc_get_angle_start(lv_obj_t * obj) +uint32_t lv_arc_get_angle_start(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); return ((lv_arc_t *) obj)->indic_angle_start; } -uint16_t lv_arc_get_angle_end(lv_obj_t * obj) +uint32_t lv_arc_get_angle_end(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); return ((lv_arc_t *) obj)->indic_angle_end; } -uint16_t lv_arc_get_bg_angle_start(lv_obj_t * obj) +uint32_t lv_arc_get_bg_angle_start(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); return ((lv_arc_t *) obj)->bg_angle_start; } -uint16_t lv_arc_get_bg_angle_end(lv_obj_t * obj) +uint32_t lv_arc_get_bg_angle_end(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); return ((lv_arc_t *) obj)->bg_angle_end; } -int16_t lv_arc_get_value(const lv_obj_t * obj) +int32_t lv_arc_get_value(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); return ((lv_arc_t *) obj)->value; } -int16_t lv_arc_get_min_value(const lv_obj_t * obj) +int32_t lv_arc_get_min_value(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); return ((lv_arc_t *) obj)->min_value; } -int16_t lv_arc_get_max_value(const lv_obj_t * obj) +int32_t lv_arc_get_max_value(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); return ((lv_arc_t *) obj)->max_value; @@ -327,13 +327,13 @@ lv_arc_mode_t lv_arc_get_mode(const lv_obj_t * obj) return ((lv_arc_t *) obj)->type; } -int16_t lv_arc_get_rotation(const lv_obj_t * obj) +int32_t lv_arc_get_rotation(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); return ((lv_arc_t *)obj)->rotation; } -int16_t lv_arc_get_knob_offset(const lv_obj_t * obj) +int32_t lv_arc_get_knob_offset(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); return ((lv_arc_t *)obj)->knob_offset; @@ -359,7 +359,7 @@ void lv_arc_align_obj_to_angle(const lv_obj_t * obj, lv_obj_t * obj_to_align, lv arc_r -= indic_width_half; arc_r += r_offset; - uint16_t angle = get_angle(obj); + uint32_t angle = get_angle(obj); lv_coord_t knob_x = (arc_r * lv_trigo_sin(angle + 90)) >> LV_TRIGO_SHIFT; lv_coord_t knob_y = (arc_r * lv_trigo_sin(angle)) >> LV_TRIGO_SHIFT; lv_obj_align_to(obj_to_align, obj, LV_ALIGN_CENTER, knob_x, knob_y); @@ -384,7 +384,7 @@ void lv_arc_rotate_obj_to_angle(const lv_obj_t * obj, lv_obj_t * obj_to_rotate, lv_obj_update_layout(obj); - uint16_t angle = get_angle(obj); + uint32_t angle = get_angle(obj); lv_coord_t pivot_x = obj_to_rotate->coords.x1 - center.x; lv_coord_t pivot_y = obj_to_rotate->coords.y1 - center.y; lv_obj_set_style_transform_pivot_x(obj_to_rotate, -pivot_x, 0); @@ -688,7 +688,7 @@ static void lv_arc_draw(lv_event_t * e) lv_draw_rect(layer, &knob_rect_dsc, &knob_area); } -static void inv_arc_area(lv_obj_t * obj, uint16_t start_angle, uint16_t end_angle, lv_part_t part) +static void inv_arc_area(lv_obj_t * obj, uint32_t start_angle, uint32_t end_angle, lv_part_t part) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -758,7 +758,7 @@ static void get_center(const lv_obj_t * obj, lv_point_t * center, lv_coord_t * a static lv_coord_t get_angle(const lv_obj_t * obj) { lv_arc_t * arc = (lv_arc_t *)obj; - uint16_t angle = arc->rotation; + uint32_t angle = arc->rotation; if(arc->type == LV_ARC_MODE_NORMAL) { angle += arc->indic_angle_end; } @@ -772,7 +772,7 @@ static lv_coord_t get_angle(const lv_obj_t * obj) if(arc->indic_angle_end < arc->indic_angle_start) indic_end = arc->indic_angle_end + 360; int32_t angle_midpoint = (int32_t)(arc->bg_angle_start + bg_end) / 2; - if(arc->indic_angle_start < angle_midpoint) angle += arc->indic_angle_start; + if((int32_t)arc->indic_angle_start < angle_midpoint) angle += arc->indic_angle_start; else if(indic_end > angle_midpoint) angle += arc->indic_angle_end; else angle += angle_midpoint; } diff --git a/src/widgets/arc/lv_arc.h b/src/widgets/arc/lv_arc.h index f57388d3a..fcf21c463 100644 --- a/src/widgets/arc/lv_arc.h +++ b/src/widgets/arc/lv_arc.h @@ -41,18 +41,18 @@ typedef uint8_t lv_arc_mode_t; typedef struct { lv_obj_t obj; - uint16_t rotation; - uint16_t indic_angle_start; - uint16_t indic_angle_end; - uint16_t bg_angle_start; - uint16_t bg_angle_end; + uint32_t rotation; + uint32_t indic_angle_start; + uint32_t indic_angle_end; + uint32_t bg_angle_start; + uint32_t bg_angle_end; int16_t value; /*Current value of the arc*/ int16_t min_value; /*Minimum value of the arc*/ int16_t max_value; /*Maximum value of the arc*/ - uint16_t dragging : 1; - uint16_t type : 2; - uint16_t min_close : 1; /*1: the last pressed angle was closer to minimum end*/ - uint16_t chg_rate; /*Drag angle rate of change of the arc (degrees/sec)*/ + uint32_t dragging : 1; + uint32_t type : 2; + uint32_t min_close : 1; /*1: the last pressed angle was closer to minimum end*/ + uint32_t chg_rate; /*Drag angle rate of change of the arc (degrees/sec)*/ uint32_t last_tick; /*Last dragging event timestamp of the arc*/ int16_t last_angle; /*Last dragging angle of the arc*/ int16_t knob_offset; /*knob offset from the main arc*/ @@ -84,14 +84,14 @@ lv_obj_t * lv_arc_create(lv_obj_t * parent); * @param obj pointer to an arc object * @param start the start angle */ -void lv_arc_set_start_angle(lv_obj_t * obj, uint16_t start); +void lv_arc_set_start_angle(lv_obj_t * obj, uint32_t start); /** * Set the end angle of an arc. 0 deg: right, 90 bottom, etc. * @param obj pointer to an arc object * @param end the end angle */ -void lv_arc_set_end_angle(lv_obj_t * obj, uint16_t end); +void lv_arc_set_end_angle(lv_obj_t * obj, uint32_t end); /** * Set the start and end angles @@ -99,21 +99,21 @@ void lv_arc_set_end_angle(lv_obj_t * obj, uint16_t end); * @param start the start angle * @param end the end angle */ -void lv_arc_set_angles(lv_obj_t * obj, uint16_t start, uint16_t end); +void lv_arc_set_angles(lv_obj_t * obj, uint32_t start, uint32_t end); /** * Set the start angle of an arc background. 0 deg: right, 90 bottom, etc. * @param obj pointer to an arc object * @param start the start angle */ -void lv_arc_set_bg_start_angle(lv_obj_t * obj, uint16_t start); +void lv_arc_set_bg_start_angle(lv_obj_t * obj, uint32_t start); /** * Set the start angle of an arc background. 0 deg: right, 90 bottom etc. * @param obj pointer to an arc object * @param end the end angle */ -void lv_arc_set_bg_end_angle(lv_obj_t * obj, uint16_t end); +void lv_arc_set_bg_end_angle(lv_obj_t * obj, uint32_t end); /** * Set the start and end angles of the arc background @@ -121,14 +121,14 @@ void lv_arc_set_bg_end_angle(lv_obj_t * obj, uint16_t end); * @param start the start angle * @param end the end angle */ -void lv_arc_set_bg_angles(lv_obj_t * obj, uint16_t start, uint16_t end); +void lv_arc_set_bg_angles(lv_obj_t * obj, uint32_t start, uint32_t end); /** * Set the rotation for the whole arc * @param obj pointer to an arc object * @param rotation rotation angle */ -void lv_arc_set_rotation(lv_obj_t * obj, uint16_t rotation); +void lv_arc_set_rotation(lv_obj_t * obj, uint32_t rotation); /** * Set the type of arc. @@ -142,7 +142,7 @@ void lv_arc_set_mode(lv_obj_t * obj, lv_arc_mode_t type); * @param obj pointer to an arc object * @param value new value */ -void lv_arc_set_value(lv_obj_t * obj, int16_t value); +void lv_arc_set_value(lv_obj_t * obj, int32_t value); /** * Set minimum and the maximum values of an arc @@ -150,21 +150,21 @@ void lv_arc_set_value(lv_obj_t * obj, int16_t value); * @param min minimum value * @param max maximum value */ -void lv_arc_set_range(lv_obj_t * obj, int16_t min, int16_t max); +void lv_arc_set_range(lv_obj_t * obj, int32_t min, int32_t max); /** * Set a change rate to limit the speed how fast the arc should reach the pressed point. * @param obj pointer to an arc object * @param rate the change rate */ -void lv_arc_set_change_rate(lv_obj_t * obj, uint16_t rate); +void lv_arc_set_change_rate(lv_obj_t * obj, uint32_t rate); /** * Set an offset for the knob from the main arc object * @param arc pointer to an arc object * @param offset knob offset from main arc */ -void lv_arc_set_knob_offset(lv_obj_t * arc, int16_t offset); +void lv_arc_set_knob_offset(lv_obj_t * arc, int32_t offset); /*===================== * Getter functions @@ -175,49 +175,49 @@ void lv_arc_set_knob_offset(lv_obj_t * arc, int16_t offset); * @param obj pointer to an arc object * @return the start angle [0..360] */ -uint16_t lv_arc_get_angle_start(lv_obj_t * obj); +uint32_t lv_arc_get_angle_start(lv_obj_t * obj); /** * Get the end angle of an arc. * @param obj pointer to an arc object * @return the end angle [0..360] */ -uint16_t lv_arc_get_angle_end(lv_obj_t * obj); +uint32_t lv_arc_get_angle_end(lv_obj_t * obj); /** * Get the start angle of an arc background. * @param obj pointer to an arc object * @return the start angle [0..360] */ -uint16_t lv_arc_get_bg_angle_start(lv_obj_t * obj); +uint32_t lv_arc_get_bg_angle_start(lv_obj_t * obj); /** * Get the end angle of an arc background. * @param obj pointer to an arc object * @return the end angle [0..360] */ -uint16_t lv_arc_get_bg_angle_end(lv_obj_t * obj); +uint32_t lv_arc_get_bg_angle_end(lv_obj_t * obj); /** * Get the value of an arc * @param obj pointer to an arc object * @return the value of the arc */ -int16_t lv_arc_get_value(const lv_obj_t * obj); +int32_t lv_arc_get_value(const lv_obj_t * obj); /** * Get the minimum value of an arc * @param obj pointer to an arc object * @return the minimum value of the arc */ -int16_t lv_arc_get_min_value(const lv_obj_t * obj); +int32_t lv_arc_get_min_value(const lv_obj_t * obj); /** * Get the maximum value of an arc * @param obj pointer to an arc object * @return the maximum value of the arc */ -int16_t lv_arc_get_max_value(const lv_obj_t * obj); +int32_t lv_arc_get_max_value(const lv_obj_t * obj); /** * Get whether the arc is type or not. @@ -231,14 +231,14 @@ lv_arc_mode_t lv_arc_get_mode(const lv_obj_t * obj); * @param obj pointer to an arc object * @return arc's current rotation */ -int16_t lv_arc_get_rotation(const lv_obj_t * obj); +int32_t lv_arc_get_rotation(const lv_obj_t * obj); /** * Get the current knob offset * @param obj pointer to an arc object * @return arc's current knob offset */ -int16_t lv_arc_get_knob_offset(const lv_obj_t * obj); +int32_t lv_arc_get_knob_offset(const lv_obj_t * obj); /*===================== * Other functions diff --git a/src/widgets/buttonmatrix/lv_buttonmatrix.c b/src/widgets/buttonmatrix/lv_buttonmatrix.c index 49ba98923..28fd1b219 100644 --- a/src/widgets/buttonmatrix/lv_buttonmatrix.c +++ b/src/widgets/buttonmatrix/lv_buttonmatrix.c @@ -38,7 +38,7 @@ static void lv_buttonmatrix_destructor(const lv_obj_class_t * class_p, lv_obj_t static void lv_buttonmatrix_event(const lv_obj_class_t * class_p, lv_event_t * e); static void draw_main(lv_event_t * e); -static uint8_t get_button_width(lv_buttonmatrix_ctrl_t ctrl_bits); +static uint32_t get_button_width(lv_buttonmatrix_ctrl_t ctrl_bits); static bool button_is_hidden(lv_buttonmatrix_ctrl_t ctrl_bits); static bool button_is_checked(lv_buttonmatrix_ctrl_t ctrl_bits); static bool button_is_repeat_disabled(lv_buttonmatrix_ctrl_t ctrl_bits); @@ -48,10 +48,10 @@ static bool button_is_popover(lv_buttonmatrix_ctrl_t ctrl_bits); static bool button_is_checkable(lv_buttonmatrix_ctrl_t ctrl_bits); static bool button_is_recolor(lv_buttonmatrix_ctrl_t ctrl_bits); static bool button_get_checked(lv_buttonmatrix_ctrl_t ctrl_bits); -static uint16_t get_button_from_point(lv_obj_t * obj, lv_point_t * p); +static uint32_t get_button_from_point(lv_obj_t * obj, lv_point_t * p); static void allocate_button_areas_and_controls(const lv_obj_t * obj, const char ** map); -static void invalidate_button_area(const lv_obj_t * obj, uint16_t btn_idx); -static void make_one_button_checked(lv_obj_t * obj, uint16_t btn_idx); +static void invalidate_button_area(const lv_obj_t * obj, uint32_t btn_idx); +static void make_one_button_checked(lv_obj_t * obj, uint32_t btn_idx); static bool has_popovers_in_top_row(lv_obj_t * obj); /********************** @@ -127,8 +127,8 @@ void lv_buttonmatrix_set_map(lv_obj_t * obj, const char * map[]) /*Count the units and the buttons in a line*/ uint32_t row; for(row = 0; row < btnm->row_cnt; row++) { - uint16_t unit_cnt = 0; /*Number of units in a row*/ - uint16_t btn_cnt = 0; /*Number of buttons in a row*/ + uint32_t unit_cnt = 0; /*Number of units in a row*/ + uint32_t btn_cnt = 0; /*Number of buttons in a row*/ /*Count the buttons and units in this row*/ while(map_row[btn_cnt] && strcmp(map_row[btn_cnt], "\n") != 0 && map_row[btn_cnt][0] != '\0') { unit_cnt += get_button_width(btnm->ctrl_bits[btn_tot_i + btn_cnt]); @@ -194,7 +194,7 @@ void lv_buttonmatrix_set_ctrl_map(lv_obj_t * obj, const lv_buttonmatrix_ctrl_t c lv_buttonmatrix_set_map(obj, btnm->map_p); } -void lv_buttonmatrix_set_selected_button(lv_obj_t * obj, uint16_t btn_id) +void lv_buttonmatrix_set_selected_button(lv_obj_t * obj, uint32_t btn_id) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -207,7 +207,7 @@ void lv_buttonmatrix_set_selected_button(lv_obj_t * obj, uint16_t btn_id) invalidate_button_area(obj, btn_id); } -void lv_buttonmatrix_set_button_ctrl(lv_obj_t * obj, uint16_t btn_id, lv_buttonmatrix_ctrl_t ctrl) +void lv_buttonmatrix_set_button_ctrl(lv_obj_t * obj, uint32_t btn_id, lv_buttonmatrix_ctrl_t ctrl) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -227,7 +227,7 @@ void lv_buttonmatrix_set_button_ctrl(lv_obj_t * obj, uint16_t btn_id, lv_buttonm } } -void lv_buttonmatrix_clear_button_ctrl(lv_obj_t * obj, uint16_t btn_id, lv_buttonmatrix_ctrl_t ctrl) +void lv_buttonmatrix_clear_button_ctrl(lv_obj_t * obj, uint32_t btn_id, lv_buttonmatrix_ctrl_t ctrl) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -248,7 +248,7 @@ void lv_buttonmatrix_set_button_ctrl_all(lv_obj_t * obj, lv_buttonmatrix_ctrl_t LV_ASSERT_OBJ(obj, MY_CLASS); lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj;; - uint16_t i; + uint32_t i; for(i = 0; i < btnm->btn_cnt; i++) { lv_buttonmatrix_set_button_ctrl(obj, i, ctrl); } @@ -259,13 +259,13 @@ void lv_buttonmatrix_clear_button_ctrl_all(lv_obj_t * obj, lv_buttonmatrix_ctrl_ LV_ASSERT_OBJ(obj, MY_CLASS); lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj;; - uint16_t i; + uint32_t i; for(i = 0; i < btnm->btn_cnt; i++) { lv_buttonmatrix_clear_button_ctrl(obj, i, ctrl); } } -void lv_buttonmatrix_set_button_width(lv_obj_t * obj, uint16_t btn_id, uint8_t width) +void lv_buttonmatrix_set_button_width(lv_obj_t * obj, uint32_t btn_id, uint32_t width) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -300,7 +300,7 @@ const char ** lv_buttonmatrix_get_map(const lv_obj_t * obj) return btnm->map_p; } -uint16_t lv_buttonmatrix_get_selected_button(const lv_obj_t * obj) +uint32_t lv_buttonmatrix_get_selected_button(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -308,7 +308,7 @@ uint16_t lv_buttonmatrix_get_selected_button(const lv_obj_t * obj) return btnm->btn_id_sel; } -const char * lv_buttonmatrix_get_button_text(const lv_obj_t * obj, uint16_t btn_id) +const char * lv_buttonmatrix_get_button_text(const lv_obj_t * obj, uint32_t btn_id) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -317,8 +317,8 @@ const char * lv_buttonmatrix_get_button_text(const lv_obj_t * obj, uint16_t btn_ lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; if(btn_id > btnm->btn_cnt) return NULL; - uint16_t txt_i = 0; - uint16_t btn_i = 0; + uint32_t txt_i = 0; + uint32_t btn_i = 0; /*Search the text of btnm->btn_pr the buttons text in the map *Skip "\n"-s*/ @@ -333,7 +333,7 @@ const char * lv_buttonmatrix_get_button_text(const lv_obj_t * obj, uint16_t btn_ return btnm->map_p[txt_i]; } -bool lv_buttonmatrix_has_button_ctrl(lv_obj_t * obj, uint16_t btn_id, lv_buttonmatrix_ctrl_t ctrl) +bool lv_buttonmatrix_has_button_ctrl(lv_obj_t * obj, uint32_t btn_id, lv_buttonmatrix_ctrl_t ctrl) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -422,7 +422,7 @@ static void lv_buttonmatrix_event(const lv_obj_class_t * class_p, lv_event_t * e lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act()); if(indev_type == LV_INDEV_TYPE_POINTER || indev_type == LV_INDEV_TYPE_BUTTON) { - uint16_t btn_pr; + uint32_t btn_pr; /*Search the pressed area*/ lv_indev_get_point(indev, &p); btn_pr = get_button_from_point(obj, &p); @@ -456,7 +456,7 @@ static void lv_buttonmatrix_event(const lv_obj_class_t * class_p, lv_event_t * e if(btnm->btn_id_sel != LV_BUTTONMATRIX_BUTTON_NONE) { lv_indev_t * indev = lv_event_get_indev(e); lv_indev_get_point(indev, &p); - uint16_t btn_pr = get_button_from_point(obj, &p); + uint32_t btn_pr = get_button_from_point(obj, &p); if(btn_pr != btnm->btn_id_sel) { invalidate_button_area(obj, btnm->btn_id_sel); /*Invalidate the old area*/ btnm->btn_id_sel = LV_BUTTONMATRIX_BUTTON_NONE; @@ -562,7 +562,7 @@ static void lv_buttonmatrix_event(const lv_obj_class_t * class_p, lv_event_t * e else btnm->btn_id_sel++; if(btnm->btn_id_sel >= btnm->btn_cnt) btnm->btn_id_sel = 0; - uint16_t btn_id_start = btnm->btn_id_sel; + uint32_t btn_id_start = btnm->btn_id_sel; while(button_is_hidden(btnm->ctrl_bits[btnm->btn_id_sel]) || button_is_inactive(btnm->ctrl_bits[btnm->btn_id_sel])) { btnm->btn_id_sel++; if(btnm->btn_id_sel >= btnm->btn_cnt) btnm->btn_id_sel = 0; @@ -579,7 +579,7 @@ static void lv_buttonmatrix_event(const lv_obj_class_t * class_p, lv_event_t * e if(btnm->btn_id_sel == 0) btnm->btn_id_sel = btnm->btn_cnt - 1; else if(btnm->btn_id_sel > 0) btnm->btn_id_sel--; - uint16_t btn_id_start = btnm->btn_id_sel; + uint32_t btn_id_start = btnm->btn_id_sel; while(button_is_hidden(btnm->ctrl_bits[btnm->btn_id_sel]) || button_is_inactive(btnm->ctrl_bits[btnm->btn_id_sel])) { if(btnm->btn_id_sel > 0) btnm->btn_id_sel--; else btnm->btn_id_sel = btnm->btn_cnt - 1; @@ -604,7 +604,7 @@ static void lv_buttonmatrix_event(const lv_obj_class_t * class_p, lv_event_t * e } } else { - uint16_t area_below; + uint32_t area_below; lv_coord_t pr_center = btnm->button_areas[btnm->btn_id_sel].x1 + (lv_area_get_width(&btnm->button_areas[btnm->btn_id_sel]) >> 1); @@ -674,8 +674,8 @@ static void draw_main(lv_event_t * e) lv_area_t btn_area; - uint16_t btn_i = 0; - uint16_t txt_i = 0; + uint32_t btn_i = 0; + uint32_t txt_i = 0; lv_draw_rect_dsc_t draw_rect_dsc_act; lv_draw_label_dsc_t draw_label_dsc_act; @@ -820,8 +820,8 @@ static void allocate_button_areas_and_controls(const lv_obj_t * obj, const char lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj; btnm->row_cnt = 1; /*Count the buttons in the map*/ - uint16_t btn_cnt = 0; - uint16_t i = 0; + uint32_t btn_cnt = 0; + uint32_t i = 0; while(map[i] && map[i][0] != '\0') { if(strcmp(map[i], "\n") != 0) { /*Do not count line breaks*/ btn_cnt++; @@ -860,9 +860,9 @@ static void allocate_button_areas_and_controls(const lv_obj_t * obj, const char * @param ctrl_bits least significant 3 bits used (1..7 valid values) * @return the width of the button in units */ -static uint8_t get_button_width(lv_buttonmatrix_ctrl_t ctrl_bits) +static uint32_t get_button_width(lv_buttonmatrix_ctrl_t ctrl_bits) { - uint8_t w = ctrl_bits & LV_BUTTONMATRIX_WIDTH_MASK; + uint32_t w = ctrl_bits & LV_BUTTONMATRIX_WIDTH_MASK; return w != 0 ? w : 1; } @@ -916,12 +916,12 @@ static bool button_is_recolor(lv_buttonmatrix_ctrl_t ctrl_bits) * @param p a point with absolute coordinates * @return the id of the button or LV_BUTTONMATRIX_BUTTON_NONE. */ -static uint16_t get_button_from_point(lv_obj_t * obj, lv_point_t * p) +static uint32_t get_button_from_point(lv_obj_t * obj, lv_point_t * p) { lv_area_t obj_cords; lv_area_t btn_area; lv_buttonmatrix_t * btnm = (lv_buttonmatrix_t *)obj;; - uint16_t i; + uint32_t i; lv_obj_get_coords(obj, &obj_cords); lv_coord_t w = lv_obj_get_width(obj); @@ -969,7 +969,7 @@ static uint16_t get_button_from_point(lv_obj_t * obj, lv_point_t * p) return i; } -static void invalidate_button_area(const lv_obj_t * obj, uint16_t btn_idx) +static void invalidate_button_area(const lv_obj_t * obj, uint32_t btn_idx) { if(btn_idx == LV_BUTTONMATRIX_BUTTON_NONE) return; @@ -1012,7 +1012,7 @@ static void invalidate_button_area(const lv_obj_t * obj, uint16_t btn_idx) * @param obj Button matrix object * @param btn_idx Button that should remain toggled */ -static void make_one_button_checked(lv_obj_t * obj, uint16_t btn_idx) +static void make_one_button_checked(lv_obj_t * obj, uint32_t btn_idx) { /*Save whether the button was toggled*/ bool was_toggled = lv_buttonmatrix_has_button_ctrl(obj, btn_idx, LV_BUTTONMATRIX_CTRL_CHECKED); @@ -1036,7 +1036,7 @@ static bool has_popovers_in_top_row(lv_obj_t * obj) } const char ** map_row = btnm->map_p; - uint16_t btn_cnt = 0; + uint32_t btn_cnt = 0; while(map_row[btn_cnt] && strcmp(map_row[btn_cnt], "\n") != 0 && map_row[btn_cnt][0] != '\0') { if(button_is_popover(btnm->ctrl_bits[btn_cnt])) { diff --git a/src/widgets/buttonmatrix/lv_buttonmatrix.h b/src/widgets/buttonmatrix/lv_buttonmatrix.h index 3a907e5e0..552fd80eb 100644 --- a/src/widgets/buttonmatrix/lv_buttonmatrix.h +++ b/src/widgets/buttonmatrix/lv_buttonmatrix.h @@ -50,7 +50,7 @@ enum _lv_buttonmatrix_ctrl_t { #ifdef DOXYGEN typedef _lv_buttonmatrix_ctrl_t lv_buttonmatrix_ctrl_t; #else -typedef uint16_t lv_buttonmatrix_ctrl_t; +typedef uint32_t lv_buttonmatrix_ctrl_t; #endif /*DOXYGEN*/ @@ -63,10 +63,10 @@ typedef struct { const char ** map_p; /*Pointer to the current map*/ lv_area_t * button_areas; /*Array of areas of buttons*/ lv_buttonmatrix_ctrl_t * ctrl_bits; /*Array of control bytes*/ - uint16_t btn_cnt; /*Number of button in 'map_p'(Handled by the library)*/ - uint16_t row_cnt; /*Number of rows in 'map_p'(Handled by the library)*/ - uint16_t btn_id_sel; /*Index of the active button (being pressed/released etc) or LV_BUTTONMATRIX_BUTTON_NONE*/ - uint8_t one_check : 1; /*Single button toggled at once*/ + uint32_t btn_cnt; /*Number of button in 'map_p'(Handled by the library)*/ + uint32_t row_cnt; /*Number of rows in 'map_p'(Handled by the library)*/ + uint32_t btn_id_sel; /*Index of the active button (being pressed/released etc) or LV_BUTTONMATRIX_BUTTON_NONE*/ + uint32_t one_check : 1; /*Single button toggled at once*/ } lv_buttonmatrix_t; extern const lv_obj_class_t lv_buttonmatrix_class; @@ -115,7 +115,7 @@ void lv_buttonmatrix_set_ctrl_map(lv_obj_t * obj, const lv_buttonmatrix_ctrl_t c * @param obj pointer to button matrix object * @param btn_id 0 based index of the button to modify. (Not counting new lines) */ -void lv_buttonmatrix_set_selected_button(lv_obj_t * obj, uint16_t btn_id); +void lv_buttonmatrix_set_selected_button(lv_obj_t * obj, uint32_t btn_id); /** * Set the attributes of a button of the button matrix @@ -123,7 +123,7 @@ void lv_buttonmatrix_set_selected_button(lv_obj_t * obj, uint16_t btn_id); * @param btn_id 0 based index of the button to modify. (Not counting new lines) * @param ctrl OR-ed attributes. E.g. `LV_BUTTONMATRIX_CTRL_NO_REPEAT | LV_BUTTONMATRIX_CTRL_CHECKABLE` */ -void lv_buttonmatrix_set_button_ctrl(lv_obj_t * obj, uint16_t btn_id, lv_buttonmatrix_ctrl_t ctrl); +void lv_buttonmatrix_set_button_ctrl(lv_obj_t * obj, uint32_t btn_id, lv_buttonmatrix_ctrl_t ctrl); /** * Clear the attributes of a button of the button matrix @@ -131,7 +131,7 @@ void lv_buttonmatrix_set_button_ctrl(lv_obj_t * obj, uint16_t btn_id, lv_buttonm * @param btn_id 0 based index of the button to modify. (Not counting new lines) * @param ctrl OR-ed attributes. E.g. `LV_BUTTONMATRIX_CTRL_NO_REPEAT | LV_BUTTONMATRIX_CTRL_CHECKABLE` */ -void lv_buttonmatrix_clear_button_ctrl(lv_obj_t * obj, uint16_t btn_id, lv_buttonmatrix_ctrl_t ctrl); +void lv_buttonmatrix_clear_button_ctrl(lv_obj_t * obj, uint32_t btn_id, lv_buttonmatrix_ctrl_t ctrl); /** * Set attributes of all buttons of a button matrix @@ -155,9 +155,9 @@ void lv_buttonmatrix_clear_button_ctrl_all(lv_obj_t * obj, lv_buttonmatrix_ctrl_ * `lv_buttonmatrix_set_ctrl_map` and this method only be used for dynamic changes. * @param obj pointer to button matrix object * @param btn_id 0 based index of the button to modify. - * @param width relative width compared to the buttons in the same row. [1..7] + * @param width relative width compared to the buttons in the same row. [1..15] */ -void lv_buttonmatrix_set_button_width(lv_obj_t * obj, uint16_t btn_id, uint8_t width); +void lv_buttonmatrix_set_button_width(lv_obj_t * obj, uint32_t btn_id, uint32_t width); /** * Make the button matrix like a selector widget (only one button may be checked at a time). @@ -185,7 +185,7 @@ const char ** lv_buttonmatrix_get_map(const lv_obj_t * obj); * @param obj pointer to button matrix object * @return index of the last released button (LV_BUTTONMATRIX_BUTTON_NONE: if unset) */ -uint16_t lv_buttonmatrix_get_selected_button(const lv_obj_t * obj); +uint32_t lv_buttonmatrix_get_selected_button(const lv_obj_t * obj); /** * Get the button's text @@ -193,7 +193,7 @@ uint16_t lv_buttonmatrix_get_selected_button(const lv_obj_t * obj); * @param btn_id the index a button not counting new line characters. * @return text of btn_index` button */ -const char * lv_buttonmatrix_get_button_text(const lv_obj_t * obj, uint16_t btn_id); +const char * lv_buttonmatrix_get_button_text(const lv_obj_t * obj, uint32_t btn_id); /** * Get the whether a control value is enabled or disabled for button of a button matrix @@ -202,7 +202,7 @@ const char * lv_buttonmatrix_get_button_text(const lv_obj_t * obj, uint16_t btn_ * @param ctrl control values to check (ORed value can be used) * @return true: the control attribute is enabled false: disabled */ -bool lv_buttonmatrix_has_button_ctrl(lv_obj_t * obj, uint16_t btn_id, lv_buttonmatrix_ctrl_t ctrl); +bool lv_buttonmatrix_has_button_ctrl(lv_obj_t * obj, uint32_t btn_id, lv_buttonmatrix_ctrl_t ctrl); /** * Tell whether "one check" mode is enabled or not. diff --git a/src/widgets/calendar/lv_calendar.c b/src/widgets/calendar/lv_calendar.c index 9f81b56bc..1637020ec 100644 --- a/src/widgets/calendar/lv_calendar.c +++ b/src/widgets/calendar/lv_calendar.c @@ -93,7 +93,7 @@ void lv_calendar_set_today_date(lv_obj_t * obj, uint32_t year, uint32_t month, u highlight_update(obj); } -void lv_calendar_set_highlighted_dates(lv_obj_t * obj, lv_calendar_date_t highlighted[], uint16_t date_num) +void lv_calendar_set_highlighted_dates(lv_obj_t * obj, lv_calendar_date_t highlighted[], size_t date_num) { LV_ASSERT_NULL(highlighted); @@ -200,7 +200,7 @@ lv_calendar_date_t * lv_calendar_get_highlighted_dates(const lv_obj_t * obj) return calendar->highlighted_dates; } -uint16_t lv_calendar_get_highlighted_dates_num(const lv_obj_t * obj) +size_t lv_calendar_get_highlighted_dates_num(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_calendar_t * calendar = (lv_calendar_t *)obj; @@ -213,7 +213,7 @@ lv_result_t lv_calendar_get_pressed_date(const lv_obj_t * obj, lv_calendar_date_ LV_ASSERT_OBJ(obj, MY_CLASS); lv_calendar_t * calendar = (lv_calendar_t *)obj; - uint16_t d = lv_buttonmatrix_get_selected_button(calendar->btnm); + uint32_t d = lv_buttonmatrix_get_selected_button(calendar->btnm); if(d == LV_BUTTONMATRIX_BUTTON_NONE) { date->year = 0; date->month = 0; @@ -386,7 +386,7 @@ static uint8_t get_day_of_week(uint32_t year, uint32_t month, uint32_t day) static void highlight_update(lv_obj_t * obj) { lv_calendar_t * calendar = (lv_calendar_t *)obj; - uint16_t i; + uint32_t i; /*Clear all kind of selection*/ lv_buttonmatrix_clear_button_ctrl_all(calendar->btnm, LV_CALENDAR_CTRL_TODAY | LV_CALENDAR_CTRL_HIGHLIGHT); diff --git a/src/widgets/calendar/lv_calendar.h b/src/widgets/calendar/lv_calendar.h index 1a87484bc..67827cc09 100644 --- a/src/widgets/calendar/lv_calendar.h +++ b/src/widgets/calendar/lv_calendar.h @@ -37,13 +37,12 @@ typedef struct { /*Data of calendar*/ typedef struct { lv_obj_t obj; - lv_obj_t * btnm; /*New data for this type*/ - lv_calendar_date_t today; /*Date of today*/ - lv_calendar_date_t showed_date; /*Currently visible month (day is ignored)*/ - lv_calendar_date_t * - highlighted_dates; /*Apply different style on these days (pointer to an array defined by the user)*/ - uint16_t highlighted_dates_num; /*Number of elements in `highlighted_days`*/ + lv_obj_t * btnm; + lv_calendar_date_t today; /**< Date of today*/ + lv_calendar_date_t showed_date; /**< Currently visible month (day is ignored)*/ + lv_calendar_date_t * highlighted_dates; /**< Apply different style on these days (pointer to user-defined array)*/ + size_t highlighted_dates_num; /**< Number of elements in `highlighted_days`*/ const char * map[8 * 7]; char nums [7 * 6][4]; } lv_calendar_t; @@ -88,7 +87,7 @@ void lv_calendar_set_showed_date(lv_obj_t * obj, uint32_t year, uint32_t month); * Only the pointer will be saved so this variable can't be local which will be destroyed later. * @param date_num number of dates in the array */ -void lv_calendar_set_highlighted_dates(lv_obj_t * obj, lv_calendar_date_t highlighted[], uint16_t date_num); +void lv_calendar_set_highlighted_dates(lv_obj_t * obj, lv_calendar_date_t highlighted[], size_t date_num); /** * Set the name of the days @@ -137,7 +136,7 @@ lv_calendar_date_t * lv_calendar_get_highlighted_dates(const lv_obj_t * calendar * @param calendar pointer to a calendar object * @return number of highlighted days */ -uint16_t lv_calendar_get_highlighted_dates_num(const lv_obj_t * calendar); +size_t lv_calendar_get_highlighted_dates_num(const lv_obj_t * calendar); /** * Get the currently pressed day diff --git a/src/widgets/calendar/lv_calendar_header_dropdown.c b/src/widgets/calendar/lv_calendar_header_dropdown.c index 0337c980c..b6d84dc7e 100644 --- a/src/widgets/calendar/lv_calendar_header_dropdown.c +++ b/src/widgets/calendar/lv_calendar_header_dropdown.c @@ -100,7 +100,7 @@ static void month_event_cb(lv_event_t * e) lv_obj_t * dropdown = lv_event_get_target(e); lv_obj_t * calendar = lv_event_get_user_data(e); - uint16_t sel = lv_dropdown_get_selected(dropdown); + uint32_t sel = lv_dropdown_get_selected(dropdown); const lv_calendar_date_t * d; d = lv_calendar_get_showed_date(calendar); @@ -115,7 +115,7 @@ static void year_event_cb(lv_event_t * e) lv_obj_t * dropdown = lv_event_get_target(e); lv_obj_t * calendar = lv_event_get_user_data(e); - uint16_t sel = lv_dropdown_get_selected(dropdown); + uint32_t sel = lv_dropdown_get_selected(dropdown); const lv_calendar_date_t * d; d = lv_calendar_get_showed_date(calendar); diff --git a/src/widgets/chart/lv_chart.c b/src/widgets/chart/lv_chart.c index 0bb85aabc..d7a385d3b 100644 --- a/src/widgets/chart/lv_chart.c +++ b/src/widgets/chart/lv_chart.c @@ -39,7 +39,7 @@ static void draw_series_scatter(lv_obj_t * obj, lv_layer_t * layer); static void draw_cursors(lv_obj_t * obj, lv_layer_t * layer); static void draw_axes(lv_obj_t * obj, lv_layer_t * layer); static uint32_t get_index_from_x(lv_obj_t * obj, lv_coord_t x); -static void invalidate_point(lv_obj_t * obj, uint16_t i); +static void invalidate_point(lv_obj_t * obj, uint32_t i); static void new_points_alloc(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t cnt, lv_coord_t ** a); lv_chart_tick_dsc_t * get_tick_gsc(lv_obj_t * obj, lv_chart_axis_t axis); @@ -101,7 +101,7 @@ void lv_chart_set_type(lv_obj_t * obj, lv_chart_type_t type) lv_chart_refresh(obj); } -void lv_chart_set_point_count(lv_obj_t * obj, uint16_t cnt) +void lv_chart_set_point_count(lv_obj_t * obj, uint32_t cnt) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -182,7 +182,7 @@ void lv_chart_set_div_line_count(lv_obj_t * obj, uint8_t hdiv, uint8_t vdiv) } -void lv_chart_set_zoom_x(lv_obj_t * obj, uint16_t zoom_x) +void lv_chart_set_zoom_x(lv_obj_t * obj, uint32_t zoom_x) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -197,7 +197,7 @@ void lv_chart_set_zoom_x(lv_obj_t * obj, uint16_t zoom_x) lv_obj_invalidate(obj); } -void lv_chart_set_zoom_y(lv_obj_t * obj, uint16_t zoom_y) +void lv_chart_set_zoom_y(lv_obj_t * obj, uint32_t zoom_y) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -212,7 +212,7 @@ void lv_chart_set_zoom_y(lv_obj_t * obj, uint16_t zoom_y) lv_obj_invalidate(obj); } -uint16_t lv_chart_get_zoom_x(const lv_obj_t * obj) +uint32_t lv_chart_get_zoom_x(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -220,7 +220,7 @@ uint16_t lv_chart_get_zoom_x(const lv_obj_t * obj) return chart->zoom_x; } -uint16_t lv_chart_get_zoom_y(const lv_obj_t * obj) +uint32_t lv_chart_get_zoom_y(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -253,7 +253,7 @@ lv_chart_type_t lv_chart_get_type(const lv_obj_t * obj) return chart->type; } -uint16_t lv_chart_get_point_count(const lv_obj_t * obj) +uint32_t lv_chart_get_point_count(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -261,7 +261,7 @@ uint16_t lv_chart_get_point_count(const lv_obj_t * obj) return chart->point_cnt; } -uint16_t lv_chart_get_x_start_point(const lv_obj_t * obj, lv_chart_series_t * ser) +uint32_t lv_chart_get_x_start_point(const lv_obj_t * obj, lv_chart_series_t * ser) { LV_ASSERT_NULL(ser); lv_chart_t * chart = (lv_chart_t *)obj; @@ -269,7 +269,7 @@ uint16_t lv_chart_get_x_start_point(const lv_obj_t * obj, lv_chart_series_t * se return chart->update_mode == LV_CHART_UPDATE_MODE_SHIFT ? ser->start_point : 0; } -void lv_chart_get_point_pos_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint16_t id, lv_point_t * p_out) +void lv_chart_get_point_pos_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t id, lv_point_t * p_out) { LV_ASSERT_NULL(obj); LV_ASSERT_NULL(ser); @@ -386,7 +386,7 @@ lv_chart_series_t * lv_chart_add_series(lv_obj_t * obj, lv_color_t color, lv_cha ser->x_axis_sec = axis & LV_CHART_AXIS_SECONDARY_X ? 1 : 0; ser->y_axis_sec = axis & LV_CHART_AXIS_SECONDARY_Y ? 1 : 0; - uint16_t i; + uint32_t i; const lv_coord_t def = LV_CHART_POINT_NONE; lv_coord_t * p_tmp = ser->y_points; for(i = 0; i < chart->point_cnt; i++) { @@ -431,7 +431,7 @@ void lv_chart_set_series_color(lv_obj_t * chart, lv_chart_series_t * series, lv_ lv_chart_refresh(chart); } -void lv_chart_set_x_start_point(lv_obj_t * obj, lv_chart_series_t * ser, uint16_t id) +void lv_chart_set_x_start_point(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t id) { LV_ASSERT_OBJ(obj, MY_CLASS); LV_ASSERT_NULL(ser); @@ -506,7 +506,7 @@ void lv_chart_set_cursor_pos(lv_obj_t * chart, lv_chart_cursor_t * cursor, lv_po * @param cursor pointer to the cursor. * @param pos the new coordinate of cursor relative to the series area */ -void lv_chart_set_cursor_point(lv_obj_t * chart, lv_chart_cursor_t * cursor, lv_chart_series_t * ser, uint16_t point_id) +void lv_chart_set_cursor_point(lv_obj_t * chart, lv_chart_cursor_t * cursor, lv_chart_series_t * ser, uint32_t point_id) { LV_ASSERT_NULL(cursor); LV_UNUSED(chart); @@ -543,7 +543,7 @@ void lv_chart_set_all_value(lv_obj_t * obj, lv_chart_series_t * ser, lv_coord_t LV_ASSERT_NULL(ser); lv_chart_t * chart = (lv_chart_t *)obj; - uint16_t i; + uint32_t i; for(i = 0; i < chart->point_cnt; i++) { ser->y_points[i] = value; } @@ -581,7 +581,7 @@ void lv_chart_set_next_value2(lv_obj_t * obj, lv_chart_series_t * ser, lv_coord_ invalidate_point(obj, ser->start_point); } -void lv_chart_set_value_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint16_t id, lv_coord_t value) +void lv_chart_set_value_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t id, lv_coord_t value) { LV_ASSERT_OBJ(obj, MY_CLASS); LV_ASSERT_NULL(ser); @@ -592,7 +592,7 @@ void lv_chart_set_value_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint16_t invalidate_point(obj, id); } -void lv_chart_set_value_by_id2(lv_obj_t * obj, lv_chart_series_t * ser, uint16_t id, lv_coord_t x_value, +void lv_chart_set_value_by_id2(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t id, lv_coord_t x_value, lv_coord_t y_value) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -863,7 +863,7 @@ static void draw_series_line(lv_obj_t * obj, lv_layer_t * layer) lv_chart_t * chart = (lv_chart_t *)obj; if(chart->point_cnt < 2) return; - uint16_t i; + uint32_t i; lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN) + border_width; lv_coord_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN) + border_width; @@ -893,7 +893,7 @@ static void draw_series_line(lv_obj_t * obj, lv_layer_t * layer) if(line_dsc.width == 1) line_dsc.raw_end = 1; /*If there are at least as many points as pixels then draw only vertical lines*/ - bool crowded_mode = chart->point_cnt >= w; + bool crowded_mode = (int32_t)chart->point_cnt >= w; /*Go through all data lines*/ _LV_LL_READ_BACK(&chart->series_ll, ser) { @@ -1010,7 +1010,7 @@ static void draw_series_scatter(lv_obj_t * obj, lv_layer_t * layer) lv_chart_t * chart = (lv_chart_t *)obj; - uint16_t i; + uint32_t i; lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); lv_coord_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); @@ -1130,7 +1130,7 @@ static void draw_series_bar(lv_obj_t * obj, lv_layer_t * layer) lv_chart_t * chart = (lv_chart_t *)obj; - uint16_t i; + uint32_t i; lv_area_t col_a; lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); lv_coord_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); @@ -1455,7 +1455,8 @@ static void draw_x_ticks(lv_obj_t * obj, lv_layer_t * layer, lv_chart_axis_t axi line_dsc.p1.y = y_ofs; uint32_t total_tick_num; - if(chart->type == LV_CHART_TYPE_LINE && (((t->major_cnt - 1) * t->minor_cnt) == chart->point_cnt)) { + if(chart->type == LV_CHART_TYPE_LINE && + ((uint32_t)((t->major_cnt - 1) * t->minor_cnt) == chart->point_cnt)) { total_tick_num = chart->point_cnt - 1; } else { @@ -1548,7 +1549,7 @@ static uint32_t get_index_from_x(lv_obj_t * obj, lv_coord_t x) return 0; } -static void invalidate_point(lv_obj_t * obj, uint16_t i) +static void invalidate_point(lv_obj_t * obj, uint32_t i) { lv_chart_t * chart = (lv_chart_t *)obj; if(i >= chart->point_cnt) return; diff --git a/src/widgets/chart/lv_chart.h b/src/widgets/chart/lv_chart.h index 4062cd607..4d986d43a 100644 --- a/src/widgets/chart/lv_chart.h +++ b/src/widgets/chart/lv_chart.h @@ -90,12 +90,12 @@ typedef struct { lv_coord_t * x_points; lv_coord_t * y_points; lv_color_t color; - uint16_t start_point; - uint8_t hidden : 1; - uint8_t x_ext_buf_assigned : 1; - uint8_t y_ext_buf_assigned : 1; - uint8_t x_axis_sec : 1; - uint8_t y_axis_sec : 1; + uint32_t start_point; + uint32_t hidden : 1; + uint32_t x_ext_buf_assigned : 1; + uint32_t y_ext_buf_assigned : 1; + uint32_t x_axis_sec : 1; + uint32_t y_axis_sec : 1; } lv_chart_series_t; typedef struct { @@ -104,7 +104,7 @@ typedef struct { lv_color_t color; lv_chart_series_t * ser; lv_dir_t dir; - uint8_t pos_set: 1; /*1: pos is set; 0: point_id is set*/ + uint32_t pos_set: 1; /*1: pos is set; 0: point_id is set*/ } lv_chart_cursor_t; typedef struct { @@ -127,11 +127,11 @@ typedef struct { lv_coord_t xmin[2]; lv_coord_t xmax[2]; lv_coord_t pressed_point_id; - uint16_t hdiv_cnt; /**< Number of horizontal division lines*/ - uint16_t vdiv_cnt; /**< Number of vertical division lines*/ - uint16_t point_cnt; /**< Point number in a data line*/ - uint16_t zoom_x; - uint16_t zoom_y; + uint32_t hdiv_cnt; /**< Number of horizontal division lines*/ + uint32_t vdiv_cnt; /**< Number of vertical division lines*/ + uint32_t point_cnt; /**< Point number in a data line*/ + uint32_t zoom_x; + uint32_t zoom_y; lv_chart_type_t type : 3; /**< Line or column chart*/ lv_chart_update_mode_t update_mode : 1; } lv_chart_t; @@ -160,7 +160,7 @@ void lv_chart_set_type(lv_obj_t * obj, lv_chart_type_t type); * @param obj pointer to a chart object * @param cnt new number of points on the data lines */ -void lv_chart_set_point_count(lv_obj_t * obj, uint16_t cnt); +void lv_chart_set_point_count(lv_obj_t * obj, uint32_t cnt); /** * Set the minimal and maximal y values on an axis @@ -191,28 +191,28 @@ void lv_chart_set_div_line_count(lv_obj_t * obj, uint8_t hdiv, uint8_t vdiv); * @param obj pointer to a chart object * @param zoom_x zoom in x direction. LV_SCALE_NONE or 256 for no zoom, 512 double zoom */ -void lv_chart_set_zoom_x(lv_obj_t * obj, uint16_t zoom_x); +void lv_chart_set_zoom_x(lv_obj_t * obj, uint32_t zoom_x); /** * Zoom into the chart in Y direction * @param obj pointer to a chart object * @param zoom_y zoom in y direction. LV_SCALE_NONE or 256 for no zoom, 512 double zoom */ -void lv_chart_set_zoom_y(lv_obj_t * obj, uint16_t zoom_y); +void lv_chart_set_zoom_y(lv_obj_t * obj, uint32_t zoom_y); /** * Get X zoom of a chart * @param obj pointer to a chart object * @return the X zoom value */ -uint16_t lv_chart_get_zoom_x(const lv_obj_t * obj); +uint32_t lv_chart_get_zoom_x(const lv_obj_t * obj); /** * Get Y zoom of a chart * @param obj pointer to a chart object * @return the Y zoom value */ -uint16_t lv_chart_get_zoom_y(const lv_obj_t * obj); +uint32_t lv_chart_get_zoom_y(const lv_obj_t * obj); /** * Set the number of tick lines on an axis @@ -241,7 +241,7 @@ lv_chart_type_t lv_chart_get_type(const lv_obj_t * obj); * @param obj pointer to chart object * @return point number on each data line */ -uint16_t lv_chart_get_point_count(const lv_obj_t * obj); +uint32_t lv_chart_get_point_count(const lv_obj_t * obj); /** * Get the current index of the x-axis start point in the data array @@ -249,7 +249,7 @@ uint16_t lv_chart_get_point_count(const lv_obj_t * obj); * @param ser pointer to a data series on 'chart' * @return the index of the current x start point in the data array */ -uint16_t lv_chart_get_x_start_point(const lv_obj_t * obj, lv_chart_series_t * ser); +uint32_t lv_chart_get_x_start_point(const lv_obj_t * obj, lv_chart_series_t * ser); /** * Get the position of a point to the chart. @@ -258,7 +258,7 @@ uint16_t lv_chart_get_x_start_point(const lv_obj_t * obj, lv_chart_series_t * se * @param id the index. * @param p_out store the result position here */ -void lv_chart_get_point_pos_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint16_t id, lv_point_t * p_out); +void lv_chart_get_point_pos_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t id, lv_point_t * p_out); /** * Refresh a chart if its data line has changed @@ -309,7 +309,7 @@ void lv_chart_set_series_color(lv_obj_t * chart, lv_chart_series_t * series, lv_ * @param ser pointer to a data series on 'chart' * @param id the index of the x point in the data array */ -void lv_chart_set_x_start_point(lv_obj_t * obj, lv_chart_series_t * ser, uint16_t id); +void lv_chart_set_x_start_point(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t id); /** * Get the next series. @@ -350,7 +350,7 @@ void lv_chart_set_cursor_pos(lv_obj_t * chart, lv_chart_cursor_t * cursor, lv_po * @param point_id the point's index or `LV_CHART_POINT_NONE` to not assign to any points. */ void lv_chart_set_cursor_point(lv_obj_t * chart, lv_chart_cursor_t * cursor, lv_chart_series_t * ser, - uint16_t point_id); + uint32_t point_id); /** * Get the coordinate of the cursor with respect to the paddings @@ -396,7 +396,7 @@ void lv_chart_set_next_value2(lv_obj_t * obj, lv_chart_series_t * ser, lv_coord_ * @param id the index of the x point in the array * @param value value to assign to array point */ -void lv_chart_set_value_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint16_t id, lv_coord_t value); +void lv_chart_set_value_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t id, lv_coord_t value); /** * Set an individual point's x and y value of a chart's series directly based on its index @@ -407,7 +407,7 @@ void lv_chart_set_value_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint16_t * @param x_value the new X value of the next data * @param y_value the new Y value of the next data */ -void lv_chart_set_value_by_id2(lv_obj_t * obj, lv_chart_series_t * ser, uint16_t id, lv_coord_t x_value, +void lv_chart_set_value_by_id2(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t id, lv_coord_t x_value, lv_coord_t y_value); /** diff --git a/src/widgets/dropdown/lv_dropdown.c b/src/widgets/dropdown/lv_dropdown.c index b24d61290..dc043ce89 100644 --- a/src/widgets/dropdown/lv_dropdown.c +++ b/src/widgets/dropdown/lv_dropdown.c @@ -48,12 +48,12 @@ static void lv_dropdownlist_destructor(const lv_obj_class_t * class_p, lv_obj_t static void lv_dropdown_list_event(const lv_obj_class_t * class_p, lv_event_t * e); static void draw_list(lv_event_t * e); -static void draw_box(lv_obj_t * dropdown_obj, lv_layer_t * layer, uint16_t id, lv_state_t state); -static void draw_box_label(lv_obj_t * dropdown_obj, lv_layer_t * layer, uint16_t id, lv_state_t state); +static void draw_box(lv_obj_t * dropdown_obj, lv_layer_t * layer, uint32_t id, lv_state_t state); +static void draw_box_label(lv_obj_t * dropdown_obj, lv_layer_t * layer, uint32_t id, lv_state_t state); static lv_result_t btn_release_handler(lv_obj_t * obj); static lv_result_t list_release_handler(lv_obj_t * list_obj); static void list_press_handler(lv_obj_t * page); -static uint16_t get_id_on_point(lv_obj_t * dropdown_obj, lv_coord_t y); +static uint32_t get_id_on_point(lv_obj_t * dropdown_obj, lv_coord_t y); static void position_to_selected(lv_obj_t * obj); static lv_obj_t * get_label(const lv_obj_t * obj); @@ -272,7 +272,7 @@ void lv_dropdown_clear_options(lv_obj_t * obj) if(dropdown->list) lv_obj_invalidate(dropdown->list); } -void lv_dropdown_set_selected(lv_obj_t * obj, uint16_t sel_opt) +void lv_dropdown_set_selected(lv_obj_t * obj, uint32_t sel_opt) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -347,7 +347,7 @@ const char * lv_dropdown_get_options(const lv_obj_t * obj) return dropdown->options == NULL ? "" : dropdown->options; } -uint16_t lv_dropdown_get_selected(const lv_obj_t * obj) +uint32_t lv_dropdown_get_selected(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -356,7 +356,7 @@ uint16_t lv_dropdown_get_selected(const lv_obj_t * obj) return dropdown->sel_opt_id; } -uint16_t lv_dropdown_get_option_cnt(const lv_obj_t * obj) +uint32_t lv_dropdown_get_option_cnt(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -929,7 +929,7 @@ static void draw_list(lv_event_t * e) } } -static void draw_box(lv_obj_t * dropdown_obj, lv_layer_t * layer, uint16_t id, lv_state_t state) +static void draw_box(lv_obj_t * dropdown_obj, lv_layer_t * layer, uint32_t id, lv_state_t state) { if(id == LV_DROPDOWN_PR_NONE) return; @@ -967,7 +967,7 @@ static void draw_box(lv_obj_t * dropdown_obj, lv_layer_t * layer, uint16_t id, l list_obj->skip_trans = 0; } -static void draw_box_label(lv_obj_t * dropdown_obj, lv_layer_t * layer, uint16_t id, lv_state_t state) +static void draw_box_label(lv_obj_t * dropdown_obj, lv_layer_t * layer, uint32_t id, lv_state_t state) { if(id == LV_DROPDOWN_PR_NONE) return; @@ -1102,7 +1102,7 @@ static void list_press_handler(lv_obj_t * list_obj) } } -static uint16_t get_id_on_point(lv_obj_t * dropdown_obj, lv_coord_t y) +static uint32_t get_id_on_point(lv_obj_t * dropdown_obj, lv_coord_t y) { lv_dropdown_t * dropdown = (lv_dropdown_t *)dropdown_obj; lv_obj_t * label = get_label(dropdown_obj); @@ -1116,7 +1116,7 @@ static uint16_t get_id_on_point(lv_obj_t * dropdown_obj, lv_coord_t y) y += line_space / 2; lv_coord_t h = font_h + line_space; - uint16_t opt = y / h; + uint32_t opt = y / h; if(opt >= dropdown->option_cnt) opt = dropdown->option_cnt - 1; return opt; diff --git a/src/widgets/dropdown/lv_dropdown.h b/src/widgets/dropdown/lv_dropdown.h index 78d5da600..b28059f2a 100644 --- a/src/widgets/dropdown/lv_dropdown.h +++ b/src/widgets/dropdown/lv_dropdown.h @@ -41,10 +41,10 @@ typedef struct { const char * text; /**< Text to display on the dropdown's button*/ const void * symbol; /**< Arrow or other icon when the drop-down list is closed*/ char * options; /**< Options in a '\n' separated list*/ - uint16_t option_cnt; /**< Number of options*/ - uint16_t sel_opt_id; /**< Index of the currently selected option*/ - uint16_t sel_opt_id_orig; /**< Store the original index on focus*/ - uint16_t pr_opt_id; /**< Index of the currently pressed option*/ + uint32_t option_cnt; /**< Number of options*/ + uint32_t sel_opt_id; /**< Index of the currently selected option*/ + uint32_t sel_opt_id_orig; /**< Store the original index on focus*/ + uint32_t pr_opt_id; /**< Index of the currently pressed option*/ lv_dir_t dir : 4; /**< Direction in which the list should open*/ uint8_t static_txt : 1; /**< 1: Only a pointer is saved in `options`*/ uint8_t selected_highlight: 1; /**< 1: Make the selected option highlighted in the list*/ @@ -117,7 +117,7 @@ void lv_dropdown_clear_options(lv_obj_t * obj); * @param obj pointer to drop-down list object * @param sel_opt id of the selected option (0 ... number of option - 1); */ -void lv_dropdown_set_selected(lv_obj_t * obj, uint16_t sel_opt); +void lv_dropdown_set_selected(lv_obj_t * obj, uint32_t sel_opt); /** * Set the direction of the a drop-down list @@ -172,14 +172,14 @@ const char * lv_dropdown_get_options(const lv_obj_t * obj); * @param obj pointer to drop-down list object * @return index of the selected option (0 ... number of option - 1); */ -uint16_t lv_dropdown_get_selected(const lv_obj_t * obj); +uint32_t lv_dropdown_get_selected(const lv_obj_t * obj); /** * Get the total number of options * @param obj pointer to drop-down list object * @return the total number of options in the list */ -uint16_t lv_dropdown_get_option_cnt(const lv_obj_t * obj); +uint32_t lv_dropdown_get_option_cnt(const lv_obj_t * obj); /** * Get the current selected option as a string diff --git a/src/widgets/image/lv_image.c b/src/widgets/image/lv_image.c index 2d926a4e7..f57034825 100644 --- a/src/widgets/image/lv_image.c +++ b/src/widgets/image/lv_image.c @@ -171,13 +171,13 @@ void lv_image_set_offset_y(lv_obj_t * obj, lv_coord_t y) lv_obj_invalidate(obj); } -void lv_image_set_rotation(lv_obj_t * obj, int16_t angle) +void lv_image_set_rotation(lv_obj_t * obj, int32_t angle) { while(angle >= 3600) angle -= 3600; while(angle < 0) angle += 3600; lv_image_t * img = (lv_image_t *)obj; - if(angle == img->rotation) return; + if((uint32_t)angle == img->rotation) return; if(img->obj_size_mode == LV_IMAGE_SIZE_MODE_REAL) { img->rotation = angle; @@ -259,7 +259,7 @@ void lv_image_set_pivot(lv_obj_t * obj, lv_coord_t x, lv_coord_t y) lv_obj_invalidate_area(obj, &a); } -void lv_image_set_scale(lv_obj_t * obj, uint16_t zoom) +void lv_image_set_scale(lv_obj_t * obj, uint32_t zoom) { lv_image_t * img = (lv_image_t *)obj; if(zoom == img->zoom) return; diff --git a/src/widgets/image/lv_image.h b/src/widgets/image/lv_image.h index 525ee5a33..26c8fdedd 100644 --- a/src/widgets/image/lv_image.h +++ b/src/widgets/image/lv_image.h @@ -39,13 +39,13 @@ extern "C" { */ typedef struct { lv_obj_t obj; - const void * src; /*Image source: Pointer to an array or a file or a symbol*/ + const void * src; /*Image source: Pointer to an array or a file or a symbol*/ lv_point_t offset; lv_coord_t w; /*Width of the image (Handled by the library)*/ lv_coord_t h; /*Height of the image (Handled by the library)*/ - lv_coord_t rotation; /*rotation angle of the image*/ + uint32_t rotation; /*rotation angle of the image*/ + uint32_t zoom; /*256 means no zoom, 512 double size, 128 half size*/ lv_point_t pivot; /*rotation center of the image*/ - lv_coord_t zoom; /*256 means no zoom, 512 double size, 128 half size*/ uint8_t src_type : 2; /*See: lv_image_src_t*/ uint8_t cf : 5; /*Color format from `lv_color_format_t`*/ uint8_t antialias : 1; /*Apply anti-aliasing in transformations (rotate, zoom)*/ @@ -122,7 +122,7 @@ void lv_image_set_offset_y(lv_obj_t * obj, lv_coord_t y); * @param obj pointer to an image object * @param angle rotation in degree with 0.1 degree resolution (0..3600: clock wise) */ -void lv_image_set_rotation(lv_obj_t * obj, int16_t angle); +void lv_image_set_rotation(lv_obj_t * obj, int32_t angle); /** * Set the rotation center of the image. @@ -146,7 +146,7 @@ void lv_image_set_pivot(lv_obj_t * obj, lv_coord_t x, lv_coord_t y); * @example 128 half size * @example 512 double size */ -void lv_image_set_scale(lv_obj_t * obj, uint16_t zoom); +void lv_image_set_scale(lv_obj_t * obj, uint32_t zoom); /** * Enable/disable anti-aliasing for the transformations (rotate, zoom) or not. diff --git a/src/widgets/keyboard/lv_keyboard.c b/src/widgets/keyboard/lv_keyboard.c index 4db74c15c..be59fca6b 100644 --- a/src/widgets/keyboard/lv_keyboard.c +++ b/src/widgets/keyboard/lv_keyboard.c @@ -322,7 +322,7 @@ void lv_keyboard_def_event_cb(lv_event_t * e) LV_ASSERT_OBJ(obj, MY_CLASS); lv_keyboard_t * keyboard = (lv_keyboard_t *)obj; - uint16_t btn_id = lv_buttonmatrix_get_selected_button(obj); + uint32_t btn_id = lv_buttonmatrix_get_selected_button(obj); if(btn_id == LV_BUTTONMATRIX_BUTTON_NONE) return; const char * txt = lv_buttonmatrix_get_button_text(obj, btn_id); @@ -395,7 +395,7 @@ void lv_keyboard_def_event_cb(lv_event_t * e) lv_textarea_del_char(keyboard->ta); } else if(strcmp(txt, "+/-") == 0) { - uint16_t cur = lv_textarea_get_cursor_pos(keyboard->ta); + uint32_t cur = lv_textarea_get_cursor_pos(keyboard->ta); const char * ta_txt = lv_textarea_get_text(keyboard->ta); if(ta_txt[0] == '-') { lv_textarea_set_cursor_pos(keyboard->ta, 1); @@ -471,7 +471,8 @@ static void lv_keyboard_update_ctrl_map(lv_obj_t * obj) lv_memcpy(ctrl_map, kb_ctrl[keyboard->mode], sizeof(lv_buttonmatrix_ctrl_t) * btnm->btn_cnt); /*Remove all LV_BUTTONMATRIX_CTRL_POPOVER flags*/ - for(uint16_t i = 0; i < btnm->btn_cnt; i++) { + uint32_t i; + for(i = 0; i < btnm->btn_cnt; i++) { ctrl_map[i] &= (~LV_BUTTONMATRIX_CTRL_POPOVER); } diff --git a/src/widgets/keyboard/lv_keyboard.h b/src/widgets/keyboard/lv_keyboard.h index 0cd2165aa..35bbc81a8 100644 --- a/src/widgets/keyboard/lv_keyboard.h +++ b/src/widgets/keyboard/lv_keyboard.h @@ -156,7 +156,7 @@ static inline const char ** lv_keyboard_get_map_array(const lv_obj_t * kb) * @param obj pointer to button matrix object * @return index of the last released button (LV_BUTTONMATRIX_BUTTON_NONE: if unset) */ -static inline uint16_t lv_keyboard_get_selected_button(const lv_obj_t * obj) +static inline uint32_t lv_keyboard_get_selected_button(const lv_obj_t * obj) { return lv_buttonmatrix_get_selected_button(obj); } @@ -167,7 +167,7 @@ static inline uint16_t lv_keyboard_get_selected_button(const lv_obj_t * obj) * @param btn_id the index a button not counting new line characters. * @return text of btn_index` button */ -static inline const char * lv_keyboard_get_button_text(const lv_obj_t * obj, uint16_t btn_id) +static inline const char * lv_keyboard_get_button_text(const lv_obj_t * obj, uint32_t btn_id) { return lv_buttonmatrix_get_button_text(obj, btn_id); } diff --git a/src/widgets/label/lv_label.c b/src/widgets/label/lv_label.c index 7b9241ada..700bb83e1 100644 --- a/src/widgets/label/lv_label.c +++ b/src/widgets/label/lv_label.c @@ -886,7 +886,7 @@ static void lv_label_refr_text(lv_obj_t * obj) /*In scroll mode start an offset animation*/ if(label->long_mode == LV_LABEL_LONG_SCROLL) { const lv_anim_t * anim_template = lv_obj_get_style_anim(obj, LV_PART_MAIN); - uint16_t anim_speed = lv_obj_get_style_anim_speed(obj, LV_PART_MAIN); + uint32_t anim_speed = lv_obj_get_style_anim_speed(obj, LV_PART_MAIN); if(anim_speed == 0) anim_speed = LV_LABEL_DEF_SCROLL_SPEED; lv_anim_t a; lv_anim_init(&a); @@ -997,7 +997,7 @@ static void lv_label_refr_text(lv_obj_t * obj) /*In roll inf. mode keep the size but start offset animations*/ else if(label->long_mode == LV_LABEL_LONG_SCROLL_CIRCULAR) { const lv_anim_t * anim_template = lv_obj_get_style_anim(obj, LV_PART_MAIN); - uint16_t anim_speed = lv_obj_get_style_anim_speed(obj, LV_PART_MAIN); + uint32_t anim_speed = lv_obj_get_style_anim_speed(obj, LV_PART_MAIN); if(anim_speed == 0) anim_speed = LV_LABEL_DEF_SCROLL_SPEED; lv_anim_t a; lv_anim_init(&a); diff --git a/src/widgets/line/lv_line.c b/src/widgets/line/lv_line.c index 0ba04e9de..eb16d309a 100644 --- a/src/widgets/line/lv_line.c +++ b/src/widgets/line/lv_line.c @@ -63,7 +63,7 @@ lv_obj_t * lv_line_create(lv_obj_t * parent) * Setter functions *====================*/ -void lv_line_set_points(lv_obj_t * obj, const lv_point_t points[], uint16_t point_num) +void lv_line_set_points(lv_obj_t * obj, const lv_point_t points[], uint32_t point_num) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -159,7 +159,7 @@ static void lv_line_event(const lv_obj_class_t * class_p, lv_event_t * e) lv_coord_t w = 0; lv_coord_t h = 0; - uint16_t i; + uint32_t i; for(i = 0; i < line->point_num; i++) { if(!LV_COORD_IS_PCT(line->point_array[i].x)) { w = LV_MAX(line->point_array[i].x, w); @@ -189,7 +189,7 @@ static void lv_line_event(const lv_obj_class_t * class_p, lv_event_t * e) lv_obj_init_draw_line_dsc(obj, LV_PART_MAIN, &line_dsc); /*Read all points and draw the lines*/ - uint16_t i; + uint32_t i; for(i = 0; i < line->point_num - 1; i++) { lv_coord_t w = lv_obj_get_width(obj); lv_coord_t h = lv_obj_get_height(obj); diff --git a/src/widgets/line/lv_line.h b/src/widgets/line/lv_line.h index a2f303d24..214023b3c 100644 --- a/src/widgets/line/lv_line.h +++ b/src/widgets/line/lv_line.h @@ -28,8 +28,8 @@ extern "C" { typedef struct { lv_obj_t obj; const lv_point_t * point_array; /**< Pointer to an array with the points of the line*/ - uint16_t point_num; /**< Number of points in 'point_array'*/ - uint8_t y_inv : 1; /**< 1: y == 0 will be on the bottom*/ + uint32_t point_num; /**< Number of points in 'point_array'*/ + uint32_t y_inv : 1; /**< 1: y == 0 will be on the bottom*/ } lv_line_t; extern const lv_obj_class_t lv_line_class; @@ -55,7 +55,7 @@ lv_obj_t * lv_line_create(lv_obj_t * parent); * @param points an array of points. Only the address is saved, so the array needs to be alive while the line exists * @param point_num number of points in 'point_a' */ -void lv_line_set_points(lv_obj_t * obj, const lv_point_t points[], uint16_t point_num); +void lv_line_set_points(lv_obj_t * obj, const lv_point_t points[], uint32_t point_num); /** * Enable (or disable) the y coordinate inversion. diff --git a/src/widgets/msgbox/lv_msgbox.c b/src/widgets/msgbox/lv_msgbox.c index dcf84df9a..136763840 100644 --- a/src/widgets/msgbox/lv_msgbox.c +++ b/src/widgets/msgbox/lv_msgbox.c @@ -180,7 +180,7 @@ lv_obj_t * lv_msgbox_get_buttons(lv_obj_t * obj) return mbox->buttons; } -uint16_t lv_msgbox_get_active_button(lv_obj_t * mbox) +uint32_t lv_msgbox_get_active_button(lv_obj_t * mbox) { lv_obj_t * btnm = lv_msgbox_get_buttons(mbox); return lv_buttonmatrix_get_selected_button(btnm); diff --git a/src/widgets/msgbox/lv_msgbox.h b/src/widgets/msgbox/lv_msgbox.h index 50f2cbfd7..b2cbb8536 100644 --- a/src/widgets/msgbox/lv_msgbox.h +++ b/src/widgets/msgbox/lv_msgbox.h @@ -78,7 +78,7 @@ lv_obj_t * lv_msgbox_get_buttons(lv_obj_t * obj); * @param mbox message box object * @return index of the button (LV_BUTTONMATRIX_BUTTON_NONE: if unset) */ -uint16_t lv_msgbox_get_active_button(lv_obj_t * mbox); +uint32_t lv_msgbox_get_active_button(lv_obj_t * mbox); const char * lv_msgbox_get_active_button_text(lv_obj_t * mbox); diff --git a/src/widgets/roller/lv_roller.c b/src/widgets/roller/lv_roller.c index e9d6e42dd..c04e03149 100644 --- a/src/widgets/roller/lv_roller.c +++ b/src/widgets/roller/lv_roller.c @@ -131,7 +131,7 @@ void lv_roller_set_options(lv_obj_t * obj, const char * options, lv_roller_mode_ size_t opt_len = lv_strlen(options) + 1; /*+1 to add '\n' after option lists*/ char * opt_extra = lv_malloc(opt_len * roller->inf_page_cnt); - uint8_t i; + uint32_t i; for(i = 0; i < roller->inf_page_cnt; i++) { lv_strcpy(&opt_extra[opt_len * i], options); opt_extra[opt_len * (i + 1) - 1] = '\n'; @@ -159,7 +159,7 @@ void lv_roller_set_options(lv_obj_t * obj, const char * options, lv_roller_mode_ * @param sel_opt id of the selected option (0 ... number of option - 1); * @param anim_en LV_ANIM_ON: set with animation; LV_ANOM_OFF set immediately */ -void lv_roller_set_selected(lv_obj_t * obj, uint16_t sel_opt, lv_anim_enable_t anim) +void lv_roller_set_selected(lv_obj_t * obj, uint32_t sel_opt, lv_anim_enable_t anim) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -172,14 +172,14 @@ void lv_roller_set_selected(lv_obj_t * obj, uint16_t sel_opt, lv_anim_enable_t a /*In infinite mode interpret the new ID relative to the currently visible "page"*/ if(roller->mode == LV_ROLLER_MODE_INFINITE) { uint32_t real_option_cnt = roller->option_cnt / roller->inf_page_cnt; - uint16_t current_page = roller->sel_opt_id / real_option_cnt; + uint32_t current_page = roller->sel_opt_id / real_option_cnt; /*Set by the user to e.g. 0, 1, 2, 3... *Upscale the value to the current page*/ if(sel_opt < real_option_cnt) { - uint16_t act_opt = roller->sel_opt_id - current_page * real_option_cnt; + uint32_t act_opt = roller->sel_opt_id - current_page * real_option_cnt; int32_t sel_opt_signed = sel_opt; /*Huge jump? Probably from last to first or first to last option.*/ - if((uint16_t)LV_ABS((int16_t)act_opt - sel_opt) > real_option_cnt / 2) { + if((uint32_t)LV_ABS((int16_t)act_opt - sel_opt) > real_option_cnt / 2) { if(act_opt > sel_opt) sel_opt_signed += real_option_cnt; else sel_opt_signed -= real_option_cnt; } @@ -198,7 +198,7 @@ void lv_roller_set_selected(lv_obj_t * obj, uint16_t sel_opt, lv_anim_enable_t a * @param roller pointer to a roller object * @param row_cnt number of desired visible rows */ -void lv_roller_set_visible_row_count(lv_obj_t * obj, uint8_t row_cnt) +void lv_roller_set_visible_row_count(lv_obj_t * obj, uint32_t row_cnt) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -217,13 +217,13 @@ void lv_roller_set_visible_row_count(lv_obj_t * obj, uint8_t row_cnt) * @param roller pointer to a roller object * @return id of the selected option (0 ... number of option - 1); */ -uint16_t lv_roller_get_selected(const lv_obj_t * obj) +uint32_t lv_roller_get_selected(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_roller_t * roller = (lv_roller_t *)obj; if(roller->mode == LV_ROLLER_MODE_INFINITE) { - uint16_t real_id_cnt = roller->option_cnt / roller->inf_page_cnt; + uint32_t real_id_cnt = roller->option_cnt / roller->inf_page_cnt; return roller->sel_opt_id % real_id_cnt; } else { @@ -244,7 +244,7 @@ void lv_roller_get_selected_str(const lv_obj_t * obj, char * buf, uint32_t buf_s lv_roller_t * roller = (lv_roller_t *)obj; lv_obj_t * label = get_label(obj); uint32_t i; - uint16_t line = 0; + uint32_t line = 0; const char * opt_txt = lv_label_get_text(label); size_t txt_len = lv_strlen(opt_txt); @@ -283,7 +283,7 @@ const char * lv_roller_get_options(const lv_obj_t * obj) * @param roller pointer to a roller object * @return the total number of options */ -uint16_t lv_roller_get_option_cnt(const lv_obj_t * obj) +uint32_t lv_roller_get_option_cnt(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -406,14 +406,14 @@ static void lv_roller_event(const lv_obj_class_t * class_p, lv_event_t * e) char c = *((char *)lv_event_get_param(e)); if(c == LV_KEY_RIGHT || c == LV_KEY_DOWN) { if(roller->sel_opt_id + 1 < roller->option_cnt) { - uint16_t ori_id = roller->sel_opt_id_ori; /*lv_roller_set_selected will overwrite this*/ + uint32_t ori_id = roller->sel_opt_id_ori; /*lv_roller_set_selected will overwrite this*/ lv_roller_set_selected(obj, roller->sel_opt_id + 1, LV_ANIM_ON); roller->sel_opt_id_ori = ori_id; } } else if(c == LV_KEY_LEFT || c == LV_KEY_UP) { if(roller->sel_opt_id > 0) { - uint16_t ori_id = roller->sel_opt_id_ori; /*lv_roller_set_selected will overwrite this*/ + uint32_t ori_id = roller->sel_opt_id_ori; /*lv_roller_set_selected will overwrite this*/ lv_roller_set_selected(obj, roller->sel_opt_id - 1, LV_ANIM_ON); roller->sel_opt_id_ori = ori_id; } @@ -639,7 +639,7 @@ static void refr_position(lv_obj_t * obj, lv_anim_enable_t anim_en) const lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN); const lv_coord_t font_h = lv_font_get_line_height(font); const lv_coord_t h = lv_obj_get_content_height(obj); - uint16_t anim_time = lv_obj_get_style_anim_time(obj, LV_PART_MAIN); + uint32_t anim_time = lv_obj_get_style_anim_time(obj, LV_PART_MAIN); /*Normally the animation's `end_cb` sets correct position of the roller if infinite. *But without animations we have to do it manually*/ @@ -741,7 +741,7 @@ static lv_result_t release_handler(lv_obj_t * obj) int32_t id = (mid - label_y1) / label_unit; if(id < 0) id = 0; - if(id >= roller->option_cnt) id = roller->option_cnt - 1; + if(id >= (int32_t)roller->option_cnt) id = roller->option_cnt - 1; new_opt = id; } @@ -765,7 +765,7 @@ static void inf_normalize(lv_obj_t * obj) lv_roller_t * roller = (lv_roller_t *)obj; if(roller->mode == LV_ROLLER_MODE_INFINITE) { - uint16_t real_id_cnt = roller->option_cnt / roller->inf_page_cnt; + uint32_t real_id_cnt = roller->option_cnt / roller->inf_page_cnt; roller->sel_opt_id = roller->sel_opt_id % real_id_cnt; roller->sel_opt_id += (roller->inf_page_cnt / 2) * real_id_cnt; /*Select the middle page*/ @@ -780,7 +780,6 @@ static void inf_normalize(lv_obj_t * obj) lv_obj_t * label = get_label(obj); - lv_coord_t sel_y1 = roller->sel_opt_id * (font_h + line_space); lv_coord_t mid_y1 = h / 2 - font_h / 2; lv_coord_t new_y = mid_y1 - sel_y1; diff --git a/src/widgets/roller/lv_roller.h b/src/widgets/roller/lv_roller.h index 044307b93..0ed5cb5d3 100644 --- a/src/widgets/roller/lv_roller.h +++ b/src/widgets/roller/lv_roller.h @@ -47,9 +47,9 @@ typedef uint8_t lv_roller_mode_t; typedef struct { lv_obj_t obj; - uint16_t option_cnt; /**< Number of options*/ - uint16_t sel_opt_id; /**< Index of the current option*/ - uint16_t sel_opt_id_ori; /**< Store the original index on focus*/ + uint32_t option_cnt; /**< Number of options*/ + uint32_t sel_opt_id; /**< Index of the current option*/ + uint32_t sel_opt_id_ori; /**< Store the original index on focus*/ uint32_t inf_page_cnt; /**< Number of extra pages added to make the roller look infinite */ lv_roller_mode_t mode : 1; uint32_t moved : 1; @@ -87,14 +87,14 @@ void lv_roller_set_options(lv_obj_t * obj, const char * options, lv_roller_mode_ * @param sel_opt index of the selected option (0 ... number of option - 1); * @param anim LV_ANIM_ON: set with animation; LV_ANOM_OFF set immediately */ -void lv_roller_set_selected(lv_obj_t * obj, uint16_t sel_opt, lv_anim_enable_t anim); +void lv_roller_set_selected(lv_obj_t * obj, uint32_t sel_opt, lv_anim_enable_t anim); /** * Set the height to show the given number of rows (options) * @param obj pointer to a roller object * @param row_cnt number of desired visible rows */ -void lv_roller_set_visible_row_count(lv_obj_t * obj, uint8_t row_cnt); +void lv_roller_set_visible_row_count(lv_obj_t * obj, uint32_t row_cnt); /*===================== * Getter functions @@ -105,7 +105,7 @@ void lv_roller_set_visible_row_count(lv_obj_t * obj, uint8_t row_cnt); * @param obj pointer to a roller object * @return index of the selected option (0 ... number of option - 1); */ -uint16_t lv_roller_get_selected(const lv_obj_t * obj); +uint32_t lv_roller_get_selected(const lv_obj_t * obj); /** * Get the current selected option as a string. @@ -128,7 +128,7 @@ const char * lv_roller_get_options(const lv_obj_t * obj); * @param obj pointer to a roller object * @return the total number of options */ -uint16_t lv_roller_get_option_cnt(const lv_obj_t * obj); +uint32_t lv_roller_get_option_cnt(const lv_obj_t * obj); /********************** * MACROS diff --git a/src/widgets/scale/lv_scale.c b/src/widgets/scale/lv_scale.c index 0835ec5d7..0d616d825 100644 --- a/src/widgets/scale/lv_scale.c +++ b/src/widgets/scale/lv_scale.c @@ -20,9 +20,8 @@ #define MY_CLASS &lv_scale_class #define LV_SCALE_LABEL_TXT_LEN (20U) -#define LV_SCALE_DEFAULT_ZOOM ((int32_t) 256U) -#define LV_SCALE_DEFAULT_ANGLE_RANGE ((uint16_t) 270U) -#define LV_SCALE_DEFAULT_ROTATION ((int16_t) 135U) +#define LV_SCALE_DEFAULT_ANGLE_RANGE ((uint32_t) 270U) +#define LV_SCALE_DEFAULT_ROTATION ((int32_t) 135U) /********************** * TYPEDEFS @@ -40,7 +39,7 @@ static void scale_draw_main(lv_obj_t * obj, lv_event_t * event); static void scale_draw_indicator(lv_obj_t * obj, lv_event_t * event); static void scale_get_center(const lv_obj_t * obj, lv_point_t * center, lv_coord_t * arc_r); -static void scale_get_tick_points(lv_obj_t * obj, const uint16_t tick_idx, bool is_major_tick, +static void scale_get_tick_points(lv_obj_t * obj, const uint32_t tick_idx, bool is_major_tick, lv_point_t * tick_point_a, lv_point_t * tick_point_b); static void scale_get_label_coords(lv_obj_t * obj, lv_draw_label_dsc_t * label_dsc, lv_point_t * tick_point, lv_area_t * label_coords); @@ -51,7 +50,7 @@ static void scale_set_line_properties(lv_obj_t * obj, lv_draw_line_dsc_t * line_ static void scale_set_arc_properties(lv_obj_t * obj, lv_draw_arc_dsc_t * arc_dsc, lv_style_t * section_style); /* Helpers */ static void scale_find_section_tick_idx(lv_obj_t * obj); -static void scale_store_main_line_tick_width_compensation(lv_obj_t * obj, const uint8_t tick_idx, +static void scale_store_main_line_tick_width_compensation(lv_obj_t * obj, const uint32_t tick_idx, const bool is_major_tick, const lv_coord_t major_tick_width, const lv_coord_t minor_tick_width); /********************** @@ -165,7 +164,7 @@ void lv_scale_set_range(lv_obj_t * obj, lv_coord_t min, lv_coord_t max) lv_obj_invalidate(obj); } -void lv_scale_set_round_props(lv_obj_t * obj, uint16_t angle_range, int16_t rotation) +void lv_scale_set_round_props(lv_obj_t * obj, uint32_t angle_range, int32_t rotation) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_scale_t * scale = (lv_scale_t *)obj; @@ -370,9 +369,9 @@ static void scale_draw_indicator(lv_obj_t * obj, lv_event_t * event) if((LV_SCALE_MODE_VERTICAL_LEFT == scale->mode || LV_SCALE_MODE_VERTICAL_RIGHT == scale->mode) || (LV_SCALE_MODE_HORIZONTAL_BOTTOM == scale->mode || LV_SCALE_MODE_HORIZONTAL_TOP == scale->mode)) { - uint16_t total_tick_count = scale->total_tick_count; - uint8_t tick_idx = 0; - uint16_t major_tick_idx = 0; + uint32_t total_tick_count = scale->total_tick_count; + uint32_t tick_idx = 0; + uint32_t major_tick_idx = 0; for(tick_idx = 0; tick_idx <= total_tick_count; tick_idx++) { /* A major tick is the one which has a label in it */ bool is_major_tick = false; @@ -522,9 +521,9 @@ static void scale_draw_indicator(lv_obj_t * obj, lv_event_t * event) /* Major tick */ major_tick_dsc.raw_end = 0; - uint16_t label_gap = 15U; /* TODO: Add to style properties */ - uint8_t tick_idx = 0; - uint16_t major_tick_idx = 0; + uint32_t label_gap = 15U; /* TODO: Add to style properties */ + uint32_t tick_idx = 0; + uint32_t major_tick_idx = 0; for(tick_idx = 0; tick_idx <= scale->total_tick_count; tick_idx++) { /* A major tick is the one which has a label in it */ bool is_major_tick = false; @@ -590,7 +589,7 @@ static void scale_draw_indicator(lv_obj_t * obj, lv_event_t * event) lv_point_t point; point.x = center_point.x + radius_text; point.y = center_point.y; - lv_point_transform(&point, angle_upscale, LV_SCALE_DEFAULT_ZOOM, ¢er_point); + lv_point_transform(&point, angle_upscale, LV_SCALE_NONE, ¢er_point); scale_get_label_coords(obj, &label_dsc, &point, &label_coords); lv_draw_label(layer, &label_dsc, &label_coords); @@ -813,7 +812,7 @@ static void scale_get_center(const lv_obj_t * obj, lv_point_t * center, lv_coord * @param tick_point_a pointer to point 'a' of the tick * @param tick_point_b pointer to point 'b' of the tick */ -static void scale_get_tick_points(lv_obj_t * obj, const uint16_t tick_idx, bool is_major_tick, +static void scale_get_tick_points(lv_obj_t * obj, const uint32_t tick_idx, bool is_major_tick, lv_point_t * tick_point_a, lv_point_t * tick_point_b) { lv_scale_t * scale = (lv_scale_t *)obj; @@ -947,11 +946,11 @@ static void scale_get_tick_points(lv_obj_t * obj, const uint16_t tick_idx, bool tick_point_a->x = center_point.x + point_closer_to_arc; tick_point_a->y = center_point.y; - lv_point_transform(tick_point_a, angle_upscale, LV_SCALE_DEFAULT_ZOOM, ¢er_point); + lv_point_transform(tick_point_a, angle_upscale, LV_SCALE_NONE, ¢er_point); tick_point_b->x = center_point.x + adjusted_radio_with_tick_len; tick_point_b->y = center_point.y; - lv_point_transform(tick_point_b, angle_upscale, LV_SCALE_DEFAULT_ZOOM, ¢er_point); + lv_point_transform(tick_point_b, angle_upscale, LV_SCALE_NONE, ¢er_point); } else { /* Nothing to do */ } } @@ -1177,10 +1176,10 @@ static void scale_find_section_tick_idx(lv_obj_t * obj) const int32_t min_out = scale->range_min; const int32_t max_out = scale->range_max; - const uint16_t total_tick_count = scale->total_tick_count; + const uint32_t total_tick_count = scale->total_tick_count; /* Section handling */ - uint8_t tick_idx = 0; + uint32_t tick_idx = 0; for(tick_idx = 0; tick_idx <= total_tick_count; tick_idx++) { bool is_major_tick = false; if(tick_idx % scale->major_tick_every == 0) is_major_tick = true; @@ -1215,7 +1214,7 @@ static void scale_find_section_tick_idx(lv_obj_t * obj) * @param major_tick_width width of the major tick * @param minor_tick_width width of the minor tick */ -static void scale_store_main_line_tick_width_compensation(lv_obj_t * obj, const uint8_t tick_idx, +static void scale_store_main_line_tick_width_compensation(lv_obj_t * obj, const uint32_t tick_idx, const bool is_major_tick, const lv_coord_t major_tick_width, const lv_coord_t minor_tick_width) { lv_scale_t * scale = (lv_scale_t *)obj; diff --git a/src/widgets/scale/lv_scale.h b/src/widgets/scale/lv_scale.h index 5727b1aad..38eadf67d 100644 --- a/src/widgets/scale/lv_scale.h +++ b/src/widgets/scale/lv_scale.h @@ -51,7 +51,7 @@ enum { LV_SCALE_MODE_ROUND_OUTTER = 0x10U, _LV_SCALE_MODE_LAST }; -typedef uint8_t lv_scale_mode_t; +typedef uint32_t lv_scale_mode_t; typedef struct { lv_style_t * main_style; @@ -59,10 +59,10 @@ typedef struct { lv_style_t * items_style; lv_coord_t minor_range; lv_coord_t major_range; - uint8_t first_tick_idx_in_section; - uint8_t last_tick_idx_in_section; - uint8_t first_tick_idx_is_major; - uint8_t last_tick_idx_is_major; + uint32_t first_tick_idx_in_section; + uint32_t last_tick_idx_in_section; + uint32_t first_tick_idx_is_major; + uint32_t last_tick_idx_is_major; lv_coord_t first_tick_in_section_width; lv_coord_t last_tick_in_section_width; lv_point_t first_tick_in_section; @@ -85,8 +85,8 @@ typedef struct { lv_coord_t last_tick_width; lv_coord_t first_tick_width; /* Round scale */ - uint16_t angle_range; - int16_t rotation; + uint32_t angle_range; + int32_t rotation; } lv_scale_t; extern const lv_obj_class_t lv_scale_class; @@ -166,7 +166,7 @@ void lv_scale_set_range(lv_obj_t * obj, lv_coord_t min, lv_coord_t max); * @param angle_range the angular range of the scale * @param rotation the angular offset from the 3 o'clock position (clock-wise) */ -void lv_scale_set_round_props(lv_obj_t * obj, uint16_t angle_range, int16_t rotation); +void lv_scale_set_round_props(lv_obj_t * obj, uint32_t angle_range, int32_t rotation); /** * Set custom text source for major ticks labels diff --git a/src/widgets/span/lv_span.c b/src/widgets/span/lv_span.c index dd34f4648..dbef622d7 100644 --- a/src/widgets/span/lv_span.c +++ b/src/widgets/span/lv_span.c @@ -26,7 +26,7 @@ typedef struct { lv_span_t * span; const char * txt; const lv_font_t * font; - uint16_t bytes; + uint32_t bytes; lv_coord_t txt_w; lv_coord_t line_h; lv_coord_t letter_space; @@ -34,7 +34,7 @@ typedef struct { struct _snippet_stack { lv_snippet_t stack[LV_SPAN_SNIPPET_STACK_SIZE]; - uint16_t index; + uint32_t index; }; /********************** @@ -60,9 +60,9 @@ static bool lv_text_get_snippet(const char * txt, const lv_font_t * font, lv_coo uint32_t * end_ofs); static void lv_snippet_clear(void); -static uint16_t lv_get_snippet_cnt(void); +static uint32_t lv_get_snippet_cnt(void); static void lv_snippet_push(lv_snippet_t * item); -static lv_snippet_t * lv_get_snippet(uint16_t index); +static lv_snippet_t * lv_get_snippet(uint32_t index); static lv_coord_t convert_indent_pct(lv_obj_t * spans, lv_coord_t width); /********************** @@ -404,7 +404,7 @@ uint32_t lv_spangroup_get_expand_width(lv_obj_t * obj, uint32_t max_width) } uint32_t letter = _lv_text_encoded_next(cur_txt, &j); uint32_t letter_next = _lv_text_encoded_next(&cur_txt[j], NULL); - uint16_t letter_w = lv_font_get_glyph_width(font, letter, letter_next); + uint32_t letter_w = lv_font_get_glyph_width(font, letter, letter_next); width = width + letter_w + letter_space; } } @@ -661,12 +661,12 @@ static void lv_snippet_push(lv_snippet_t * item) } } -static uint16_t lv_get_snippet_cnt(void) +static uint32_t lv_get_snippet_cnt(void) { return snippet_stack->index; } -static lv_snippet_t * lv_get_snippet(uint16_t index) +static lv_snippet_t * lv_get_snippet(uint32_t index) { return &snippet_stack->stack[index]; } @@ -902,7 +902,7 @@ static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer) /* start current line deal with */ - uint16_t item_cnt = lv_get_snippet_cnt(); + uint32_t item_cnt = lv_get_snippet_cnt(); if(item_cnt == 0) { /* break if stack is empty */ break; } @@ -939,7 +939,8 @@ static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer) if(align == LV_TEXT_ALIGN_CENTER || align == LV_TEXT_ALIGN_RIGHT) { lv_coord_t align_ofs = 0; lv_coord_t txts_w = is_first_line ? indent : 0; - for(int i = 0; i < item_cnt; i++) { + uint32_t i; + for(i = 0; i < item_cnt; i++) { lv_snippet_t * pinfo = lv_get_snippet(i); txts_w = txts_w + pinfo->txt_w + pinfo->letter_space; } @@ -952,7 +953,7 @@ static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer) } /* draw line letters */ - int i; + uint32_t i; for(i = 0; i < item_cnt; i++) { lv_snippet_t * pinfo = lv_get_snippet(i); @@ -972,8 +973,8 @@ static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer) uint32_t txt_bytes = pinfo->bytes; /* overflow */ - uint16_t dot_letter_w = 0; - uint16_t dot_width = 0; + uint32_t dot_letter_w = 0; + uint32_t dot_width = 0; if(ellipsis_valid) { dot_letter_w = lv_font_get_glyph_width(pinfo->font, '.', '.'); dot_width = dot_letter_w * 3; diff --git a/src/widgets/span/lv_span.h b/src/widgets/span/lv_span.h index 88ad6c0f4..f7f6557b4 100644 --- a/src/widgets/span/lv_span.h +++ b/src/widgets/span/lv_span.h @@ -35,7 +35,7 @@ enum _lv_span_overflow_t { #ifdef DOXYGEN typedef _lv_span_overflow_t lv_span_overflow_t; #else -typedef uint8_t lv_span_overflow_t; +typedef uint32_t lv_span_overflow_t; #endif /*DOXYGEN*/ enum _lv_span_mode_t { @@ -47,7 +47,7 @@ enum _lv_span_mode_t { #ifdef DOXYGEN typedef _lv_span_mode_t lv_span_mode_t; #else -typedef uint8_t lv_span_mode_t; +typedef uint32_t lv_span_mode_t; #endif /*DOXYGEN*/ @@ -55,7 +55,7 @@ typedef struct { char * txt; /* a pointer to display text */ lv_obj_t * spangroup; /* a pointer to spangroup */ lv_style_t style; /* display text style */ - uint8_t static_flag : 1;/* the text is static flag */ + uint32_t static_flag : 1;/* the text is static flag */ } lv_span_t; /** Data of label*/ @@ -66,9 +66,9 @@ typedef struct { lv_coord_t cache_w; /* the cache automatically calculates the width */ lv_coord_t cache_h; /* similar cache_w */ lv_ll_t child_ll; - uint8_t mode : 2; /* details see lv_span_mode_t */ - uint8_t overflow : 1; /* details see lv_span_overflow_t */ - uint8_t refresh : 1; /* the spangroup need refresh cache_w and cache_h */ + uint32_t mode : 2; /* details see lv_span_mode_t */ + uint32_t overflow : 1; /* details see lv_span_overflow_t */ + uint32_t refresh : 1; /* the spangroup need refresh cache_w and cache_h */ } lv_spangroup_t; extern const lv_obj_class_t lv_spangroup_class; diff --git a/src/widgets/spinbox/lv_spinbox.c b/src/widgets/spinbox/lv_spinbox.c index 5c1bc848e..9fb30aced 100644 --- a/src/widgets/spinbox/lv_spinbox.c +++ b/src/widgets/spinbox/lv_spinbox.c @@ -101,7 +101,7 @@ void lv_spinbox_set_rollover(lv_obj_t * obj, bool b) * @param separator_position number of digit before the decimal point. If 0, decimal point is not * shown */ -void lv_spinbox_set_digit_format(lv_obj_t * obj, uint8_t digit_count, uint8_t separator_position) +void lv_spinbox_set_digit_format(lv_obj_t * obj, uint32_t digit_count, uint32_t separator_position) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_spinbox_t * spinbox = (lv_spinbox_t *)obj; @@ -161,7 +161,7 @@ void lv_spinbox_set_range(lv_obj_t * obj, int32_t range_min, int32_t range_max) * @param spinbox pointer to spinbox * @param pos selected position in spinbox */ -void lv_spinbox_set_cursor_pos(lv_obj_t * obj, uint8_t pos) +void lv_spinbox_set_cursor_pos(lv_obj_t * obj, uint32_t pos) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_spinbox_t * spinbox = (lv_spinbox_t *)obj; @@ -419,7 +419,7 @@ static void lv_spinbox_event(const lv_obj_class_t * class_p, lv_event_t * e) } /* Handle spinbox with decimal point (spinbox->dec_point_pos != 0) */ - uint16_t cp = spinbox->ta.cursor.pos; + uint32_t cp = spinbox->ta.cursor.pos; if(spinbox->ta.cursor.pos > spinbox->dec_point_pos && spinbox->dec_point_pos != 0) cp--; const size_t len = spinbox->digit_count - 1; @@ -428,7 +428,7 @@ static void lv_spinbox_event(const lv_obj_class_t * class_p, lv_event_t * e) if(spinbox->range_min < 0) pos++; spinbox->step = 1; - uint16_t i; + uint32_t i; for(i = 0; i < pos; i++) spinbox->step *= 10; } } @@ -468,7 +468,7 @@ static void lv_spinbox_updatevalue(lv_obj_t * obj) char textarea_txt[LV_SPINBOX_MAX_DIGIT_COUNT_WITH_8BYTES] = {0U}; char * buf_p = textarea_txt; - uint8_t cur_shift_left = 0; + uint32_t cur_shift_left = 0; if(spinbox->range_min < 0) { // hide sign if there are only positive values /*Add the sign*/ (*buf_p) = spinbox->value >= 0 ? '+' : '-'; @@ -485,11 +485,11 @@ static void lv_spinbox_updatevalue(lv_obj_t * obj) /*Add leading zeros*/ int32_t i; - const int digits_len = (int) lv_strlen(digits); + const size_t digits_len = lv_strlen(digits); const int leading_zeros_cnt = spinbox->digit_count - digits_len; if(leading_zeros_cnt) { - for(i = (uint16_t) digits_len; i >= 0; i--) { + for(i = (int32_t) digits_len; i >= 0; i--) { digits[i + leading_zeros_cnt] = digits[i]; } /* NOTE: Substitute with memset? */ @@ -499,8 +499,8 @@ static void lv_spinbox_updatevalue(lv_obj_t * obj) } /*Add the decimal part*/ - const int32_t intDigits = (spinbox->dec_point_pos == 0) ? spinbox->digit_count : spinbox->dec_point_pos; - for(i = 0; i < intDigits && digits[i] != '\0'; i++) { + const uint32_t intDigits = (spinbox->dec_point_pos == 0) ? spinbox->digit_count : spinbox->dec_point_pos; + for(i = 0; i < (int32_t)intDigits && digits[i] != '\0'; i++) { (*buf_p) = digits[i]; buf_p++; } @@ -521,7 +521,7 @@ static void lv_spinbox_updatevalue(lv_obj_t * obj) /*Set the cursor position*/ int32_t step = spinbox->step; - uint8_t cur_pos = (uint8_t)spinbox->digit_count; + uint32_t cur_pos = (uint32_t)spinbox->digit_count; while(step >= 10) { step /= 10; cur_pos--; diff --git a/src/widgets/spinbox/lv_spinbox.h b/src/widgets/spinbox/lv_spinbox.h index c969a74f5..079ec29bf 100644 --- a/src/widgets/spinbox/lv_spinbox.h +++ b/src/widgets/spinbox/lv_spinbox.h @@ -39,10 +39,10 @@ typedef struct { int32_t range_max; int32_t range_min; int32_t step; - uint16_t digit_count : 4; - uint16_t dec_point_pos : 4; /*if 0, there is no separator and the number is an integer*/ - uint16_t rollover : 1; /* Set to true for rollover functionality*/ - uint16_t digit_step_dir : 2; /* the direction the digit will step on encoder button press when editing*/ + uint32_t digit_count : 4; + uint32_t dec_point_pos : 4; /*if 0, there is no separator and the number is an integer*/ + uint32_t rollover : 1; /* Set to true for rollover functionality*/ + uint32_t digit_step_dir : 2; /* the direction the digit will step on encoder button press when editing*/ } lv_spinbox_t; extern const lv_obj_class_t lv_spinbox_class; @@ -83,7 +83,7 @@ void lv_spinbox_set_rollover(lv_obj_t * obj, bool b); * @param separator_position number of digit before the decimal point. If 0, decimal point is not * shown */ -void lv_spinbox_set_digit_format(lv_obj_t * obj, uint8_t digit_count, uint8_t separator_position); +void lv_spinbox_set_digit_format(lv_obj_t * obj, uint32_t digit_count, uint32_t separator_position); /** * Set spinbox step @@ -105,7 +105,7 @@ void lv_spinbox_set_range(lv_obj_t * obj, int32_t range_min, int32_t range_max); * @param obj pointer to spinbox * @param pos selected position in spinbox */ -void lv_spinbox_set_cursor_pos(lv_obj_t * obj, uint8_t pos); +void lv_spinbox_set_cursor_pos(lv_obj_t * obj, uint32_t pos); /** * Set direction of digit step when clicking an encoder button while in editing mode diff --git a/src/widgets/spinner/lv_spinner.c b/src/widgets/spinner/lv_spinner.c index 4d1e1f69d..755f6a176 100644 --- a/src/widgets/spinner/lv_spinner.c +++ b/src/widgets/spinner/lv_spinner.c @@ -94,13 +94,13 @@ static void lv_spinner_constructor(const lv_obj_class_t * class_p, lv_obj_t * ob static void arc_anim_start_angle(void * obj, int32_t v) { - lv_arc_set_start_angle(obj, (uint16_t) v); + lv_arc_set_start_angle(obj, (uint32_t) v); } static void arc_anim_end_angle(void * obj, int32_t v) { - lv_arc_set_end_angle(obj, (uint16_t) v); + lv_arc_set_end_angle(obj, (uint32_t) v); } #endif /*LV_USE_SPINNER*/ diff --git a/src/widgets/table/lv_table.c b/src/widgets/table/lv_table.c index 9ce7d9454..b2422e5dd 100644 --- a/src/widgets/table/lv_table.c +++ b/src/widgets/table/lv_table.c @@ -34,15 +34,15 @@ static void lv_table_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) static void lv_table_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); static void lv_table_event(const lv_obj_class_t * class_p, lv_event_t * e); static void draw_main(lv_event_t * e); -static lv_coord_t get_row_height(lv_obj_t * obj, uint16_t row_id, const lv_font_t * font, +static lv_coord_t get_row_height(lv_obj_t * obj, uint32_t row_id, const lv_font_t * font, lv_coord_t letter_space, lv_coord_t line_space, lv_coord_t cell_left, lv_coord_t cell_right, lv_coord_t cell_top, lv_coord_t cell_bottom); static void refr_size_form_row(lv_obj_t * obj, uint32_t start_row); static void refr_cell_size(lv_obj_t * obj, uint32_t row, uint32_t col); -static lv_result_t get_pressed_cell(lv_obj_t * obj, uint16_t * row, uint16_t * col); +static lv_result_t get_pressed_cell(lv_obj_t * obj, uint32_t * row, uint32_t * col); static size_t get_cell_txt_len(const char * txt); static void copy_cell_txt(char * dst, const char * txt); -static void get_cell_area(lv_obj_t * obj, uint16_t row, uint16_t col, lv_area_t * area); +static void get_cell_area(lv_obj_t * obj, uint32_t row, uint32_t col, lv_area_t * area); static void scroll_to_selected_cell(lv_obj_t * obj); static inline bool is_cell_empty(void * cell) @@ -84,7 +84,7 @@ lv_obj_t * lv_table_create(lv_obj_t * parent) * Setter functions *====================*/ -void lv_table_set_cell_value(lv_obj_t * obj, uint16_t row, uint16_t col, const char * txt) +void lv_table_set_cell_value(lv_obj_t * obj, uint32_t row, uint32_t col, const char * txt) { LV_ASSERT_OBJ(obj, MY_CLASS); LV_ASSERT_NULL(txt); @@ -113,7 +113,7 @@ void lv_table_set_cell_value(lv_obj_t * obj, uint16_t row, uint16_t col, const c refr_cell_size(obj, row, col); } -void lv_table_set_cell_value_fmt(lv_obj_t * obj, uint16_t row, uint16_t col, const char * fmt, ...) +void lv_table_set_cell_value_fmt(lv_obj_t * obj, uint32_t row, uint32_t col, const char * fmt, ...) { LV_ASSERT_OBJ(obj, MY_CLASS); LV_ASSERT_NULL(fmt); @@ -184,7 +184,7 @@ void lv_table_set_cell_value_fmt(lv_obj_t * obj, uint16_t row, uint16_t col, con refr_cell_size(obj, row, col); } -void lv_table_set_row_cnt(lv_obj_t * obj, uint16_t row_cnt) +void lv_table_set_row_cnt(lv_obj_t * obj, uint32_t row_cnt) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -192,7 +192,7 @@ void lv_table_set_row_cnt(lv_obj_t * obj, uint16_t row_cnt) if(table->row_cnt == row_cnt) return; - uint16_t old_row_cnt = table->row_cnt; + uint32_t old_row_cnt = table->row_cnt; table->row_cnt = row_cnt; table->row_h = lv_realloc(table->row_h, table->row_cnt * sizeof(table->row_h[0])); @@ -201,7 +201,7 @@ void lv_table_set_row_cnt(lv_obj_t * obj, uint16_t row_cnt) /*Free the unused cells*/ if(old_row_cnt > row_cnt) { - uint16_t old_cell_cnt = old_row_cnt * table->col_cnt; + uint32_t old_cell_cnt = old_row_cnt * table->col_cnt; uint32_t new_cell_cnt = table->col_cnt * table->row_cnt; uint32_t i; for(i = new_cell_cnt; i < old_cell_cnt; i++) { @@ -223,7 +223,7 @@ void lv_table_set_row_cnt(lv_obj_t * obj, uint16_t row_cnt) refr_size_form_row(obj, 0); } -void lv_table_set_col_cnt(lv_obj_t * obj, uint16_t col_cnt) +void lv_table_set_col_cnt(lv_obj_t * obj, uint32_t col_cnt) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -231,7 +231,7 @@ void lv_table_set_col_cnt(lv_obj_t * obj, uint16_t col_cnt) if(table->col_cnt == col_cnt) return; - uint16_t old_col_cnt = table->col_cnt; + uint32_t old_col_cnt = table->col_cnt; table->col_cnt = col_cnt; char ** new_cell_data = lv_malloc(table->row_cnt * table->col_cnt * sizeof(char *)); @@ -255,7 +255,7 @@ void lv_table_set_col_cnt(lv_obj_t * obj, uint16_t col_cnt) /*Free the old cells (only if the table becomes smaller)*/ int32_t i; - for(i = 0; i < (int32_t)old_col_cnt - col_cnt; i++) { + for(i = 0; i < (int32_t)old_col_cnt - (int32_t)col_cnt; i++) { uint32_t idx = old_col_start + min_col_cnt + i; lv_free(table->cell_data[idx]); table->cell_data[idx] = NULL; @@ -279,7 +279,7 @@ void lv_table_set_col_cnt(lv_obj_t * obj, uint16_t col_cnt) refr_size_form_row(obj, 0) ; } -void lv_table_set_col_width(lv_obj_t * obj, uint16_t col_id, lv_coord_t w) +void lv_table_set_col_width(lv_obj_t * obj, uint32_t col_id, lv_coord_t w) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -292,7 +292,7 @@ void lv_table_set_col_width(lv_obj_t * obj, uint16_t col_id, lv_coord_t w) refr_size_form_row(obj, 0); } -void lv_table_add_cell_ctrl(lv_obj_t * obj, uint16_t row, uint16_t col, lv_table_cell_ctrl_t ctrl) +void lv_table_add_cell_ctrl(lv_obj_t * obj, uint32_t row, uint32_t col, lv_table_cell_ctrl_t ctrl) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -316,7 +316,7 @@ void lv_table_add_cell_ctrl(lv_obj_t * obj, uint16_t row, uint16_t col, lv_table table->cell_data[cell][0] |= ctrl; } -void lv_table_clear_cell_ctrl(lv_obj_t * obj, uint16_t row, uint16_t col, lv_table_cell_ctrl_t ctrl) +void lv_table_clear_cell_ctrl(lv_obj_t * obj, uint32_t row, uint32_t col, lv_table_cell_ctrl_t ctrl) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -344,7 +344,7 @@ void lv_table_clear_cell_ctrl(lv_obj_t * obj, uint16_t row, uint16_t col, lv_tab * Getter functions *====================*/ -const char * lv_table_get_cell_value(lv_obj_t * obj, uint16_t row, uint16_t col) +const char * lv_table_get_cell_value(lv_obj_t * obj, uint32_t row, uint32_t col) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -360,7 +360,7 @@ const char * lv_table_get_cell_value(lv_obj_t * obj, uint16_t row, uint16_t col) return &table->cell_data[cell][1]; /*Skip the format byte*/ } -uint16_t lv_table_get_row_cnt(lv_obj_t * obj) +uint32_t lv_table_get_row_cnt(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -368,7 +368,7 @@ uint16_t lv_table_get_row_cnt(lv_obj_t * obj) return table->row_cnt; } -uint16_t lv_table_get_col_cnt(lv_obj_t * obj) +uint32_t lv_table_get_col_cnt(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -376,7 +376,7 @@ uint16_t lv_table_get_col_cnt(lv_obj_t * obj) return table->col_cnt; } -lv_coord_t lv_table_get_col_width(lv_obj_t * obj, uint16_t col) +lv_coord_t lv_table_get_col_width(lv_obj_t * obj, uint32_t col) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -390,7 +390,7 @@ lv_coord_t lv_table_get_col_width(lv_obj_t * obj, uint16_t col) return table->col_w[col]; } -bool lv_table_has_cell_ctrl(lv_obj_t * obj, uint16_t row, uint16_t col, lv_table_cell_ctrl_t ctrl) +bool lv_table_has_cell_ctrl(lv_obj_t * obj, uint32_t row, uint32_t col, lv_table_cell_ctrl_t ctrl) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -405,7 +405,7 @@ bool lv_table_has_cell_ctrl(lv_obj_t * obj, uint16_t row, uint16_t col, lv_table else return (table->cell_data[cell][0] & ctrl) == ctrl; } -void lv_table_get_selected_cell(lv_obj_t * obj, uint16_t * row, uint16_t * col) +void lv_table_get_selected_cell(lv_obj_t * obj, uint32_t * row, uint32_t * col) { lv_table_t * table = (lv_table_t *)obj; *row = table->row_act; @@ -440,7 +440,7 @@ static void lv_table_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) LV_UNUSED(class_p); lv_table_t * table = (lv_table_t *)obj; /*Free the cell texts*/ - uint16_t i; + uint32_t i; for(i = 0; i < table->col_cnt * table->row_cnt; i++) { if(table->cell_data[i]) { lv_free(table->cell_data[i]); @@ -483,8 +483,8 @@ static void lv_table_event(const lv_obj_class_t * class_p, lv_event_t * e) p->y = h - 1; } else if(code == LV_EVENT_PRESSED || code == LV_EVENT_PRESSING) { - uint16_t col; - uint16_t row; + uint32_t col; + uint32_t row; lv_result_t pr_res = get_pressed_cell(obj, &row, &col); if(pr_res == LV_RESULT_OK && (table->col_act != col || table->row_act != row)) { @@ -523,8 +523,8 @@ static void lv_table_event(const lv_obj_class_t * class_p, lv_event_t * e) return; } - if(col >= table->col_cnt) col = 0; - if(row >= table->row_cnt) row = 0; + if(col >= (int32_t)table->col_cnt) col = 0; + if(row >= (int32_t)table->row_cnt) row = 0; if(c == LV_KEY_LEFT) col--; else if(c == LV_KEY_RIGHT) col++; @@ -532,8 +532,8 @@ static void lv_table_event(const lv_obj_class_t * class_p, lv_event_t * e) else if(c == LV_KEY_DOWN) row++; else return; - if(col >= table->col_cnt) { - if(row < table->row_cnt - 1) { + if(col >= (int32_t)table->col_cnt) { + if(row < (int32_t)table->row_cnt - 1) { col = 0; row++; } @@ -551,14 +551,14 @@ static void lv_table_event(const lv_obj_class_t * class_p, lv_event_t * e) } } - if(row >= table->row_cnt) { + if(row >= (int32_t)table->row_cnt) { row = table->row_cnt - 1; } else if(row < 0) { row = 0; } - if(table->col_act != col || table->row_act != row) { + if((int32_t)table->col_act != col || (int32_t)table->row_act != row) { table->col_act = col; table->row_act = row; lv_obj_invalidate(obj); @@ -610,9 +610,9 @@ static void draw_main(lv_event_t * e) obj->state = state_ori; obj->skip_trans = 0; - uint16_t col; - uint16_t row; - uint16_t cell = 0; + uint32_t col; + uint32_t row; + uint32_t cell = 0; cell_area.y2 = obj->coords.y1 + bg_top - 1 - lv_obj_get_scroll_y(obj) + border_width; cell_area.x1 = 0; @@ -645,7 +645,7 @@ static void draw_main(lv_event_t * e) cell_area.x2 = cell_area.x1 + table->col_w[col] - 1; } - uint16_t col_merge = 0; + uint32_t col_merge = 0; for(col_merge = 0; col_merge + col < table->col_cnt - 1; col_merge++) { char * next_cell_data = table->cell_data[cell + col_merge]; @@ -826,7 +826,7 @@ static void refr_cell_size(lv_obj_t * obj, uint32_t row, uint32_t col) } } -static lv_coord_t get_row_height(lv_obj_t * obj, uint16_t row_id, const lv_font_t * font, +static lv_coord_t get_row_height(lv_obj_t * obj, uint32_t row_id, const lv_font_t * font, lv_coord_t letter_space, lv_coord_t line_space, lv_coord_t cell_left, lv_coord_t cell_right, lv_coord_t cell_top, lv_coord_t cell_bottom) { @@ -834,11 +834,11 @@ static lv_coord_t get_row_height(lv_obj_t * obj, uint16_t row_id, const lv_font_ lv_coord_t h_max = lv_font_get_line_height(font) + cell_top + cell_bottom; /* Calculate the cell_data index where to start */ - uint16_t row_start = row_id * table->col_cnt; + uint32_t row_start = row_id * table->col_cnt; /* Traverse the cells in the row_id row */ - uint16_t cell; - uint16_t col; + uint32_t cell; + uint32_t col; for(cell = row_start, col = 0; cell < row_start + table->col_cnt; cell++, col++) { char * cell_data = table->cell_data[cell]; @@ -851,7 +851,7 @@ static lv_coord_t get_row_height(lv_obj_t * obj, uint16_t row_id, const lv_font_ /* Traverse the current row from the first until the penultimate column. * Increment the text width if the cell has the LV_TABLE_CELL_CTRL_MERGE_RIGHT control, * exit the traversal when the current cell control is not LV_TABLE_CELL_CTRL_MERGE_RIGHT */ - uint16_t col_merge = 0; + uint32_t col_merge = 0; for(col_merge = 0; col_merge + col < table->col_cnt - 1; col_merge++) { char * next_cell_data = table->cell_data[cell + col_merge]; @@ -891,7 +891,7 @@ static lv_coord_t get_row_height(lv_obj_t * obj, uint16_t row_id, const lv_font_ return h_max; } -static lv_result_t get_pressed_cell(lv_obj_t * obj, uint16_t * row, uint16_t * col) +static lv_result_t get_pressed_cell(lv_obj_t * obj, uint32_t * row, uint32_t * col) { lv_table_t * table = (lv_table_t *)obj; @@ -968,7 +968,7 @@ static void copy_cell_txt(char * dst, const char * txt) #endif } -static void get_cell_area(lv_obj_t * obj, uint16_t row, uint16_t col, lv_area_t * area) +static void get_cell_area(lv_obj_t * obj, uint32_t row, uint32_t col, lv_area_t * area) { lv_table_t * table = (lv_table_t *)obj; diff --git a/src/widgets/table/lv_table.h b/src/widgets/table/lv_table.h index 1e5f90fa5..cb5b9fbd2 100644 --- a/src/widgets/table/lv_table.h +++ b/src/widgets/table/lv_table.h @@ -45,20 +45,20 @@ enum _lv_table_cell_ctrl_t { #ifdef DOXYGEN typedef _lv_table_cell_ctrl_t lv_table_cell_ctrl_t; #else -typedef uint8_t lv_table_cell_ctrl_t; +typedef uint32_t lv_table_cell_ctrl_t; #endif /*DOXYGEN*/ /*Data of table*/ typedef struct { lv_obj_t obj; - uint16_t col_cnt; - uint16_t row_cnt; + uint32_t col_cnt; + uint32_t row_cnt; char ** cell_data; lv_coord_t * row_h; lv_coord_t * col_w; - uint16_t col_act; - uint16_t row_act; + uint32_t col_act; + uint32_t row_act; } lv_table_t; extern const lv_obj_class_t lv_table_class; @@ -86,7 +86,7 @@ lv_obj_t * lv_table_create(lv_obj_t * parent); * @param txt text to display in the cell. It will be copied and saved so this variable is not required after this function call. * @note New roes/columns are added automatically if required */ -void lv_table_set_cell_value(lv_obj_t * obj, uint16_t row, uint16_t col, const char * txt); +void lv_table_set_cell_value(lv_obj_t * obj, uint32_t row, uint32_t col, const char * txt); /** * Set the value of a cell. Memory will be allocated to store the text by the table. @@ -96,7 +96,7 @@ void lv_table_set_cell_value(lv_obj_t * obj, uint16_t row, uint16_t col, const c * @param fmt `printf`-like format * @note New roes/columns are added automatically if required */ -void lv_table_set_cell_value_fmt(lv_obj_t * obj, uint16_t row, uint16_t col, const char * fmt, +void lv_table_set_cell_value_fmt(lv_obj_t * obj, uint32_t row, uint32_t col, const char * fmt, ...) LV_FORMAT_ATTRIBUTE(4, 5); /** @@ -104,14 +104,14 @@ void lv_table_set_cell_value_fmt(lv_obj_t * obj, uint16_t row, uint16_t col, con * @param obj table pointer to a Table object * @param row_cnt number of rows */ -void lv_table_set_row_cnt(lv_obj_t * obj, uint16_t row_cnt); +void lv_table_set_row_cnt(lv_obj_t * obj, uint32_t row_cnt); /** * Set the number of columns * @param obj table pointer to a Table object * @param col_cnt number of columns. */ -void lv_table_set_col_cnt(lv_obj_t * obj, uint16_t col_cnt); +void lv_table_set_col_cnt(lv_obj_t * obj, uint32_t col_cnt); /** * Set the width of a column @@ -119,7 +119,7 @@ void lv_table_set_col_cnt(lv_obj_t * obj, uint16_t col_cnt); * @param col_id id of the column [0 .. LV_TABLE_COL_MAX -1] * @param w width of the column */ -void lv_table_set_col_width(lv_obj_t * obj, uint16_t col_id, lv_coord_t w); +void lv_table_set_col_width(lv_obj_t * obj, uint32_t col_id, lv_coord_t w); /** * Add control bits to the cell. @@ -128,7 +128,7 @@ void lv_table_set_col_width(lv_obj_t * obj, uint16_t col_id, lv_coord_t w); * @param col id of the column [0 .. col_cnt -1] * @param ctrl OR-ed values from ::lv_table_cell_ctrl_t */ -void lv_table_add_cell_ctrl(lv_obj_t * obj, uint16_t row, uint16_t col, lv_table_cell_ctrl_t ctrl); +void lv_table_add_cell_ctrl(lv_obj_t * obj, uint32_t row, uint32_t col, lv_table_cell_ctrl_t ctrl); /** @@ -138,7 +138,7 @@ void lv_table_add_cell_ctrl(lv_obj_t * obj, uint16_t row, uint16_t col, lv_table * @param col id of the column [0 .. col_cnt -1] * @param ctrl OR-ed values from ::lv_table_cell_ctrl_t */ -void lv_table_clear_cell_ctrl(lv_obj_t * obj, uint16_t row, uint16_t col, lv_table_cell_ctrl_t ctrl); +void lv_table_clear_cell_ctrl(lv_obj_t * obj, uint32_t row, uint32_t col, lv_table_cell_ctrl_t ctrl); /*===================== * Getter functions @@ -151,21 +151,21 @@ void lv_table_clear_cell_ctrl(lv_obj_t * obj, uint16_t row, uint16_t col, lv_tab * @param col id of the column [0 .. col_cnt -1] * @return text in the cell */ -const char * lv_table_get_cell_value(lv_obj_t * obj, uint16_t row, uint16_t col); +const char * lv_table_get_cell_value(lv_obj_t * obj, uint32_t row, uint32_t col); /** * Get the number of rows. * @param obj table pointer to a Table object * @return number of rows. */ -uint16_t lv_table_get_row_cnt(lv_obj_t * obj); +uint32_t lv_table_get_row_cnt(lv_obj_t * obj); /** * Get the number of columns. * @param obj table pointer to a Table object * @return number of columns. */ -uint16_t lv_table_get_col_cnt(lv_obj_t * obj); +uint32_t lv_table_get_col_cnt(lv_obj_t * obj); /** * Get the width of a column @@ -173,7 +173,7 @@ uint16_t lv_table_get_col_cnt(lv_obj_t * obj); * @param col id of the column [0 .. LV_TABLE_COL_MAX -1] * @return width of the column */ -lv_coord_t lv_table_get_col_width(lv_obj_t * obj, uint16_t col); +lv_coord_t lv_table_get_col_width(lv_obj_t * obj, uint32_t col); /** * Get whether a cell has the control bits @@ -183,7 +183,7 @@ lv_coord_t lv_table_get_col_width(lv_obj_t * obj, uint16_t col); * @param ctrl OR-ed values from ::lv_table_cell_ctrl_t * @return true: all control bits are set; false: not all control bits are set */ -bool lv_table_has_cell_ctrl(lv_obj_t * obj, uint16_t row, uint16_t col, lv_table_cell_ctrl_t ctrl); +bool lv_table_has_cell_ctrl(lv_obj_t * obj, uint32_t row, uint32_t col, lv_table_cell_ctrl_t ctrl); /** * Get the selected cell (pressed and or focused) @@ -191,7 +191,7 @@ bool lv_table_has_cell_ctrl(lv_obj_t * obj, uint16_t row, uint16_t col, lv_table * @param row pointer to variable to store the selected row (LV_TABLE_CELL_NONE: if no cell selected) * @param col pointer to variable to store the selected column (LV_TABLE_CELL_NONE: if no cell selected) */ -void lv_table_get_selected_cell(lv_obj_t * obj, uint16_t * row, uint16_t * col); +void lv_table_get_selected_cell(lv_obj_t * obj, uint32_t * row, uint32_t * col); /********************** * MACROS diff --git a/src/widgets/tabview/lv_tabview.c b/src/widgets/tabview/lv_tabview.c index 3535c59dd..77d3d9a44 100644 --- a/src/widgets/tabview/lv_tabview.c +++ b/src/widgets/tabview/lv_tabview.c @@ -176,7 +176,7 @@ void lv_tabview_set_act(lv_obj_t * obj, uint32_t id, lv_anim_enable_t anim_en) tabview->tab_cur = id; } -uint16_t lv_tabview_get_tab_act(lv_obj_t * obj) +uint32_t lv_tabview_get_tab_act(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_tabview_t * tabview = (lv_tabview_t *)obj; @@ -334,7 +334,7 @@ static void cont_scroll_end_event_cb(lv_event_t * e) lv_point_t p; lv_obj_get_scroll_end(cont, &p); - lv_coord_t t; + int32_t t; if((tv_obj->tab_pos & LV_DIR_VER) != 0) { lv_coord_t w = lv_obj_get_content_width(cont); if(lv_obj_get_style_base_dir(tv, LV_PART_MAIN) == LV_BASE_DIR_RTL) t = -(p.x - w / 2) / w; @@ -347,7 +347,7 @@ static void cont_scroll_end_event_cb(lv_event_t * e) if(t < 0) t = 0; bool new_tab = false; - if(t != lv_tabview_get_tab_act(tv)) new_tab = true; + if(t != (int32_t)lv_tabview_get_tab_act(tv)) new_tab = true; /*If not scrolled by an indev set the tab immediately*/ diff --git a/src/widgets/tabview/lv_tabview.h b/src/widgets/tabview/lv_tabview.h index 9a5278870..f5a008132 100644 --- a/src/widgets/tabview/lv_tabview.h +++ b/src/widgets/tabview/lv_tabview.h @@ -28,8 +28,8 @@ extern "C" { typedef struct { lv_obj_t obj; char ** map; - uint16_t tab_cnt; - uint16_t tab_cur; + uint32_t tab_cnt; + uint32_t tab_cur; lv_dir_t tab_pos; } lv_tabview_t; @@ -50,7 +50,7 @@ lv_obj_t * lv_tabview_get_tab_buttons(lv_obj_t * tv); void lv_tabview_set_act(lv_obj_t * obj, uint32_t id, lv_anim_enable_t anim_en); -uint16_t lv_tabview_get_tab_act(lv_obj_t * tv); +uint32_t lv_tabview_get_tab_act(lv_obj_t * tv); /********************** * MACROS diff --git a/src/widgets/textarea/lv_textarea.c b/src/widgets/textarea/lv_textarea.c index 7f43329c0..c7870384f 100644 --- a/src/widgets/textarea/lv_textarea.c +++ b/src/widgets/textarea/lv_textarea.c @@ -527,7 +527,7 @@ void lv_textarea_set_text_selection(lv_obj_t * obj, bool en) #endif } -void lv_textarea_set_password_show_time(lv_obj_t * obj, uint16_t time) +void lv_textarea_set_password_show_time(lv_obj_t * obj, uint32_t time) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -691,7 +691,7 @@ bool lv_textarea_get_text_selection(lv_obj_t * obj) #endif } -uint16_t lv_textarea_get_password_show_time(lv_obj_t * obj) +uint32_t lv_textarea_get_password_show_time(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -1169,7 +1169,7 @@ static void update_cursor_position_on_click(lv_event_t * e) const lv_event_code_t code = lv_event_get_code(e); lv_coord_t label_width = lv_obj_get_width(ta->label); - uint16_t char_id_at_click = 0; + uint32_t char_id_at_click = 0; #if LV_LABEL_TEXT_SELECTION lv_label_t * label_data = (lv_label_t *)ta->label; diff --git a/src/widgets/textarea/lv_textarea.h b/src/widgets/textarea/lv_textarea.h index cbffa8c72..de480a02f 100644 --- a/src/widgets/textarea/lv_textarea.h +++ b/src/widgets/textarea/lv_textarea.h @@ -42,7 +42,7 @@ typedef struct { char * pwd_bullet; /*Replacement characters displayed in password mode*/ const char * accepted_chars; /*Only these characters will be accepted. NULL: accept all*/ uint32_t max_length; /*The max. number of characters. 0: no limit*/ - uint16_t pwd_show_time; /*Time to show characters in password mode before change them to '*'*/ + uint32_t pwd_show_time; /*Time to show characters in password mode before change them to '*'*/ struct { lv_coord_t valid_x; /*Used when stepping up/down to a shorter line. *(Used by the library)*/ @@ -201,7 +201,7 @@ void lv_textarea_set_text_selection(lv_obj_t * obj, bool en); * @param obj pointer to a text area object * @param time show time in milliseconds. 0: hide immediately. */ -void lv_textarea_set_password_show_time(lv_obj_t * obj, uint16_t time); +void lv_textarea_set_password_show_time(lv_obj_t * obj, uint32_t time); /** * Deprecated: use the normal text_align style property instead @@ -306,7 +306,7 @@ bool lv_textarea_get_text_selection(lv_obj_t * obj); * @param obj pointer to a text area object * @return show time in milliseconds. 0: hide immediately. */ -uint16_t lv_textarea_get_password_show_time(lv_obj_t * obj); +uint32_t lv_textarea_get_password_show_time(lv_obj_t * obj); /** * Get a the character from the current cursor position diff --git a/tests/src/test_cases/widgets/test_btnmatrix.c b/tests/src/test_cases/widgets/test_btnmatrix.c index 3cf318ae7..93e0fa74e 100644 --- a/tests/src/test_cases/widgets/test_btnmatrix.c +++ b/tests/src/test_cases/widgets/test_btnmatrix.c @@ -281,8 +281,6 @@ void test_button_matrix_get_button_text_works(void) static const char * btn_map[] = {"A", "B", "\n", "C", "D", ""}; lv_buttonmatrix_set_map(btnm, btn_map); - const char * lv_buttonmatrix_get_button_text(const lv_obj_t * obj, uint16_t btn_id); - TEST_ASSERT_EQUAL_STRING("A", lv_buttonmatrix_get_button_text(btnm, 0)); TEST_ASSERT_EQUAL_STRING("B", lv_buttonmatrix_get_button_text(btnm, 1)); TEST_ASSERT_EQUAL_STRING("C", lv_buttonmatrix_get_button_text(btnm, 2));