From 9254a7ea14bab122c4011fa8f411e452499eb425 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Mon, 15 Mar 2021 02:03:27 +0800 Subject: [PATCH] fix(comment): remove the space after /* and before */ --- docs/CODING_STYLE.md | 10 +- examples/arduino/LVGL_Arduino.ino | 48 ++--- examples/get_started/lv_example_get_started.h | 2 +- .../get_started/lv_example_get_started_3.c | 4 +- examples/layouts/flex/lv_example_flex.h | 2 +- examples/layouts/grid/lv_example_grid.h | 2 +- examples/layouts/grid/lv_example_grid_1.c | 4 +- examples/layouts/grid/lv_example_grid_2.c | 10 +- examples/layouts/grid/lv_example_grid_3.c | 16 +- examples/layouts/grid/lv_example_grid_4.c | 4 +- examples/layouts/grid/lv_example_grid_6.c | 4 +- examples/layouts/lv_example_layout.h | 2 +- examples/lv_examples.h | 2 +- examples/porting/lv_port_disp_template.c | 27 +-- examples/porting/lv_port_disp_template.h | 2 +- examples/porting/lv_port_fs_template.c | 50 ++--- examples/porting/lv_port_fs_template.h | 2 +- examples/porting/lv_port_indev_template.c | 41 ++-- examples/porting/lv_port_indev_template.h | 2 +- examples/scroll/lv_example_scroll.h | 2 +- examples/styles/lv_example_style.h | 2 +- examples/widgets/arc/lv_example_arc_2.c | 4 +- examples/widgets/bar/lv_example_bar_6.c | 2 +- examples/widgets/btn/lv_example_btn_3.c | 8 +- .../btnmatrix/lv_example_btnmatrix_2.c | 4 +- examples/widgets/canvas/lv_example_canvas_1.c | 4 +- examples/widgets/chart/lv_example_chart_2.c | 2 +- .../widgets/dropdown/lv_example_dropdown_3.c | 2 +- examples/widgets/img/lv_example_img_2.c | 4 +- examples/widgets/img/lv_example_img_3.c | 2 +- examples/widgets/imgbtn/lv_example_imgbtn_1.c | 2 +- examples/widgets/label/lv_example_label_2.c | 10 +- examples/widgets/lv_example_widgets.h | 2 +- examples/widgets/meter/lv_example_meter_1.c | 4 +- examples/widgets/meter/lv_example_meter_2.c | 2 +- examples/widgets/meter/lv_example_meter_3.c | 2 +- examples/widgets/meter/lv_example_meter_4.c | 2 +- examples/widgets/slider/lv_example_slider_1.c | 4 +- examples/widgets/slider/lv_example_slider_2.c | 2 +- examples/widgets/slider/lv_example_slider_3.c | 2 +- examples/widgets/table/lv_example_table_2.c | 2 +- .../widgets/textarea/lv_example_textarea_2.c | 14 +- .../widgets/textarea/lv_example_textarea_3.c | 4 +- lv_conf_template.h | 193 +++++++++--------- lvgl.h | 4 +- scripts/lv_conf_checker.py | 10 +- src/core/lv_disp.c | 2 +- src/core/lv_disp.h | 2 +- src/core/lv_group.c | 12 +- src/core/lv_group.h | 6 +- src/core/lv_indev.c | 26 +-- src/core/lv_indev.h | 2 +- src/core/lv_indev_scroll.c | 34 +-- src/core/lv_indev_scroll.h | 2 +- src/core/lv_obj.c | 24 +-- src/core/lv_obj.h | 92 ++++----- src/core/lv_obj_class.c | 6 +- src/core/lv_obj_class.h | 4 +- src/core/lv_obj_draw.c | 4 +- src/core/lv_obj_draw.h | 14 +- src/core/lv_obj_pos.c | 44 ++-- src/core/lv_obj_pos.h | 2 +- src/core/lv_obj_scroll.c | 10 +- src/core/lv_obj_scroll.h | 14 +- src/core/lv_obj_style.c | 30 +-- src/core/lv_obj_style.h | 4 +- src/core/lv_obj_tree.c | 6 +- src/core/lv_obj_tree.h | 2 +- src/core/lv_refr.c | 39 ++-- src/core/lv_refr.h | 2 +- src/core/lv_theme.h | 2 +- src/draw/lv_draw.h | 2 +- src/draw/lv_draw_arc.c | 4 +- src/draw/lv_draw_arc.h | 2 +- src/draw/lv_draw_blend.c | 50 ++--- src/draw/lv_draw_blend.h | 2 +- src/draw/lv_draw_img.c | 18 +- src/draw/lv_draw_img.h | 2 +- src/draw/lv_draw_label.c | 20 +- src/draw/lv_draw_label.h | 4 +- src/draw/lv_draw_line.c | 30 +-- src/draw/lv_draw_line.h | 2 +- src/draw/lv_draw_mask.c | 52 ++--- src/draw/lv_draw_mask.h | 18 +- src/draw/lv_draw_rect.c | 40 ++-- src/draw/lv_draw_rect.h | 4 +- src/draw/lv_draw_triangle.c | 5 +- src/draw/lv_draw_triangle.h | 2 +- src/draw/lv_img_buf.c | 84 ++++---- src/draw/lv_img_buf.h | 47 ++--- src/draw/lv_img_cache.c | 10 +- src/draw/lv_img_cache.h | 6 +- src/draw/lv_img_decoder.c | 18 +- src/draw/lv_img_decoder.h | 16 +- src/extra/layouts/flex/lv_flex.c | 10 +- src/extra/layouts/flex/lv_flex.h | 4 +- src/extra/layouts/grid/lv_grid.c | 6 +- src/extra/layouts/grid/lv_grid.h | 4 +- src/extra/layouts/lv_layouts.h | 2 +- src/extra/themes/default/lv_theme_default.c | 8 +- src/extra/themes/default/lv_theme_default.h | 2 +- src/extra/themes/lv_themes.h | 2 +- src/extra/widgets/calendar/lv_calendar.c | 4 +- src/extra/widgets/calendar/lv_calendar.h | 6 +- .../calendar/lv_calendar_header_arrow.h | 2 +- .../calendar/lv_calendar_header_dropdown.h | 2 +- src/extra/widgets/colorwheel/lv_colorwheel.c | 52 ++--- src/extra/widgets/colorwheel/lv_colorwheel.h | 2 +- src/extra/widgets/imgbtn/lv_imgbtn.c | 2 +- src/extra/widgets/imgbtn/lv_imgbtn.h | 2 +- src/extra/widgets/keyboard/lv_keyboard.c | 2 +- src/extra/widgets/keyboard/lv_keyboard.h | 6 +- src/extra/widgets/led/lv_led.h | 2 +- src/extra/widgets/list/lv_list.h | 2 +- src/extra/widgets/lv_widgets.h | 2 +- src/extra/widgets/msgbox/lv_msgbox.h | 2 +- src/extra/widgets/spinbox/lv_spinbox.c | 2 +- src/extra/widgets/spinbox/lv_spinbox.h | 4 +- src/extra/widgets/spinner/lv_spinner.h | 2 +- src/extra/widgets/tabview/lv_tabview.h | 2 +- src/extra/widgets/tileview/lv_tileview.h | 2 +- src/extra/widgets/win/lv_win.h | 2 +- src/font/lv_font.h | 10 +- src/font/lv_font_fmt_txt.c | 20 +- src/font/lv_font_fmt_txt.h | 30 +-- src/font/lv_font_loader.c | 14 +- src/font/lv_font_loader.h | 2 +- src/font/lv_symbol_def.h | 6 +- src/gpu/lv_gpu_nxp_pxp.c | 84 ++++---- src/gpu/lv_gpu_nxp_pxp.h | 22 +- src/gpu/lv_gpu_nxp_pxp_osa.c | 2 +- src/gpu/lv_gpu_nxp_pxp_osa.h | 4 +- src/gpu/lv_gpu_nxp_vglite.c | 32 +-- src/gpu/lv_gpu_nxp_vglite.h | 38 ++-- src/gpu/lv_gpu_stm32_dma2d.c | 30 +-- src/gpu/lv_gpu_stm32_dma2d.h | 2 +- src/hal/lv_hal.h | 2 +- src/hal/lv_hal_disp.c | 2 +- src/hal/lv_hal_disp.h | 48 ++--- src/hal/lv_hal_indev.c | 6 +- src/hal/lv_hal_indev.h | 46 ++--- src/hal/lv_hal_tick.c | 12 +- src/hal/lv_hal_tick.h | 2 +- src/lv_api_map.h | 2 +- src/lv_conf_internal.h | 76 +++---- src/lv_conf_kconfig.h | 5 +- src/lvgl.h | 2 +- src/misc/lv_anim.c | 20 +- src/misc/lv_anim.h | 6 +- src/misc/lv_area.c | 6 +- src/misc/lv_area.h | 8 +- src/misc/lv_assert.h | 2 +- src/misc/lv_async.c | 6 +- src/misc/lv_async.h | 2 +- src/misc/lv_bidi.c | 18 +- src/misc/lv_bidi.h | 6 +- src/misc/lv_color.c | 2 +- src/misc/lv_color.h | 37 ++-- src/misc/lv_fs.c | 5 +- src/misc/lv_fs.h | 6 +- src/misc/lv_gc.c | 2 +- src/misc/lv_gc.h | 8 +- src/misc/lv_ll.c | 8 +- src/misc/lv_ll.h | 2 +- src/misc/lv_log.h | 4 +- src/misc/lv_math.c | 5 +- src/misc/lv_math.h | 4 +- src/misc/lv_mem.c | 2 +- src/misc/lv_mem.h | 12 +- src/misc/lv_printf.h | 2 +- src/misc/lv_style.c | 2 +- src/misc/lv_style.h | 24 +-- src/misc/lv_templ.c | 4 +- src/misc/lv_templ.h | 2 +- src/misc/lv_timer.c | 6 +- src/misc/lv_timer.h | 12 +- src/misc/lv_txt.c | 71 +++---- src/misc/lv_txt.h | 12 +- src/misc/lv_txt_ap.c | 2 +- src/misc/lv_txt_ap.h | 2 +- src/misc/lv_types.h | 2 +- src/misc/lv_utils.h | 2 +- src/widgets/lv_arc.c | 14 +- src/widgets/lv_arc.h | 2 +- src/widgets/lv_bar.c | 18 +- src/widgets/lv_bar.h | 2 +- src/widgets/lv_btn.h | 2 +- src/widgets/lv_btnmatrix.c | 18 +- src/widgets/lv_btnmatrix.h | 26 +-- src/widgets/lv_canvas.c | 30 +-- src/widgets/lv_canvas.h | 2 +- src/widgets/lv_chart.c | 40 ++-- src/widgets/lv_chart.h | 4 +- src/widgets/lv_checkbox.c | 4 +- src/widgets/lv_checkbox.h | 2 +- src/widgets/lv_dropdown.c | 14 +- src/widgets/lv_dropdown.h | 4 +- src/widgets/lv_img.c | 24 +-- src/widgets/lv_img.h | 2 +- src/widgets/lv_label.c | 38 ++-- src/widgets/lv_label.h | 10 +- src/widgets/lv_line.c | 2 +- src/widgets/lv_line.h | 4 +- src/widgets/lv_meter.c | 8 +- src/widgets/lv_meter.h | 2 +- src/widgets/lv_objx_templ.c | 13 +- src/widgets/lv_objx_templ.h | 7 +- src/widgets/lv_roller.c | 24 +-- src/widgets/lv_roller.h | 8 +- src/widgets/lv_slider.c | 34 +-- src/widgets/lv_slider.h | 4 +- src/widgets/lv_switch.c | 4 +- src/widgets/lv_switch.h | 2 +- src/widgets/lv_table.c | 8 +- src/widgets/lv_table.h | 2 +- src/widgets/lv_textarea.c | 12 +- src/widgets/lv_textarea.h | 22 +- tests/lv_test_assert.c | 18 +- tests/lv_test_assert.h | 2 +- tests/lv_test_conf.h | 2 +- tests/lv_test_core/lv_test_core.h | 2 +- tests/lv_test_core/lv_test_font_loader.h | 2 +- tests/lv_test_core/lv_test_obj.h | 2 +- tests/lv_test_core/lv_test_style.h | 2 +- tests/lv_test_main.c | 12 +- tests/lv_test_widgets/lv_test_label.h | 2 +- 226 files changed, 1387 insertions(+), 1374 deletions(-) diff --git a/docs/CODING_STYLE.md b/docs/CODING_STYLE.md index 46bc63757..459ced616 100644 --- a/docs/CODING_STYLE.md +++ b/docs/CODING_STYLE.md @@ -44,14 +44,14 @@ Before every function have a comment like this: lv_obj_t * lv_obj_get_scr(lv_obj_t * obj); ``` -Always use `/* Something */` format and NOT `//Something` +Always use `/*Something*/` format and NOT `//Something` Write readable code to avoid descriptive comments like: -`x++; /* Add 1 to x */`. +`x++; /*Add 1 to x*/`. The code should show clearly what you are doing. You should write **why** have you done this: -`x++; /*Because of closing '\0' of the string */` +`x++; /*Because of closing '\0' of the string*/` Short "code summaries" of a few lines are accepted. E.g. `/*Calculate the new coordinates*/` @@ -66,7 +66,7 @@ Here is example to show bracket placing and using of white spaces: * @param text '\0' terminated character string. NULL to refresh with the current text. */ void lv_label_set_text(lv_obj_t * label, const char * text) -{ /* Main brackets of functions in new line*/ +{ /*Main brackets of functions in new line*/ if(label == NULL) return; /*No bracket only if the command is inline with the if statement*/ @@ -74,7 +74,7 @@ void lv_label_set_text(lv_obj_t * label, const char * text) lv_label_ext_t * ext = lv_obj_get_ext(label); - /*Comment before a section */ + /*Comment before a section*/ if(text == ext->txt || text == NULL) { /*Bracket of statements start inline*/ lv_label_refr_text(label); return; diff --git a/examples/arduino/LVGL_Arduino.ino b/examples/arduino/LVGL_Arduino.ino index d481dc08a..b58322528 100644 --- a/examples/arduino/LVGL_Arduino.ino +++ b/examples/arduino/LVGL_Arduino.ino @@ -1,25 +1,21 @@ #include #include -/* If you want to use the LVGL examples, - make sure to install the lv_examples Arduino library - and uncomment the following line. -#include */ +/*If you want to use the LVGL examples, + make sure to install the lv_examples Arduino library + and uncomment the following line. +#include */ -TFT_eSPI tft = TFT_eSPI(); /* TFT instance */ +TFT_eSPI tft = TFT_eSPI(); /*TFT instance*/ -/* Change to your screen resolution */ +/*Change to your screen resolution*/ static uint32_t screenWidth = 320; static uint32_t screenHeight = 240; -<<<<<<< HEAD -static lv_disp_buf_t disp_buf; -======= static lv_draw_buf_t draw_buf; ->>>>>>> xiaoxiang781216-disp static lv_color_t buf[screenWidth * 10]; #if LV_USE_LOG != 0 -/* Serial debugging */ +/*Serial debugging*/ void my_print(lv_log_level_t level, const char *file, uint32_t line, const char *fn_name, const char *dsc) { Serial.printf("%s(%s)@%d->%s\r\n", file, fn_name, line, dsc); @@ -27,7 +23,7 @@ void my_print(lv_log_level_t level, const char *file, uint32_t line, const char } #endif -/* Display flushing */ +/*Display flushing*/ void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p) { uint32_t w = (area->x2 - area->x1 + 1); @@ -69,49 +65,49 @@ bool my_touchpad_read(lv_indev_drv_t *indev_driver, lv_indev_data_t *data) void setup() { - Serial.begin(115200); /* prepare for possible serial debug */ + Serial.begin(115200); /*prepare for possible serial debug*/ lv_init(); #if LV_USE_LOG != 0 - lv_log_register_print_cb(my_print); /* register print function for debugging */ + lv_log_register_print_cb(my_print); /*register print function for debugging*/ #endif - tft.begin(); /* TFT init */ - tft.setRotation(1); /* Landscape orientation */ + tft.begin(); /*TFT init*/ + tft.setRotation(1); /*Landscape orientation*/ - /* Set the touchscreen calibration data, - the actual data for your display can be aquired using - the Generic -> Touch_calibrate example from the TFT_eSPI library */ + /*Set the touchscreen calibration data, + the actual data for your display can be aquired using + the Generic -> Touch_calibrate example from the TFT_eSPI library*/ uint16_t calData[5] = {275, 3620, 264, 3532, 1}; tft.setTouch(calData); lv_draw_buf_init(&draw_buf, buf, NULL, screenWidth * 10); - /* Initialize the display */ + /*Initialize the display*/ lv_disp_drv_t disp_drv; lv_disp_drv_init(&disp_drv); - /* Change the following line to your display resolution */ + /*Change the following line to your display resolution*/ disp_drv.hor_res = screenWidth; disp_drv.ver_res = screenHeight; disp_drv.flush_cb = my_disp_flush; disp_drv.draw_buf = &draw_buf; lv_disp_drv_register(&disp_drv); - /* Initialize the (dummy) input device driver */ + /*Initialize the (dummy) input device driver*/ lv_indev_drv_t indev_drv; lv_indev_drv_init(&indev_drv); indev_drv.type = LV_INDEV_TYPE_POINTER; indev_drv.read_cb = my_touchpad_read; lv_indev_drv_register(&indev_drv); - /* Try an example from the lv_examples Arduino library - make sure to include it as written above. - lv_example_btn_1(); */ + /*Try an example from the lv_examples Arduino library + make sure to include it as written above. + lv_example_btn_1();*/ } void loop() { - lv_timer_handler(); /* let the GUI do its work */ + lv_timer_handler(); /*let the GUI do its work*/ delay(5); } diff --git a/examples/get_started/lv_example_get_started.h b/examples/get_started/lv_example_get_started.h index 7c825069a..02a998c86 100644 --- a/examples/get_started/lv_example_get_started.h +++ b/examples/get_started/lv_example_get_started.h @@ -34,7 +34,7 @@ void lv_example_get_started_3(void); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_EX_GET_STARTED_H*/ diff --git a/examples/get_started/lv_example_get_started_3.c b/examples/get_started/lv_example_get_started_3.c index dbd7c41c6..f5494f8c4 100644 --- a/examples/get_started/lv_example_get_started_3.c +++ b/examples/get_started/lv_example_get_started_3.c @@ -17,13 +17,13 @@ static void slider_event_cb(lv_obj_t * slider, lv_event_t event) */ void lv_example_get_started_3(void) { - /* Create a slider in the center of the display */ + /*Create a slider in the center of the display*/ lv_obj_t * slider = lv_slider_create(lv_scr_act(), NULL); lv_obj_set_width(slider, 200); /*Set the width*/ lv_obj_align(slider, NULL, LV_ALIGN_CENTER, 0, 0); /*Align to the center of the parent (screen)*/ lv_obj_add_event_cb(slider, slider_event_cb, NULL); /*Assign an event function*/ - /* Create a label below the slider */ + /*Create a label below the slider*/ label = lv_label_create(lv_scr_act(), NULL); lv_label_set_text(label, "0"); lv_obj_align(label, slider, LV_ALIGN_OUT_TOP_MID, 0, -15); /*Align below the slider*/ diff --git a/examples/layouts/flex/lv_example_flex.h b/examples/layouts/flex/lv_example_flex.h index 615461d93..10fabbdc3 100644 --- a/examples/layouts/flex/lv_example_flex.h +++ b/examples/layouts/flex/lv_example_flex.h @@ -37,7 +37,7 @@ void lv_example_flex_6(void); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_EXAMPLE_FLEX_H*/ diff --git a/examples/layouts/grid/lv_example_grid.h b/examples/layouts/grid/lv_example_grid.h index ae7decbad..c0b8bae5e 100644 --- a/examples/layouts/grid/lv_example_grid.h +++ b/examples/layouts/grid/lv_example_grid.h @@ -37,7 +37,7 @@ void lv_example_grid_6(void); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_EXAMPLE_GRID_H*/ diff --git a/examples/layouts/grid/lv_example_grid_1.c b/examples/layouts/grid/lv_example_grid_1.c index b67125723..ba25135df 100644 --- a/examples/layouts/grid/lv_example_grid_1.c +++ b/examples/layouts/grid/lv_example_grid_1.c @@ -28,8 +28,8 @@ void lv_example_grid_1(void) uint8_t row = i / 3; obj = lv_obj_create(cont, NULL); - /* Stretch the cell horizontally and vertically too - * Set span to 1 to make the cell 1 column/row sized */ + /*Stretch the cell horizontally and vertically too + *Set span to 1 to make the cell 1 column/row sized*/ lv_obj_set_grid_cell(obj, LV_GRID_STRETCH, col, 1, LV_GRID_STRETCH, row, 1); diff --git a/examples/layouts/grid/lv_example_grid_2.c b/examples/layouts/grid/lv_example_grid_2.c index 5581c7aef..f3bec6007 100644 --- a/examples/layouts/grid/lv_example_grid_2.c +++ b/examples/layouts/grid/lv_example_grid_2.c @@ -23,7 +23,7 @@ void lv_example_grid_2(void) lv_obj_t * label; lv_obj_t * obj; - /*Cell to 0;0 and align to to the start (left/top) horizontally and vertically too */ + /*Cell to 0;0 and align to to the start (left/top) horizontally and vertically too*/ obj = lv_obj_create(cont, NULL); lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); lv_obj_set_grid_cell(obj, LV_GRID_START, 0, 1, @@ -31,7 +31,7 @@ void lv_example_grid_2(void) label = lv_label_create(obj, NULL); lv_label_set_text(label, "c0, r0"); - /*Cell to 1;0 and align to to the start (left) horizontally and center vertically too */ + /*Cell to 1;0 and align to to the start (left) horizontally and center vertically too*/ obj = lv_obj_create(cont, NULL); lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); lv_obj_set_grid_cell(obj, LV_GRID_START, 1, 1, @@ -39,7 +39,7 @@ void lv_example_grid_2(void) label = lv_label_create(obj, NULL); lv_label_set_text(label, "c1, r0"); - /*Cell to 2;0 and align to to the start (left) horizontally and end (bottom) vertically too */ + /*Cell to 2;0 and align to to the start (left) horizontally and end (bottom) vertically too*/ obj = lv_obj_create(cont, NULL); lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); lv_obj_set_grid_cell(obj, LV_GRID_START, 2, 1, @@ -47,7 +47,7 @@ void lv_example_grid_2(void) label = lv_label_create(obj, NULL); lv_label_set_text(label, "c2, r0"); - /*Cell to 1;1 but 2 column wide (span = 2).Set width and height to stretched. */ + /*Cell to 1;1 but 2 column wide (span = 2).Set width and height to stretched.*/ obj = lv_obj_create(cont, NULL); lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); lv_obj_set_grid_cell(obj, LV_GRID_STRETCH, 1, 2, @@ -55,7 +55,7 @@ void lv_example_grid_2(void) label = lv_label_create(obj, NULL); lv_label_set_text(label, "c1-2, r1"); - /*Cell to 0;1 but 2 rows tall (span = 2).Set width and height to stretched. */ + /*Cell to 0;1 but 2 rows tall (span = 2).Set width and height to stretched.*/ obj = lv_obj_create(cont, NULL); lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); lv_obj_set_grid_cell(obj, LV_GRID_STRETCH, 0, 1, diff --git a/examples/layouts/grid/lv_example_grid_3.c b/examples/layouts/grid/lv_example_grid_3.c index f7a411eb4..a7e686a0e 100644 --- a/examples/layouts/grid/lv_example_grid_3.c +++ b/examples/layouts/grid/lv_example_grid_3.c @@ -6,14 +6,14 @@ */ void lv_example_grid_3(void) { - /* Column 1: fix width 60 px - * Column 2: 1 unit from the remaining free space - * Column 3: 2 unit from the remaining free space */ + /*Column 1: fix width 60 px + *Column 2: 1 unit from the remaining free space + *Column 3: 2 unit from the remaining free space*/ static lv_coord_t col_dsc[3] = {60, LV_GRID_FR(1), LV_GRID_FR(2)}; - /* Row 1: fix width 60 px - * Row 2: 1 unit from the remaining free space - * Row 3: fix width 60 px */ + /*Row 1: fix width 60 px + *Row 2: 1 unit from the remaining free space + *Row 3: fix width 60 px*/ static lv_coord_t row_dsc[3] = {40, LV_GRID_FR(1), 40}; static lv_grid_t grid; @@ -34,8 +34,8 @@ void lv_example_grid_3(void) uint8_t row = i / 3; obj = lv_obj_create(cont, NULL); - /* Stretch the cell horizontally and vertically too - * Set span to 1 to make the cell 1 column/row sized */ + /*Stretch the cell horizontally and vertically too + *Set span to 1 to make the cell 1 column/row sized*/ lv_obj_set_grid_cell(obj, LV_GRID_STRETCH, col, 1, LV_GRID_STRETCH, row, 1); diff --git a/examples/layouts/grid/lv_example_grid_4.c b/examples/layouts/grid/lv_example_grid_4.c index b98b68a3e..0ce28a712 100644 --- a/examples/layouts/grid/lv_example_grid_4.c +++ b/examples/layouts/grid/lv_example_grid_4.c @@ -30,8 +30,8 @@ void lv_example_grid_4(void) uint8_t row = i / 3; obj = lv_obj_create(cont, NULL); - /* Stretch the cell horizontally and vertically too - * Set span to 1 to make the cell 1 column/row sized */ + /*Stretch the cell horizontally and vertically too + *Set span to 1 to make the cell 1 column/row sized*/ lv_obj_set_grid_cell(obj, LV_GRID_STRETCH, col, 1, LV_GRID_STRETCH, row, 1); diff --git a/examples/layouts/grid/lv_example_grid_6.c b/examples/layouts/grid/lv_example_grid_6.c index e6ec34448..ca8833775 100644 --- a/examples/layouts/grid/lv_example_grid_6.c +++ b/examples/layouts/grid/lv_example_grid_6.c @@ -29,8 +29,8 @@ void lv_example_grid_6(void) uint8_t row = i / 3; obj = lv_obj_create(cont, NULL); - /* Stretch the cell horizontally and vertically too - * Set span to 1 to make the cell 1 column/row sized */ + /*Stretch the cell horizontally and vertically too + *Set span to 1 to make the cell 1 column/row sized*/ lv_obj_set_grid_cell(obj, LV_GRID_STRETCH, col, 1, LV_GRID_STRETCH, row, 1); diff --git a/examples/layouts/lv_example_layout.h b/examples/layouts/lv_example_layout.h index c1fcfdcc9..2de368bc1 100644 --- a/examples/layouts/lv_example_layout.h +++ b/examples/layouts/lv_example_layout.h @@ -33,7 +33,7 @@ extern "C" { **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_EXAMPLE_LAYOUT_H*/ diff --git a/examples/lv_examples.h b/examples/lv_examples.h index fa51bc271..9f6e653ca 100644 --- a/examples/lv_examples.h +++ b/examples/lv_examples.h @@ -36,7 +36,7 @@ extern "C" { **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_EXAMPLES_H*/ diff --git a/examples/porting/lv_port_disp_template.c b/examples/porting/lv_port_disp_template.c index 449194f32..0294104cc 100644 --- a/examples/porting/lv_port_disp_template.c +++ b/examples/porting/lv_port_disp_template.c @@ -54,7 +54,8 @@ void lv_port_disp_init(void) * Create a buffer for drawing *----------------------------*/ - /* LVGL requires a buffer where it internally draws the widgets. + /** + * LVGL requires a buffer where it internally draws the widgets. * Later this buffer will passed your display drivers `flush_cb` to copy its content to your display. * The buffer has to be greater than 1 display row * @@ -72,7 +73,7 @@ void lv_port_disp_init(void) * Similar to 2) but the buffer have to be screen sized. When LVGL is ready it will give the * whole frame to display. This way you only need to change the frame buffer's address instead of * copying the pixels. - * */ + */ /* Example for 1) */ static lv_draw_buf_t draw_buf_dsc_1; @@ -123,15 +124,15 @@ void lv_port_disp_init(void) * STATIC FUNCTIONS **********************/ -/* Initialize your display and the required peripherals. */ +/*Initialize your display and the required peripherals.*/ static void disp_init(void) { /*You code here*/ } -/* Flush the content of the internal buffer the specific area on the display - * You can use DMA or any hardware acceleration to do this operation in the background but - * 'lv_disp_flush_ready()' has to be called when finished. */ +/*Flush the content of the internal buffer the specific area on the display + *You can use DMA or any hardware acceleration to do this operation in the background but + *'lv_disp_flush_ready()' has to be called when finished.*/ static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p) { /*The most simple case (but also the slowest) to put all pixels to the screen one-by-one*/ @@ -140,21 +141,21 @@ static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_colo int32_t y; for(y = area->y1; y <= area->y2; y++) { for(x = area->x1; x <= area->x2; x++) { - /* Put a pixel to the display. For example: */ - /* put_px(x, y, *color_p)*/ + /*Put a pixel to the display. For example:*/ + /*put_px(x, y, *color_p)*/ color_p++; } } - /* IMPORTANT!!! - * Inform the graphics library that you are ready with the flushing*/ + /*IMPORTANT!!! + *Inform the graphics library that you are ready with the flushing*/ lv_disp_flush_ready(disp_drv); } /*OPTIONAL: GPU INTERFACE*/ #if LV_USE_GPU -/* If your MCU has hardware accelerator (GPU) then you can use it to fill a memory with a color*/ +/*If your MCU has hardware accelerator (GPU) then you can use it to fill a memory with a color*/ static void gpu_fill(lv_disp_drv_t * disp_drv, lv_color_t * dest_buf, lv_coord_t dest_width, const lv_area_t * fill_area, lv_color_t color) { @@ -172,8 +173,8 @@ static void gpu_fill(lv_disp_drv_t * disp_drv, lv_color_t * dest_buf, lv_coord_t #endif /*LV_USE_GPU*/ -#else /* Enable this file at the top */ +#else /*Enable this file at the top*/ -/* This dummy typedef exists purely to silence -Wpedantic. */ +/*This dummy typedef exists purely to silence -Wpedantic.*/ typedef int keep_pedantic_happy; #endif diff --git a/examples/porting/lv_port_disp_template.h b/examples/porting/lv_port_disp_template.h index 93e51cc26..403b5d22f 100644 --- a/examples/porting/lv_port_disp_template.h +++ b/examples/porting/lv_port_disp_template.h @@ -35,7 +35,7 @@ extern "C" { **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_PORT_DISP_TEMPL_H*/ diff --git a/examples/porting/lv_port_fs_template.c b/examples/porting/lv_port_fs_template.c index c8f5fe21b..b73508bc1 100644 --- a/examples/porting/lv_port_fs_template.c +++ b/examples/porting/lv_port_fs_template.c @@ -19,17 +19,17 @@ * TYPEDEFS **********************/ -/* Create a type to store the required data about your file. - * If you are using a File System library - * it already should have a File type. - * For example FatFS has `FIL`. In this case use `typedef FIL file_t`*/ +/*Create a type to store the required data about your file. + *If you are using a File System library + *it already should have a File type. + *For example FatFS has `FIL`. In this case use `typedef FIL file_t`*/ typedef struct { /*Add the data you need to store about a file*/ uint32_t dummy1; uint32_t dummy2; }file_t; -/*Similarly to `file_t` create a type for directory reading too */ +/*Similarly to `file_t` create a type for directory reading too*/ typedef struct { /*Add the data you need to store about directory reading*/ uint32_t dummy1; @@ -83,7 +83,7 @@ void lv_port_fs_init(void) * Register the file system interface in LVGL *--------------------------------------------------*/ - /* Add a simple drive to open images */ + /*Add a simple drive to open images*/ lv_fs_drv_t fs_drv; lv_fs_drv_init(&fs_drv); @@ -114,7 +114,7 @@ void lv_port_fs_init(void) * STATIC FUNCTIONS **********************/ -/* Initialize your Storage device and File system. */ +/*Initialize your Storage device and File system.*/ static void fs_init(void) { /*E.g. for FatFS initialize the SD card and FatFS itself*/ @@ -138,19 +138,19 @@ static lv_fs_res_t fs_open (lv_fs_drv_t * drv, void * file_p, const char * path, { /*Open a file for write*/ - /* Add your code here*/ + /*Add your code here*/ } else if(mode == LV_FS_MODE_RD) { /*Open a file for read*/ - /* Add your code here*/ + /*Add your code here*/ } else if(mode == (LV_FS_MODE_WR | LV_FS_MODE_RD)) { /*Open a file for read and write*/ - /* Add your code here*/ + /*Add your code here*/ } return res; @@ -167,7 +167,7 @@ static lv_fs_res_t fs_close (lv_fs_drv_t * drv, void * file_p) { lv_fs_res_t res = LV_FS_RES_NOT_IMP; - /* Add your code here*/ + /*Add your code here*/ return res; } @@ -186,7 +186,7 @@ static lv_fs_res_t fs_read (lv_fs_drv_t * drv, void * file_p, void * buf, uint32 { lv_fs_res_t res = LV_FS_RES_NOT_IMP; - /* Add your code here*/ + /*Add your code here*/ return res; } @@ -204,7 +204,7 @@ static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf, { lv_fs_res_t res = LV_FS_RES_NOT_IMP; - /* Add your code here*/ + /*Add your code here*/ return res; } @@ -221,7 +221,7 @@ static lv_fs_res_t fs_seek (lv_fs_drv_t * drv, void * file_p, uint32_t pos) { lv_fs_res_t res = LV_FS_RES_NOT_IMP; - /* Add your code here*/ + /*Add your code here*/ return res; } @@ -237,7 +237,7 @@ static lv_fs_res_t fs_size (lv_fs_drv_t * drv, void * file_p, uint32_t * size_p) { lv_fs_res_t res = LV_FS_RES_NOT_IMP; - /* Add your code here*/ + /*Add your code here*/ return res; } @@ -253,7 +253,7 @@ static lv_fs_res_t fs_tell (lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p) { lv_fs_res_t res = LV_FS_RES_NOT_IMP; - /* Add your code here*/ + /*Add your code here*/ return res; } @@ -268,7 +268,7 @@ static lv_fs_res_t fs_remove (lv_fs_drv_t * drv, const char *path) { lv_fs_res_t res = LV_FS_RES_NOT_IMP; - /* Add your code here*/ + /*Add your code here*/ return res; } @@ -284,7 +284,7 @@ static lv_fs_res_t fs_trunc (lv_fs_drv_t * drv, void * file_p) { lv_fs_res_t res = LV_FS_RES_NOT_IMP; - /* Add your code here*/ + /*Add your code here*/ return res; } @@ -300,7 +300,7 @@ static lv_fs_res_t fs_rename (lv_fs_drv_t * drv, const char * oldname, const cha { lv_fs_res_t res = LV_FS_RES_NOT_IMP; - /* Add your code here*/ + /*Add your code here*/ return res; } @@ -317,7 +317,7 @@ static lv_fs_res_t fs_free (lv_fs_drv_t * drv, uint32_t * total_p, uint32_t * fr { lv_fs_res_t res = LV_FS_RES_NOT_IMP; - /* Add your code here*/ + /*Add your code here*/ return res; } @@ -333,7 +333,7 @@ static lv_fs_res_t fs_dir_open (lv_fs_drv_t * drv, void * rddir_p, const char *p { lv_fs_res_t res = LV_FS_RES_NOT_IMP; - /* Add your code here*/ + /*Add your code here*/ return res; } @@ -350,7 +350,7 @@ static lv_fs_res_t fs_dir_read (lv_fs_drv_t * drv, void * rddir_p, char *fn) { lv_fs_res_t res = LV_FS_RES_NOT_IMP; - /* Add your code here*/ + /*Add your code here*/ return res; } @@ -365,13 +365,13 @@ static lv_fs_res_t fs_dir_close (lv_fs_drv_t * drv, void * rddir_p) { lv_fs_res_t res = LV_FS_RES_NOT_IMP; - /* Add your code here*/ + /*Add your code here*/ return res; } -#else /* Enable this file at the top */ +#else /*Enable this file at the top*/ -/* This dummy typedef exists purely to silence -Wpedantic. */ +/*This dummy typedef exists purely to silence -Wpedantic.*/ typedef int keep_pedantic_happy; #endif diff --git a/examples/porting/lv_port_fs_template.h b/examples/porting/lv_port_fs_template.h index d18f736f6..4e60f1e52 100644 --- a/examples/porting/lv_port_fs_template.h +++ b/examples/porting/lv_port_fs_template.h @@ -35,7 +35,7 @@ extern "C" { **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_PORT_FS_TEMPL_H*/ diff --git a/examples/porting/lv_port_indev_template.c b/examples/porting/lv_port_indev_template.c index 98788da43..7a209d872 100644 --- a/examples/porting/lv_port_indev_template.c +++ b/examples/porting/lv_port_indev_template.c @@ -68,7 +68,8 @@ static lv_indev_state_t encoder_state; void lv_port_indev_init(void) { - /* Here you will find example implementation of input devices supported by LittelvGL: + /** + * Here you will find example implementation of input devices supported by LittelvGL: * - Touchpad * - Mouse (with cursor support) * - Keypad (supports GUI usage only with key) @@ -125,10 +126,10 @@ void lv_port_indev_init(void) indev_drv.read_cb = keypad_read; indev_keypad = lv_indev_drv_register(&indev_drv); - /* Later you should create group(s) with `lv_group_t * group = lv_group_create()`, - * add objects to the group with `lv_group_add_obj(group, obj)` - * and assign this input device to group to navigate in it: - * `lv_indev_set_group(indev_keypad, group);` */ + /*Later you should create group(s) with `lv_group_t * group = lv_group_create()`, + *add objects to the group with `lv_group_add_obj(group, obj)` + *and assign this input device to group to navigate in it: + *`lv_indev_set_group(indev_keypad, group);`*/ /*------------------ * Encoder @@ -143,10 +144,10 @@ void lv_port_indev_init(void) indev_drv.read_cb = encoder_read; indev_encoder = lv_indev_drv_register(&indev_drv); - /* Later you should create group(s) with `lv_group_t * group = lv_group_create()`, - * add objects to the group with `lv_group_add_obj(group, obj)` - * and assign this input device to group to navigate in it: - * `lv_indev_set_group(indev_encoder, group);` */ + /*Later you should create group(s) with `lv_group_t * group = lv_group_create()`, + *add objects to the group with `lv_group_add_obj(group, obj)` + *and assign this input device to group to navigate in it: + *`lv_indev_set_group(indev_encoder, group);`*/ /*------------------ * Button @@ -183,7 +184,7 @@ static void touchpad_init(void) /*Your code comes here*/ } -/* Will be called by the library to read the touchpad */ +/*Will be called by the library to read the touchpad*/ static bool touchpad_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data) { static lv_coord_t last_x = 0; @@ -226,13 +227,13 @@ static void touchpad_get_xy(lv_coord_t * x, lv_coord_t * y) * Mouse * -----------------*/ -/* Initialize your mouse */ +/*Initialize your mouse*/ static void mouse_init(void) { /*Your code comes here*/ } -/* Will be called by the library to read the mouse */ +/*Will be called by the library to read the mouse*/ static bool mouse_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data) { /*Get the current x and y coordinates*/ @@ -270,13 +271,13 @@ static void mouse_get_xy(lv_coord_t * x, lv_coord_t * y) * Keypad * -----------------*/ -/* Initialize your keypad */ +/*Initialize your keypad*/ static void keypad_init(void) { /*Your code comes here*/ } -/* Will be called by the library to read the mouse */ +/*Will be called by the library to read the mouse*/ static bool keypad_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data) { static uint32_t last_key = 0; @@ -331,13 +332,13 @@ static uint32_t keypad_get_key(void) * Encoder * -----------------*/ -/* Initialize your keypad */ +/*Initialize your keypad*/ static void encoder_init(void) { /*Your code comes here*/ } -/* Will be called by the library to read the encoder */ +/*Will be called by the library to read the encoder*/ static bool encoder_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data) { @@ -361,13 +362,13 @@ static void encoder_handler(void) * Button * -----------------*/ -/* Initialize your buttons */ +/*Initialize your buttons*/ static void button_init(void) { /*Your code comes here*/ } -/* Will be called by the library to read the button */ +/*Will be called by the library to read the button*/ static bool button_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data) { @@ -416,8 +417,8 @@ static bool button_is_pressed(uint8_t id) return false; } -#else /* Enable this file at the top */ +#else /*Enable this file at the top*/ -/* This dummy typedef exists purely to silence -Wpedantic. */ +/*This dummy typedef exists purely to silence -Wpedantic.*/ typedef int keep_pedantic_happy; #endif diff --git a/examples/porting/lv_port_indev_template.h b/examples/porting/lv_port_indev_template.h index b235d3093..009a7bce7 100644 --- a/examples/porting/lv_port_indev_template.h +++ b/examples/porting/lv_port_indev_template.h @@ -36,7 +36,7 @@ extern "C" { **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_PORT_INDEV_TEMPL_H*/ diff --git a/examples/scroll/lv_example_scroll.h b/examples/scroll/lv_example_scroll.h index c4691a6ee..ea8ae23c6 100644 --- a/examples/scroll/lv_example_scroll.h +++ b/examples/scroll/lv_example_scroll.h @@ -34,7 +34,7 @@ void lv_example_scroll_3(void); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_EXAMPLE_SCROLL_H*/ diff --git a/examples/styles/lv_example_style.h b/examples/styles/lv_example_style.h index d79b75f4b..d2fe3493e 100644 --- a/examples/styles/lv_example_style.h +++ b/examples/styles/lv_example_style.h @@ -42,7 +42,7 @@ void lv_example_style_11(void); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_EXAMPLE_STYLE_H*/ diff --git a/examples/widgets/arc/lv_example_arc_2.c b/examples/widgets/arc/lv_example_arc_2.c index 89046207c..674d771b6 100644 --- a/examples/widgets/arc/lv_example_arc_2.c +++ b/examples/widgets/arc/lv_example_arc_2.c @@ -31,8 +31,8 @@ void lv_example_arc_2(void) lv_arc_set_angles(arc, 270, 270); lv_obj_align(arc, NULL, LV_ALIGN_CENTER, 0, 0); - /* Create an `lv_timer` to update the arc. - * Store the `arc` in the user data*/ + /*Create an `lv_timer` to update the arc. + *Store the `arc` in the user data*/ lv_timer_create(arc_loader, 20, arc); } diff --git a/examples/widgets/bar/lv_example_bar_6.c b/examples/widgets/bar/lv_example_bar_6.c index ba442b905..47e9922ec 100644 --- a/examples/widgets/bar/lv_example_bar_6.c +++ b/examples/widgets/bar/lv_example_bar_6.c @@ -28,7 +28,7 @@ static void event_cb(lv_obj_t * obj, lv_event_t e) txt_area.x1 = txt_area.x2 - txt_size.x + 1; dsc.color = lv_color_white(); } - /*If the indicator is still short put the text out of it on the right */ + /*If the indicator is still short put the text out of it on the right*/ else { txt_area.x1 = bar->indic_area.x2 + 5; txt_area.x2 = txt_area.x1 + txt_size.x - 1; diff --git a/examples/widgets/btn/lv_example_btn_3.c b/examples/widgets/btn/lv_example_btn_3.c index 5e8755b27..295fd5c44 100644 --- a/examples/widgets/btn/lv_example_btn_3.c +++ b/examples/widgets/btn/lv_example_btn_3.c @@ -22,13 +22,13 @@ void lv_example_btn_3(void) lv_anim_path_set_cb(&path_overshoot, lv_anim_path_overshoot); - /* Transition descriptor when going back to the default state. - * Add some delay to be sure the press transition is visible even if the press was very short*/ + /*Transition descriptor when going back to the default state. + *Add some delay to be sure the press transition is visible even if the press was very short*/ static lv_style_transition_dsc_t transition_dsc_def; lv_style_transition_dsc_init(&transition_dsc_def, props, &path_overshoot, 250, 100); - /* Transition descriptor when going to pressed state. - * No delay, go to presses state immediately*/ + /*Transition descriptor when going to pressed state. + *No delay, go to presses state immediately*/ static lv_style_transition_dsc_t transition_dsc_pr; lv_style_transition_dsc_init(&transition_dsc_pr, props, &path_ease_in_out, 250, 0); diff --git a/examples/widgets/btnmatrix/lv_example_btnmatrix_2.c b/examples/widgets/btnmatrix/lv_example_btnmatrix_2.c index a5cc4baa2..1852a15d4 100644 --- a/examples/widgets/btnmatrix/lv_example_btnmatrix_2.c +++ b/examples/widgets/btnmatrix/lv_example_btnmatrix_2.c @@ -7,7 +7,7 @@ static void event_cb(lv_obj_t * obj, lv_event_t e) if(e == LV_EVENT_DRAW_PART_BEGIN) { lv_obj_draw_dsc_t * dsc = lv_event_get_param(); - /*Change the draw descriptor the 2nd button */ + /*Change the draw descriptor the 2nd button*/ if(dsc->id == 1) { dsc->rect_dsc->radius = 0; if(lv_btnmatrix_get_selected_btn(obj) == dsc->id) dsc->rect_dsc->bg_color = lv_color_blue_darken_3(); @@ -18,7 +18,7 @@ static void event_cb(lv_obj_t * obj, lv_event_t e) dsc->rect_dsc->shadow_ofs_y = 3; dsc->label_dsc->color = lv_color_white(); } - /*Change the draw descriptor the 3rd button */ + /*Change the draw descriptor the 3rd button*/ else if(dsc->id == 2) { dsc->rect_dsc->radius = LV_RADIUS_CIRCLE; if(lv_btnmatrix_get_selected_btn(obj) == dsc->id) dsc->rect_dsc->bg_color = lv_color_red_darken_3(); diff --git a/examples/widgets/canvas/lv_example_canvas_1.c b/examples/widgets/canvas/lv_example_canvas_1.c index ce01b8f65..0802c5212 100644 --- a/examples/widgets/canvas/lv_example_canvas_1.c +++ b/examples/widgets/canvas/lv_example_canvas_1.c @@ -36,8 +36,8 @@ void lv_example_canvas_1(void) lv_canvas_draw_text(canvas, 40, 20, 100, &label_dsc, "Some text on text canvas"); - /* Test the rotation. It requires an other buffer where the orignal image is stored. - * So copy the current image to buffer and rotate it to the canvas */ + /*Test the rotation. It requires an other buffer where the orignal image is stored. + *So copy the current image to buffer and rotate it to the canvas*/ static lv_color_t cbuf_tmp[CANVAS_WIDTH * CANVAS_HEIGHT]; memcpy(cbuf_tmp, cbuf, sizeof(cbuf_tmp)); lv_img_dsc_t img; diff --git a/examples/widgets/chart/lv_example_chart_2.c b/examples/widgets/chart/lv_example_chart_2.c index b5985ed05..66986fefe 100644 --- a/examples/widgets/chart/lv_example_chart_2.c +++ b/examples/widgets/chart/lv_example_chart_2.c @@ -7,7 +7,7 @@ static lv_chart_series_t * ser2; static void event_cb(lv_obj_t * obj, lv_event_t e) { - /*Add the faded area before the lines are drawn */ + /*Add the faded area before the lines are drawn*/ if(e == LV_EVENT_DRAW_PART_BEGIN) { lv_obj_draw_dsc_t * dsc = lv_event_get_param(); if(dsc->part != LV_PART_ITEMS) return; diff --git a/examples/widgets/dropdown/lv_example_dropdown_3.c b/examples/widgets/dropdown/lv_example_dropdown_3.c index 787c63f84..6e13e7789 100644 --- a/examples/widgets/dropdown/lv_example_dropdown_3.c +++ b/examples/widgets/dropdown/lv_example_dropdown_3.c @@ -33,7 +33,7 @@ void lv_example_dropdown_3(void) lv_dropdown_set_symbol(dropdown, &img_caret_down); lv_obj_set_style_transform_angle(dropdown, LV_PART_MAIN, LV_STATE_CHECKED, 1800); - /* In a menu we don't need to show the last clicked item*/ + /*In a menu we don't need to show the last clicked item*/ lv_dropdown_set_selected_highlight(dropdown, false); lv_obj_add_event_cb(dropdown, event_cb, NULL); diff --git a/examples/widgets/img/lv_example_img_2.c b/examples/widgets/img/lv_example_img_2.c index 8b56a2821..4ec2f678d 100644 --- a/examples/widgets/img/lv_example_img_2.c +++ b/examples/widgets/img/lv_example_img_2.c @@ -29,7 +29,7 @@ void lv_example_img_2(void) lv_obj_align(blue_slider, green_slider, LV_ALIGN_OUT_RIGHT_MID, 25, 0); lv_obj_align(intense_slider, blue_slider, LV_ALIGN_OUT_RIGHT_MID, 25, 0); - /* Now create the actual image */ + /*Now create the actual image*/ LV_IMG_DECLARE(img_cogwheel_argb) img1 = lv_img_create(lv_scr_act(), NULL); lv_img_set_src(img1, &img_cogwheel_argb); @@ -43,7 +43,7 @@ static void slider_event_cb(lv_obj_t * slider, lv_event_t event) LV_UNUSED(slider); if(event == LV_EVENT_VALUE_CHANGED) { - /* Recolor the image based on the sliders' values */ + /*Recolor the image based on the sliders' values*/ lv_color_t color = lv_color_make(lv_slider_get_value(red_slider), lv_slider_get_value(green_slider), lv_slider_get_value(blue_slider)); lv_opa_t intense = lv_slider_get_value(intense_slider); lv_obj_set_style_img_recolor_opa(img1, LV_PART_MAIN, LV_STATE_DEFAULT, intense); diff --git a/examples/widgets/img/lv_example_img_3.c b/examples/widgets/img/lv_example_img_3.c index 62c7a2093..d4fa853b8 100644 --- a/examples/widgets/img/lv_example_img_3.c +++ b/examples/widgets/img/lv_example_img_3.c @@ -19,7 +19,7 @@ void lv_example_img_3(void) { LV_IMG_DECLARE(img_cogwheel_argb); - /* Now create the actual image */ + /*Now create the actual image*/ lv_obj_t * img = lv_img_create(lv_scr_act(), NULL); lv_img_set_src(img, &img_cogwheel_argb); lv_obj_align(img, NULL, LV_ALIGN_CENTER, 50, 50); diff --git a/examples/widgets/imgbtn/lv_example_imgbtn_1.c b/examples/widgets/imgbtn/lv_example_imgbtn_1.c index 0771f5ede..aec29aa27 100644 --- a/examples/widgets/imgbtn/lv_example_imgbtn_1.c +++ b/examples/widgets/imgbtn/lv_example_imgbtn_1.c @@ -7,7 +7,7 @@ void lv_example_imgbtn_1(void) LV_IMG_DECLARE(imgbtn_right); LV_IMG_DECLARE(imgbtn_mid); - /* Create a transition animation on width transformation and recolor.*/ + /*Create a transition animation on width transformation and recolor.*/ static lv_style_prop_t tr_prop[] = {LV_STYLE_TRANSFORM_WIDTH, LV_STYLE_IMG_RECOLOR_OPA, 0}; static lv_style_transition_dsc_t tr; lv_style_transition_dsc_init(&tr, tr_prop, &lv_anim_path_def, 200, 0); diff --git a/examples/widgets/label/lv_example_label_2.c b/examples/widgets/label/lv_example_label_2.c index d539d765f..ccfa84a16 100644 --- a/examples/widgets/label/lv_example_label_2.c +++ b/examples/widgets/label/lv_example_label_2.c @@ -6,17 +6,17 @@ */ void lv_example_label_2(void) { - /* Create a style for the shadow*/ + /*Create a style for the shadow*/ static lv_style_t style_shadow; lv_style_init(&style_shadow); lv_style_set_text_opa(&style_shadow, LV_OPA_30); lv_style_set_text_color(&style_shadow, lv_color_black()); - /*Create a label for the shadow first (it's in the background) */ + /*Create a label for the shadow first (it's in the background)*/ lv_obj_t * shadow_label = lv_label_create(lv_scr_act(), NULL); lv_obj_add_style(shadow_label, LV_PART_MAIN, LV_STATE_DEFAULT, &style_shadow); - /* Create the main label */ + /*Create the main label*/ lv_obj_t * main_label = lv_label_create(lv_scr_act(), NULL); lv_label_set_text(main_label, "A simple method to create\n" "shadows on a text.\n" @@ -26,10 +26,10 @@ void lv_example_label_2(void) /*Set the same text for the shadow label*/ lv_label_set_text(shadow_label, lv_label_get_text(main_label)); - /* Position the main label */ + /*Position the main label*/ lv_obj_align(main_label, NULL, LV_ALIGN_CENTER, 0, 0); - /* Shift the second label down and to the right by 2 pixel */ + /*Shift the second label down and to the right by 2 pixel*/ lv_obj_align(shadow_label, main_label, LV_ALIGN_IN_TOP_LEFT, 2, 2); } diff --git a/examples/widgets/lv_example_widgets.h b/examples/widgets/lv_example_widgets.h index 8508af45d..5ca8f01d6 100644 --- a/examples/widgets/lv_example_widgets.h +++ b/examples/widgets/lv_example_widgets.h @@ -121,7 +121,7 @@ void lv_example_win_1(void); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_EX_WIDGETS_H*/ diff --git a/examples/widgets/meter/lv_example_meter_1.c b/examples/widgets/meter/lv_example_meter_1.c index 9b65d3189..49aa01653 100644 --- a/examples/widgets/meter/lv_example_meter_1.c +++ b/examples/widgets/meter/lv_example_meter_1.c @@ -23,7 +23,7 @@ void lv_example_meter_1(void) lv_meter_indicator_t * indic; - /*Add a blue arc to the start */ + /*Add a blue arc to the start*/ indic = lv_meter_add_arc(meter, scale, 3, lv_color_blue(), 0); lv_meter_set_indicator_start_value(meter, indic, 0); lv_meter_set_indicator_end_value(meter, indic, 20); @@ -33,7 +33,7 @@ void lv_example_meter_1(void) lv_meter_set_indicator_start_value(meter, indic, 0); lv_meter_set_indicator_end_value(meter, indic, 20); - /*Add a red arc to the end */ + /*Add a red arc to the end*/ indic = lv_meter_add_arc(meter, scale, 3, lv_color_red(), 0); lv_meter_set_indicator_start_value(meter, indic, 80); lv_meter_set_indicator_end_value(meter, indic, 100); diff --git a/examples/widgets/meter/lv_example_meter_2.c b/examples/widgets/meter/lv_example_meter_2.c index d1a0ce592..aa73fefea 100644 --- a/examples/widgets/meter/lv_example_meter_2.c +++ b/examples/widgets/meter/lv_example_meter_2.c @@ -26,7 +26,7 @@ void lv_example_meter_2(void) lv_meter_set_scale_major_ticks(meter, scale, 1, 2, 30, lv_color_hex3(0xeee), 10); lv_meter_set_scale_range(meter, scale, 0, 100, 270, 90); - /*Add a three arc indicator */ + /*Add a three arc indicator*/ lv_meter_indicator_t * indic1 = lv_meter_add_arc(meter, scale, 10, lv_color_red(), 0); lv_meter_indicator_t * indic2 = lv_meter_add_arc(meter, scale, 10, lv_color_green(), -10); lv_meter_indicator_t * indic3 = lv_meter_add_arc(meter, scale, 10, lv_color_blue(), -20); diff --git a/examples/widgets/meter/lv_example_meter_3.c b/examples/widgets/meter/lv_example_meter_3.c index 3a889b3a6..a679e37ac 100644 --- a/examples/widgets/meter/lv_example_meter_3.c +++ b/examples/widgets/meter/lv_example_meter_3.c @@ -31,7 +31,7 @@ void lv_example_meter_3(void) LV_IMG_DECLARE(img_hand) - /*Add a the hands from images */ + /*Add a the hands from images*/ lv_meter_indicator_t * indic_min = lv_meter_add_needle_img(meter, scale_min, &img_hand, 5, 5); lv_meter_indicator_t * indic_hour = lv_meter_add_needle_img(meter, scale_min, &img_hand, 5, 5); diff --git a/examples/widgets/meter/lv_example_meter_4.c b/examples/widgets/meter/lv_example_meter_4.c index 6c5bf0aa8..c51b8b33a 100644 --- a/examples/widgets/meter/lv_example_meter_4.c +++ b/examples/widgets/meter/lv_example_meter_4.c @@ -18,7 +18,7 @@ void lv_example_meter_4(void) lv_meter_set_scale_ticks(meter, scale, 0, 0, 0, lv_color_black()); lv_meter_set_scale_range(meter, scale, 0, 100, 360, 0); - /*Add a three arc indicator */ + /*Add a three arc indicator*/ lv_coord_t indic_w = lv_obj_get_width(meter) / 2; lv_meter_indicator_t * indic1 = lv_meter_add_arc(meter, scale, indic_w, lv_color_orange(), 0); lv_meter_set_indicator_start_value(meter, indic1, 0); diff --git a/examples/widgets/slider/lv_example_slider_1.c b/examples/widgets/slider/lv_example_slider_1.c index b8b17634e..d1a2c6b0b 100644 --- a/examples/widgets/slider/lv_example_slider_1.c +++ b/examples/widgets/slider/lv_example_slider_1.c @@ -9,12 +9,12 @@ static lv_obj_t * slider_label; */ void lv_example_slider_1(void) { - /* Create a slider in the center of the display */ + /*Create a slider in the center of the display*/ lv_obj_t * slider = lv_slider_create(lv_scr_act(), NULL); lv_obj_align(slider, NULL, LV_ALIGN_CENTER, 0, 0); lv_obj_add_event_cb(slider, slider_event_cb, NULL); - /* Create a label below the slider */ + /*Create a label below the slider*/ slider_label = lv_label_create(lv_scr_act(), NULL); lv_label_set_text(slider_label, "0%"); diff --git a/examples/widgets/slider/lv_example_slider_2.c b/examples/widgets/slider/lv_example_slider_2.c index 28cfac723..92cd604a5 100644 --- a/examples/widgets/slider/lv_example_slider_2.c +++ b/examples/widgets/slider/lv_example_slider_2.c @@ -19,7 +19,7 @@ void lv_example_slider_2(void) lv_style_set_content_opa(&style_pr, LV_OPA_COVER); lv_style_set_content_ofs_y(&style_pr, -15); - /* Create a slider in the center of the display */ + /*Create a slider in the center of the display*/ lv_obj_t * slider; slider = lv_slider_create(lv_scr_act(), NULL); lv_obj_align(slider, NULL, LV_ALIGN_CENTER, 0, 0); diff --git a/examples/widgets/slider/lv_example_slider_3.c b/examples/widgets/slider/lv_example_slider_3.c index 009c6f1cd..aeb3e3e1b 100644 --- a/examples/widgets/slider/lv_example_slider_3.c +++ b/examples/widgets/slider/lv_example_slider_3.c @@ -9,7 +9,7 @@ static void slider_event_cb(lv_obj_t * slider, lv_event_t event); */ void lv_example_slider_3(void) { - /* Create a slider in the center of the display */ + /*Create a slider in the center of the display*/ lv_obj_t * slider; slider = lv_slider_create(lv_scr_act(), NULL); lv_obj_align(slider, NULL, LV_ALIGN_CENTER, 0, 0); diff --git a/examples/widgets/table/lv_example_table_2.c b/examples/widgets/table/lv_example_table_2.c index 7779be072..de342a7d3 100644 --- a/examples/widgets/table/lv_example_table_2.c +++ b/examples/widgets/table/lv_example_table_2.c @@ -64,7 +64,7 @@ void lv_example_table_2(void) lv_obj_set_size(table, 150, 200); lv_table_set_col_width(table, 0, 150); - lv_table_set_row_cnt(table, ITEM_CNT); /*Not required but avoids a lot of memory reallocation lv_table_set_set_value */ + lv_table_set_row_cnt(table, ITEM_CNT); /*Not required but avoids a lot of memory reallocation lv_table_set_set_value*/ lv_table_set_col_cnt(table, 1); /*Don't make the cell pressed, we will draw something different in the event*/ diff --git a/examples/widgets/textarea/lv_example_textarea_2.c b/examples/widgets/textarea/lv_example_textarea_2.c index e8ba9ecf9..fae2f5eac 100644 --- a/examples/widgets/textarea/lv_example_textarea_2.c +++ b/examples/widgets/textarea/lv_example_textarea_2.c @@ -7,7 +7,7 @@ static lv_obj_t * kb; void lv_example_textarea_2(void) { - /* Create the password box */ + /*Create the password box*/ lv_obj_t * pwd_ta = lv_textarea_create(lv_scr_act(), NULL); lv_textarea_set_text(pwd_ta, ""); lv_textarea_set_password_mode(pwd_ta, true); @@ -16,33 +16,33 @@ void lv_example_textarea_2(void) lv_obj_set_pos(pwd_ta, 5, 20); lv_obj_add_event_cb(pwd_ta, ta_event_cb, NULL); - /* Create a label and position it above the text box */ + /*Create a label and position it above the text box*/ lv_obj_t * pwd_label = lv_label_create(lv_scr_act(), NULL); lv_label_set_text(pwd_label, "Password:"); lv_obj_align(pwd_label, pwd_ta, LV_ALIGN_OUT_TOP_LEFT, 0, 0); - /* Create the one-line mode text area */ + /*Create the one-line mode text area*/ lv_obj_t * oneline_ta = lv_textarea_create(lv_scr_act(), pwd_ta); lv_textarea_set_password_mode(oneline_ta, false); lv_obj_align(oneline_ta, NULL, LV_ALIGN_IN_TOP_RIGHT, -5, 20); - /* Create a label and position it above the text box */ + /*Create a label and position it above the text box*/ lv_obj_t * oneline_label = lv_label_create(lv_scr_act(), NULL); lv_label_set_text(oneline_label, "Text:"); lv_obj_align(oneline_label, oneline_ta, LV_ALIGN_OUT_TOP_LEFT, 0, 0); - /* Create a keyboard */ + /*Create a keyboard*/ kb = lv_keyboard_create(lv_scr_act()); lv_obj_set_size(kb, LV_HOR_RES, LV_VER_RES / 2); - lv_keyboard_set_textarea(kb, pwd_ta); /* Focus it on one of the text areas to start */ + lv_keyboard_set_textarea(kb, pwd_ta); /*Focus it on one of the text areas to start*/ } static void ta_event_cb(lv_obj_t * ta, lv_event_t event) { if(event == LV_EVENT_CLICKED) { - /* Focus on the clicked text area */ + /*Focus on the clicked text area*/ if(kb != NULL) lv_keyboard_set_textarea(kb, ta); } diff --git a/examples/widgets/textarea/lv_example_textarea_3.c b/examples/widgets/textarea/lv_example_textarea_3.c index cf0a4c6dd..e5be569cd 100644 --- a/examples/widgets/textarea/lv_example_textarea_3.c +++ b/examples/widgets/textarea/lv_example_textarea_3.c @@ -11,7 +11,7 @@ static lv_obj_t * kb; */ void lv_example_textarea_3(void) { - /* Create the text area */ + /*Create the text area*/ lv_obj_t * ta = lv_textarea_create(lv_scr_act(), NULL); lv_obj_add_event_cb(ta, ta_event_cb, NULL); lv_textarea_set_accepted_chars(ta, "0123456789:"); @@ -19,7 +19,7 @@ void lv_example_textarea_3(void) lv_textarea_set_one_line(ta, true); lv_textarea_set_text(ta, ""); - /* Create a keyboard*/ + /*Create a keyboard*/ kb = lv_keyboard_create(lv_scr_act()); lv_obj_set_size(kb, LV_HOR_RES, LV_VER_RES / 2); lv_keyboard_set_mode(kb, LV_KEYBOARD_MODE_NUMBER); diff --git a/lv_conf_template.h b/lv_conf_template.h index f077eb1f5..80c19ea9a 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -11,7 +11,7 @@ #ifndef LV_CONF_H #define LV_CONF_H -/* clang-format off */ +/*clang-format off*/ #include @@ -20,15 +20,15 @@ COLOR SETTINGS *====================*/ -/* Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888) */ +/*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/ #define LV_COLOR_DEPTH 32 -/* Swap the 2 bytes of RGB565 color. Useful if the display has a 8 bit interface (e.g. SPI)*/ +/*Swap the 2 bytes of RGB565 color. Useful if the display has a 8 bit interface (e.g. SPI)*/ #define LV_COLOR_16_SWAP 0 -/* Enable more complex drawing routines to manage screens transparency. - * Can be used if the UI is above an other layer, e.g. an OSD menu or video player. - * Requires `LV_COLOR_DEPTH = 32` colors and the screen's `bg_opa` should be set to non LV_OPA_COVER value */ +/*Enable more complex drawing routines to manage screens transparency. + *Can be used if the UI is above an other layer, e.g. an OSD menu or video player. + *Requires `LV_COLOR_DEPTH = 32` colors and the screen's `bg_opa` should be set to non LV_OPA_COVER value*/ #define LV_COLOR_SCREEN_TRANSP 0 /*Images pixels with this color will not be drawn if they are chroma keyed)*/ @@ -38,13 +38,13 @@ MEMORY SETTINGS *=========================*/ -/* 1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()` */ +/*1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()`*/ #define LV_MEM_CUSTOM 0 #if LV_MEM_CUSTOM == 0 -/* Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/ -# define LV_MEM_SIZE (32U * 1024U) /* [bytes] */ +/*Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/ +# define LV_MEM_SIZE (32U * 1024U) /*[bytes]*/ -/* Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too. */ +/*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/ # define LV_MEM_ADR 0 /*0: unused*/ #else /*LV_MEM_CUSTOM*/ # define LV_MEM_CUSTOM_INCLUDE /*Header for the dynamic memory function*/ @@ -53,29 +53,29 @@ # define LV_MEM_CUSTOM_REALLOC realloc #endif /*LV_MEM_CUSTOM*/ -/* Use the standard `memcpy` and `memset` instead of LVGL's own functions. (Might or might not be faster). */ +/*Use the standard `memcpy` and `memset` instead of LVGL's own functions. (Might or might not be faster).*/ #define LV_MEMCPY_MEMSET_STD 0 /*==================== HAL SETTINGS *====================*/ -/* Default display refresh period. LVG will redraw changed ares with this period time */ +/*Default display refresh period. LVG will redraw changed ares with this period time*/ #define LV_DISP_DEF_REFR_PERIOD 30 /*[ms]*/ -/* Input device read period in milliseconds */ +/*Input device read period in milliseconds*/ #define LV_INDEV_DEF_READ_PERIOD 30 /*[ms]*/ -/* Use a custom tick source that tells the elapsed time in milliseconds. - * It removes the need to manually update the tick with `lv_tick_inc()`) */ +/*Use a custom tick source that tells the elapsed time in milliseconds. + *It removes the need to manually update the tick with `lv_tick_inc()`)*/ #define LV_TICK_CUSTOM 0 #if LV_TICK_CUSTOM #define LV_TICK_CUSTOM_INCLUDE "Arduino.h" /*Header for the system time function*/ #define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/ #endif /*LV_TICK_CUSTOM*/ -/* Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings. - * (Not so important, you can adjust it to modify default sizes and spaces)*/ +/*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings. + *(Not so important, you can adjust it to modify default sizes and spaces)*/ #define LV_DPI_DEF 130 /*[px/inch]*/ /*======================= @@ -86,25 +86,25 @@ * Drawing *-----------*/ -/* Enable complex draw engine. - * Required to draw shadow, gradient, rounded corners, circles, arc, skew lines, image transformations or any masks */ +/*Enable complex draw engine. + *Required to draw shadow, gradient, rounded corners, circles, arc, skew lines, image transformations or any masks*/ #define LV_DRAW_COMPLEX 1 #if LV_DRAW_COMPLEX != 0 -/* Allow buffering some shadow calculation. - * LV_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius` - * Caching has LV_SHADOW_CACHE_SIZE^2 RAM cost*/ +/*Allow buffering some shadow calculation. + *LV_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius` + *Caching has LV_SHADOW_CACHE_SIZE^2 RAM cost*/ #define LV_SHADOW_CACHE_SIZE 0 #endif /*LV_DRAW_COMPLEX*/ -/* Default image cache size. Image caching keeps the images opened. - * If only the built-in image formats are used there is no real advantage of caching. (I.e. if no new image decoder is added) - * With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images. - * However the opened images might consume additional RAM. - * 0: to disable caching */ +/*Default image cache size. Image caching keeps the images opened. + *If only the built-in image formats are used there is no real advantage of caching. (I.e. if no new image decoder is added) + *With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images. + *However the opened images might consume additional RAM. + *0: to disable caching*/ #define LV_IMG_CACHE_DEF_SIZE 0 -/* Maximum buffer size to allocate for rotation. Only used if software rotation is enabled in the display driver. */ +/*Maximum buffer size to allocate for rotation. Only used if software rotation is enabled in the display driver.*/ #define LV_DISP_ROT_MAX_BUF (10*1024) /*------------- * GPU @@ -114,22 +114,22 @@ #define LV_USE_GPU_STM32_DMA2D 0 #if LV_USE_GPU_STM32_DMA2D /*Must be defined to include path of CMSIS header of target processor -e.g. "stm32f769xx.h" or "stm32f429xx.h" */ +e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ #define LV_GPU_DMA2D_CMSIS_INCLUDE #endif -/* Use NXP's PXP GPU iMX RTxxx platforms */ +/*Use NXP's PXP GPU iMX RTxxx platforms*/ #define LV_USE_GPU_NXP_PXP 0 #if LV_USE_GPU_NXP_PXP /*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c) * and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol FSL_RTOS_FREE_RTOS * has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected. *0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init() - * */ + */ #define LV_USE_GPU_NXP_PXP_AUTO_INIT 0 #endif -/* Use NXP's VG-Lite GPU iMX RTxxx platforms */ +/*Use NXP's VG-Lite GPU iMX RTxxx platforms*/ #define LV_USE_GPU_NXP_VG_LITE 0 /*------------- @@ -140,20 +140,20 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ #define LV_USE_LOG 1 #if LV_USE_LOG -/* How important log should be added: - * LV_LOG_LEVEL_TRACE A lot of logs to give detailed information - * LV_LOG_LEVEL_INFO Log important events - * LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem - * LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail - * LV_LOG_LEVEL_USER Only logs added by the user - * LV_LOG_LEVEL_NONE Do not log anything */ +/*How important log should be added: + *LV_LOG_LEVEL_TRACE A lot of logs to give detailed information + *LV_LOG_LEVEL_INFO Log important events + *LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem + *LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail + *LV_LOG_LEVEL_USER Only logs added by the user + *LV_LOG_LEVEL_NONE Do not log anything*/ # define LV_LOG_LEVEL LV_LOG_LEVEL_WARN -/* 1: Print the log with 'printf'; - * 0: User need to register a callback with `lv_log_register_print_cb()`*/ +/*1: Print the log with 'printf'; + *0: User need to register a callback with `lv_log_register_print_cb()`*/ # define LV_LOG_PRINTF 1 -/*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs */ +/*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/ # define LV_LOG_TRACE_MEM 1 # define LV_LOG_TRACE_TIMER 1 # define LV_LOG_TRACE_INDEV 1 @@ -170,13 +170,13 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ * Asserts *-----------*/ -/* Enable asserts if an operation is failed or an invalid data is found. - * If LV_USE_LOG is enabled an error message will be printed on failure*/ -#define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended) */ +/*Enable asserts if an operation is failed or an invalid data is found. + *If LV_USE_LOG is enabled an error message will be printed on failure*/ +#define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended)*/ #define LV_USE_ASSERT_MALLOC 1 /*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/ #define LV_USE_ASSERT_STYLE 1 /*Check if the styles are properly initialized. (Very fast, recommended)*/ #define LV_USE_ASSERT_MEM_INTEGRITY 1 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/ -#define LV_USE_ASSERT_OBJ 1 /*Check the object's type and existence (e.g. not deleted). (Slow) */ +#define LV_USE_ASSERT_OBJ 1 /*Check the object's type and existence (e.g. not deleted). (Slow)*/ /*Add a custom handler when assert happens e.g. to restart the MCU*/ #define LV_ASSERT_HANDLER_INCLUDE @@ -208,50 +208,50 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ typedef void * lv_user_data_t; #endif -/* Garbage Collector settings - * Used if lvgl is binded to higher level language and the memory is managed by that language */ +/*Garbage Collector settings + *Used if lvgl is binded to higher level language and the memory is managed by that language*/ #define LV_ENABLE_GC 0 #if LV_ENABLE_GC != 0 # define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/ -#endif /* LV_ENABLE_GC */ +#endif /*LV_ENABLE_GC*/ /*===================== * COMPILER SETTINGS *====================*/ -/* For big endian systems set to 1 */ +/*For big endian systems set to 1*/ #define LV_BIG_ENDIAN_SYSTEM 0 -/* Define a custom attribute to `lv_tick_inc` function */ +/*Define a custom attribute to `lv_tick_inc` function*/ #define LV_ATTRIBUTE_TICK_INC -/* Define a custom attribute to `lv_timer_handler` function */ +/*Define a custom attribute to `lv_timer_handler` function*/ #define LV_ATTRIBUTE_TIMER_HANDLER -/* Define a custom attribute to `lv_disp_flush_ready` function */ +/*Define a custom attribute to `lv_disp_flush_ready` function*/ #define LV_ATTRIBUTE_FLUSH_READY -/* Required alignment size for buffers */ +/*Required alignment size for buffers*/ #define LV_ATTRIBUTE_MEM_ALIGN_SIZE /*Will be added where memories needs to be aligned (with -Os data might not be aligned to boundary by default). * E.g. __attribute__((aligned(4)))*/ #define LV_ATTRIBUTE_MEM_ALIGN -/* Attribute to mark large constant arrays for example font's bitmaps */ +/*Attribute to mark large constant arrays for example font's bitmaps*/ #define LV_ATTRIBUTE_LARGE_CONST -/* Complier prefix for a big array declaration in RAM*/ +/*Complier prefix for a big array declaration in RAM*/ #define LV_ATTRIBUTE_LARGE_RAM_ARRAY -/* Place performance critical functions into a faster memory (e.g RAM) */ +/*Place performance critical functions into a faster memory (e.g RAM)*/ #define LV_ATTRIBUTE_FAST_MEM -/* Prefix variables that are used in GPU accelerated operations, often these need to be placed in RAM sections that are DMA accessible */ +/*Prefix variables that are used in GPU accelerated operations, often these need to be placed in RAM sections that are DMA accessible*/ #define LV_ATTRIBUTE_DMA -/* Export integer constant to binding. This macro is used with constants in the form of LV_ that - * should also appear on LVGL binding API such as Micropython.*/ +/*Export integer constant to binding. This macro is used with constants in the form of LV_ that + *should also appear on LVGL binding API such as Micropython.*/ #define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/ /*Extend the default -32k..32k coordinate range to -4M..4M by using int32_t for coordinates instead of int16_t*/ @@ -261,8 +261,8 @@ typedef void * lv_user_data_t; * FONT USAGE *===================*/ -/* Montserrat fonts with ASCII range and some symbols using bpp = 4 - * https://fonts.google.com/specimen/Montserrat */ +/*Montserrat fonts with ASCII range and some symbols using bpp = 4 + *https://fonts.google.com/specimen/Montserrat*/ #define LV_FONT_MONTSERRAT_8 0 #define LV_FONT_MONTSERRAT_10 0 #define LV_FONT_MONTSERRAT_12 0 @@ -285,37 +285,37 @@ typedef void * lv_user_data_t; #define LV_FONT_MONTSERRAT_46 0 #define LV_FONT_MONTSERRAT_48 0 -/* Demonstrate special features */ +/*Demonstrate special features*/ #define LV_FONT_MONTSERRAT_12_SUBPX 0 #define LV_FONT_MONTSERRAT_28_COMPRESSED 0 /*bpp = 3*/ #define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 /*Hebrew, Arabic, Perisan letters and all their forms*/ #define LV_FONT_SIMSUN_16_CJK 0 /*1000 most common CJK radicals*/ /*Pixel perfect monospace fonts - * http://pelulamu.net/unscii/ */ + *http://pelulamu.net/unscii/*/ #define LV_FONT_UNSCII_8 0 #define LV_FONT_UNSCII_16 0 -/* Optionally declare custom fonts here. - * You can use these fonts as default font too and they will be available globally. - * E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2) */ +/*Optionally declare custom fonts here. + *You can use these fonts as default font too and they will be available globally. + *E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/ #define LV_FONT_CUSTOM_DECLARE /*Always set a default font*/ #define LV_FONT_DEFAULT &lv_font_montserrat_14 -/* Enable handling large font and/or fonts with a lot of characters. - * The limit depends on the font size, font face and bpp. - * Compiler error will be triggered if a font needs it.*/ +/*Enable handling large font and/or fonts with a lot of characters. + *The limit depends on the font size, font face and bpp. + *Compiler error will be triggered if a font needs it.*/ #define LV_FONT_FMT_TXT_LARGE 0 -/* Enables/disables support for compressed fonts. */ +/*Enables/disables support for compressed fonts.*/ #define LV_USE_FONT_COMPRESSED 0 -/* Enable subpixel rendering */ +/*Enable subpixel rendering*/ #define LV_USE_FONT_SUBPX 0 #if LV_USE_FONT_SUBPX -/* Set the pixel order of the display. Physical order of RGB channels. Doesn't matter with "normal" fonts.*/ +/*Set the pixel order of the display. Physical order of RGB channels. Doesn't matter with "normal" fonts.*/ #define LV_FONT_SUBPX_BGR 0 /*0: RGB; 1:BGR order*/ #endif @@ -323,52 +323,53 @@ typedef void * lv_user_data_t; * TEXT SETTINGS *=================*/ -/* Select a character encoding for strings. +/** + * Select a character encoding for strings. * Your IDE or editor should have the same character encoding * - LV_TXT_ENC_UTF8 * - LV_TXT_ENC_ASCII - * */ + */ #define LV_TXT_ENC LV_TXT_ENC_UTF8 /*Can break (wrap) texts on these chars*/ #define LV_TXT_BREAK_CHARS " ,.;:-_" -/* If a word is at least this long, will break wherever "prettiest" - * To disable, set to a value <= 0 */ +/*If a word is at least this long, will break wherever "prettiest" + *To disable, set to a value <= 0*/ #define LV_TXT_LINE_BREAK_LONG_LEN 0 -/* Minimum number of characters in a long word to put on a line before a break. - * Depends on LV_TXT_LINE_BREAK_LONG_LEN. */ +/*Minimum number of characters in a long word to put on a line before a break. + *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ #define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3 -/* Minimum number of characters in a long word to put on a line after a break. - * Depends on LV_TXT_LINE_BREAK_LONG_LEN. */ +/*Minimum number of characters in a long word to put on a line after a break. + *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ #define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3 -/* The control character to use for signalling text recoloring. */ +/*The control character to use for signalling text recoloring.*/ #define LV_TXT_COLOR_CMD "#" -/* Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts. - * The direction will be processed according to the Unicode Bidirectioanl Algorithm: - * https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ +/*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts. + *The direction will be processed according to the Unicode Bidirectioanl Algorithm: + *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ #define LV_USE_BIDI 0 #if LV_USE_BIDI -/* Set the default direction. Supported values: - * `LV_BIDI_DIR_LTR` Left-to-Right - * `LV_BIDI_DIR_RTL` Right-to-Left - * `LV_BIDI_DIR_AUTO` detect texts base direction */ +/*Set the default direction. Supported values: + *`LV_BIDI_DIR_LTR` Left-to-Right + *`LV_BIDI_DIR_RTL` Right-to-Left + *`LV_BIDI_DIR_AUTO` detect texts base direction*/ #define LV_BIDI_BASE_DIR_DEF LV_BIDI_DIR_AUTO #endif -/* Enable Arabic/Persian processing - * In these languages characters should be replaced with an other form based on their position in the text */ +/*Enable Arabic/Persian processing + *In these languages characters should be replaced with an other form based on their position in the text*/ #define LV_USE_ARABIC_PERSIAN_CHARS 0 /*================== * WIDGET USAGE *================*/ -/* Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html */ +/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/ #define LV_USE_ARC 1 @@ -390,7 +391,7 @@ typedef void * lv_user_data_t; #define LV_USE_LABEL 1 #if LV_USE_LABEL -# define LV_LABEL_TEXT_SEL 1 /*Enable selecting text of the label */ +# define LV_LABEL_TEXT_SEL 1 /*Enable selecting text of the label*/ # define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/ #endif @@ -460,14 +461,14 @@ typedef void * lv_user_data_t; /*----------- * Themes *----------*/ -/* A simple, impressive and very complete theme */ +/*A simple, impressive and very complete theme*/ #define LV_USE_THEME_DEFAULT 1 #if LV_USE_THEME_DEFAULT -/* 1: Light mode; 0: Dark mode*/ +/*1: Light mode; 0: Dark mode*/ # define LV_THEME_DEFAULT_PALETTE_LIGHT 1 -/* 1: Enable grow on press*/ +/*1: Enable grow on press*/ # define LV_THEME_DEFAULT_GROW 1 /*Default transition time in [ms]*/ diff --git a/lvgl.h b/lvgl.h index 7415cd05c..650bc02d7 100644 --- a/lvgl.h +++ b/lvgl.h @@ -109,7 +109,7 @@ extern "C" { * bugfix_in_v5_3_2(); * #endif * - * */ + */ #define LV_VERSION_CHECK(x,y,z) (x == LVGL_VERSION_MAJOR && (y < LVGL_VERSION_MINOR || (y == LVGL_VERSION_MINOR && z <= LVGL_VERSION_PATCH))) /** @@ -137,7 +137,7 @@ static inline const char *lv_version_info(void) } #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LVGL_H*/ diff --git a/scripts/lv_conf_checker.py b/scripts/lv_conf_checker.py index a5f468d27..1ecb9928f 100755 --- a/scripts/lv_conf_checker.py +++ b/scripts/lv_conf_checker.py @@ -23,18 +23,18 @@ fout.write( #ifndef LV_CONF_INTERNAL_H #define LV_CONF_INTERNAL_H -/* clang-format off */ +/*clang-format off*/ #include -/* Handle special Kconfig options */ +/*Handle special Kconfig options*/ #include "lv_conf_kconfig.h" #ifdef CONFIG_LV_CONF_SKIP #define LV_CONF_SKIP #endif -/* If "lv_conf.h" is available from here try to use it later.*/ +/*If "lv_conf.h" is available from here try to use it later.*/ #if defined __has_include # if __has_include("lv_conf.h") # ifndef LV_CONF_INCLUDE_SIMPLE @@ -54,7 +54,7 @@ fout.write( # elif defined(LV_CONF_INCLUDE_SIMPLE) /*Or simply include lv_conf.h is enabled*/ # include "lv_conf.h" # else -# include "../../lv_conf.h" /*Else assume lv_conf.h is next to the lvgl folder */ +# include "../../lv_conf.h" /*Else assume lv_conf.h is next to the lvgl folder*/ # endif #endif @@ -113,7 +113,7 @@ fout.write( typedef void * lv_obj_user_data_t; # endif -# if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) /* Disable warnings for Visual Studio*/ +# if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) /*Disable warnings for Visual Studio*/ # define _CRT_SECURE_NO_WARNINGS # endif diff --git a/src/core/lv_disp.c b/src/core/lv_disp.c index 0390b9cb8..ab808cd60 100644 --- a/src/core/lv_disp.c +++ b/src/core/lv_disp.c @@ -258,7 +258,7 @@ void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t switch(anim_type) { case LV_SCR_LOAD_ANIM_NONE: - /* Create a dummy animation to apply the delay*/ + /*Create a dummy animation to apply the delay*/ lv_anim_set_exec_cb(&a_new, set_x_anim); lv_anim_set_values(&a_new, 0, 0); break; diff --git a/src/core/lv_disp.h b/src/core/lv_disp.h index 7821c96d8..76807b8cf 100644 --- a/src/core/lv_disp.h +++ b/src/core/lv_disp.h @@ -225,7 +225,7 @@ static inline lv_coord_t lv_dpx(lv_coord_t n) } #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_DISP_H*/ diff --git a/src/core/lv_group.c b/src/core/lv_group.c index e17723156..42f570e3b 100644 --- a/src/core/lv_group.c +++ b/src/core/lv_group.c @@ -134,8 +134,8 @@ void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj) if(next == NULL) return; *next = obj; - /* If the head and the tail is equal then there is only one object in the linked list. - * In this case automatically activate it*/ + /*If the head and the tail is equal then there is only one object in the linked list. + *In this case automatically activate it*/ if(_lv_ll_get_head(&group->obj_ll) == next) { lv_group_refocus(group); } @@ -168,14 +168,14 @@ void lv_group_remove_obj(lv_obj_t * obj) } } - /* If the focuses object is still the same then it was the only object in the group but it will - * be deleted. Set the `obj_focus` to NULL to get back to the initial state of the group with - * zero objects*/ + /*If the focuses object is still the same then it was the only object in the group but it will + *be deleted. Set the `obj_focus` to NULL to get back to the initial state of the group with + *zero objects*/ if(*g->obj_focus == obj) { g->obj_focus = NULL; } - /*Search the object and remove it from its group */ + /*Search the object and remove it from its group*/ lv_obj_t ** i; _LV_LL_READ(&g->obj_ll, i) { if(*i == obj) { diff --git a/src/core/lv_group.h b/src/core/lv_group.h index a3da5f1a9..073fa8deb 100644 --- a/src/core/lv_group.h +++ b/src/core/lv_group.h @@ -55,7 +55,7 @@ typedef void (*lv_group_focus_cb_t)(struct _lv_group_t *); * They are NOT for laying out objects on a screen (try `lv_cont` for that). */ typedef struct _lv_group_t { - lv_ll_t obj_ll; /**< Linked list to store the objects in the group */ + lv_ll_t obj_ll; /**< Linked list to store the objects in the group*/ struct _lv_obj_t ** obj_focus; /**< The object in focus*/ lv_group_focus_cb_t focus_cb; /**< A function to call when a new object is focused (optional)*/ @@ -66,7 +66,7 @@ typedef struct _lv_group_t { uint8_t frozen : 1; /**< 1: can't focus to new object*/ uint8_t editing : 1; /**< 1: Edit mode, 0: Navigate mode*/ uint8_t click_focus : 1; /**< 1: If an object in a group is clicked by an indev then it will be - focused */ + focused*/ uint8_t refocus_policy : 1; /**< 1: Focus prev if focused on deletion. 0: Focus next if focused on deletion.*/ uint8_t wrap : 1; /**< 1: Focus next/prev can wrap at end of list. 0: Focus next/prev stops at end @@ -226,7 +226,7 @@ bool lv_group_get_wrap(lv_group_t * group); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_GROUP_H*/ diff --git a/src/core/lv_indev.c b/src/core/lv_indev.c index 4a34ea6b8..08a20f417 100644 --- a/src/core/lv_indev.c +++ b/src/core/lv_indev.c @@ -379,13 +379,13 @@ static void indev_keypad_proc(lv_indev_t * i, lv_indev_data_t * data) /*Save the last key to compare it with the current latter on RELEASE*/ uint32_t prev_key = i->proc.types.keypad.last_key; - /* Save the last key. - * It must be done here else `lv_indev_get_key` will return the last key in events and signals*/ + /*Save the last key. + *It must be done here else `lv_indev_get_key` will return the last key in events and signals*/ i->proc.types.keypad.last_key = data->key; - /* Save the previous state so we can detect state changes below and also set the last state now - * so if any signal/event handler on the way returns `LV_RES_INV` the last state is remembered - * for the next time*/ + /*Save the previous state so we can detect state changes below and also set the last state now + *so if any signal/event handler on the way returns `LV_RES_INV` the last state is remembered + *for the next time*/ uint32_t prev_state = i->proc.types.keypad.last_state; i->proc.types.keypad.last_state = data->state; @@ -524,8 +524,8 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data) i->proc.types.keypad.last_state = LV_INDEV_STATE_RELEASED; /*To skip the processing of release*/ } - /* Save the last keys before anything else. - * They need to be already saved if the function returns for any reason*/ + /*Save the last keys before anything else. + *They need to be already saved if the function returns for any reason*/ lv_indev_state_t last_state = i->proc.types.keypad.last_state; i->proc.types.keypad.last_state = data->state; i->proc.types.keypad.last_key = data->key; @@ -584,7 +584,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data) } /*Pressing*/ else if(data->state == LV_INDEV_STATE_PRESSED && last_state == LV_INDEV_STATE_PRESSED) { - /* Long press*/ + /*Long press*/ if(i->proc.long_pr_sent == 0 && lv_tick_elaps(i->proc.pr_timestamp) > i->driver->long_press_time) { i->proc.long_pr_sent = 1; @@ -659,7 +659,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data) lv_event_send(indev_obj_act, LV_EVENT_RELEASED, NULL); if(indev_reset_check(&i->proc)) return; } - /*An object is being edited and the button is released. */ + /*An object is being edited and the button is released.*/ else if(g->editing) { /*Ignore long pressed enter release because it comes from mode switch*/ if(!i->proc.long_pr_sent || _lv_ll_get_len(&g->obj_ll) <= 1) { @@ -724,7 +724,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data) */ static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data) { - /* Die gracefully if i->btn_points is NULL */ + /*Die gracefully if i->btn_points is NULL*/ if(i->btn_points == NULL) { LV_LOG_WARN("btn_points is NULL"); return; @@ -829,7 +829,7 @@ static void indev_proc_press(lv_indev_proc_t * proc) proc->types.pointer.last_obj = indev_obj_act; if(indev_obj_act != NULL) { - /* Save the time when the obj pressed to count long press time.*/ + /*Save the time when the obj pressed to count long press time.*/ proc->pr_timestamp = lv_tick_get(); proc->long_pr_sent = 0; proc->types.pointer.scroll_sum.x = 0; @@ -929,7 +929,7 @@ static void indev_proc_release(lv_indev_proc_t * proc) indev_obj_act = proc->types.pointer.act_obj; lv_obj_t * scroll_obj = proc->types.pointer.scroll_obj; - /*Forget the act obj and send a released signal */ + /*Forget the act obj and send a released signal*/ if(indev_obj_act) { LV_LOG_INFO("released"); @@ -1006,7 +1006,7 @@ static void indev_click_focus(lv_indev_proc_t * proc) lv_group_t * g_act = lv_obj_get_group(obj_to_focus); lv_group_t * g_prev = proc->types.pointer.last_pressed ? lv_obj_get_group(proc->types.pointer.last_pressed) : NULL; - /*If both the last and act. obj. are in the same group (or no group but it's also the same) */ + /*If both the last and act. obj. are in the same group (or no group but it's also the same)*/ if(g_act == g_prev) { /*The objects are in a group*/ if(g_act) { diff --git a/src/core/lv_indev.h b/src/core/lv_indev.h index 724311ecc..7d216c8e7 100644 --- a/src/core/lv_indev.h +++ b/src/core/lv_indev.h @@ -170,7 +170,7 @@ lv_obj_t * lv_indev_search_obj(lv_obj_t * obj, lv_point_t * point); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_INDEV_H*/ diff --git a/src/core/lv_indev_scroll.c b/src/core/lv_indev_scroll.c index aeac79c3d..96546601a 100644 --- a/src/core/lv_indev_scroll.c +++ b/src/core/lv_indev_scroll.c @@ -158,7 +158,7 @@ void _lv_indev_scroll_throw_handler(lv_indev_proc_t * proc) } } - /*Check if the scroll has finished */ + /*Check if the scroll has finished*/ if(proc->types.pointer.scroll_throw_vect.x == 0 && proc->types.pointer.scroll_throw_vect.y == 0) { /*Revert if scrolled in*/ /*If vertically scrollable and not controlled by snap*/ @@ -247,13 +247,13 @@ static lv_obj_t * find_scroll_obj(lv_indev_proc_t * proc) lv_indev_t * indev_act = lv_indev_get_act(); lv_coord_t scroll_limit = indev_act->driver->scroll_limit; - /* Go until find an scrollable object in the current direction - * More precisely: - * 1. Check the pressed object and all of its ancestors and try to find an object which is scrollable - * 2. Scrollable means it has some content out of it's area - * 3. If an object can be scrolled into the current direction then use it ("real match"") - * 4. If can be scrolled on the current axis (hor/ver) save it as candidate (at least show an elastic scroll effect) - * 5. Use the last candidate. Always the "deepest" parent or the object from point 3 */ + /*Go until find an scrollable object in the current direction + *More precisely: + * 1. Check the pressed object and all of its ancestors and try to find an object which is scrollable + * 2. Scrollable means it has some content out of it's area + * 3. If an object can be scrolled into the current direction then use it ("real match"") + * 4. If can be scrolled on the current axis (hor/ver) save it as candidate (at least show an elastic scroll effect) + * 5. Use the last candidate. Always the "deepest" parent or the object from point 3*/ lv_obj_t * obj_act = proc->types.pointer.act_obj; while(obj_act) { if(lv_obj_has_flag(obj_act, LV_OBJ_FLAG_SCROLLABLE) == false) { @@ -286,16 +286,16 @@ static lv_obj_t * find_scroll_obj(lv_indev_proc_t * proc) if((scroll_dir & LV_DIR_TOP) == 0) up_en = false; if((scroll_dir & LV_DIR_BOTTOM) == 0) down_en = false; - /*The object is scrollable to a direction if its content overflow in that direction. */ + /*The object is scrollable to a direction if its content overflow in that direction.*/ lv_coord_t st = lv_obj_get_scroll_top(obj_act); lv_coord_t sb = lv_obj_get_scroll_bottom(obj_act); lv_coord_t sl = lv_obj_get_scroll_left(obj_act); lv_coord_t sr = lv_obj_get_scroll_right(obj_act); - /* If this object is scrollable into the current scroll direction then save it as a candidate. - * It's important only to be scrollable on the current axis (hor/ver) because if the scroll - * is propagated to this object it can show at least elastic scroll effect. - * But if not hor/ver scrollable do not scroll it at all (so it's not a good candidate) */ + /*If this object is scrollable into the current scroll direction then save it as a candidate. + *It's important only to be scrollable on the current axis (hor/ver) because if the scroll + *is propagated to this object it can show at least elastic scroll effect. + *But if not hor/ver scrollable do not scroll it at all (so it's not a good candidate)*/ if((st > 0 || sb > 0) && ((up_en && proc->types.pointer.scroll_sum.y >= scroll_limit) || (down_en && proc->types.pointer.scroll_sum.y <= - scroll_limit))) @@ -317,7 +317,7 @@ static lv_obj_t * find_scroll_obj(lv_indev_proc_t * proc) if(sl <= 0) left_en = false; if(sr <= 0) right_en = false; - /*If the object really can be scrolled into the current direction the use it. */ + /*If the object really can be scrolled into the current direction the use it.*/ if((left_en && proc->types.pointer.scroll_sum.x >= scroll_limit) || (right_en && proc->types.pointer.scroll_sum.x <= - scroll_limit) || (up_en && proc->types.pointer.scroll_sum.y >= scroll_limit) || @@ -330,7 +330,7 @@ static lv_obj_t * find_scroll_obj(lv_indev_proc_t * proc) /*If this object don't want to chain the scroll ot the parent stop searching*/ if(lv_obj_has_flag(obj_act, LV_OBJ_FLAG_SCROLL_CHAIN) == false) break; - /*Try the parent */ + /*Try the parent*/ obj_act = lv_obj_get_parent(obj_act); } @@ -563,8 +563,8 @@ static lv_coord_t scroll_throw_predict_x(lv_indev_proc_t * proc) static lv_coord_t elastic_diff(lv_obj_t * scroll_obj, lv_coord_t diff, lv_coord_t scroll_start, lv_coord_t scroll_end, lv_dir_t dir) { if(lv_obj_has_flag(scroll_obj, LV_OBJ_FLAG_SCROLL_ELASTIC)) { - /* If there is snapping in the current direction don't use the elastic factor because - * it's natural that the first and last items are scrolled (snapped) in. */ + /*If there is snapping in the current direction don't use the elastic factor because + *it's natural that the first and last items are scrolled (snapped) in.*/ lv_scroll_snap_t snap; snap = dir == LV_DIR_HOR ? lv_obj_get_scroll_snap_x(scroll_obj) : lv_obj_get_scroll_snap_y(scroll_obj); diff --git a/src/core/lv_indev_scroll.h b/src/core/lv_indev_scroll.h index ed6b0907a..83f6aed91 100644 --- a/src/core/lv_indev_scroll.h +++ b/src/core/lv_indev_scroll.h @@ -59,7 +59,7 @@ void lv_indev_scroll_get_snap_dist(lv_obj_t * obj, lv_point_t * p); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_INDEV_SCROLL_H*/ diff --git a/src/core/lv_obj.c b/src/core/lv_obj.c index 7ed8e4da5..08d08bc24 100644 --- a/src/core/lv_obj.c +++ b/src/core/lv_obj.c @@ -106,7 +106,7 @@ const lv_obj_class_t lv_obj_class = { void lv_init(void) { - /* Do nothing if already initialized */ + /*Do nothing if already initialized*/ if(lv_initialized) { LV_LOG_WARN("lv_init: already inited"); return; @@ -207,9 +207,9 @@ lv_res_t lv_event_send(lv_obj_t * obj, lv_event_t event, void * param) return LV_RES_OK; } - /* Build a simple linked list from the objects used in the events - * It's important to know if an this object was deleted by a nested event - * called from this `event_cb`. */ + /*Build a simple linked list from the objects used in the events + *It's important to know if an this object was deleted by a nested event + *called from this `event_cb`.*/ lv_event_temp_data_t event_temp_data; event_temp_data.obj = obj; event_temp_data.deleted = false; @@ -220,8 +220,8 @@ lv_res_t lv_event_send(lv_obj_t * obj, lv_event_t event, void * param) } event_temp_data_head = &event_temp_data; - /* There could be nested event sending with different param. - * It needs to be saved for the current event context because `lv_event_get_data` returns a global param. */ + /*There could be nested event sending with different param. + *It needs to be saved for the current event context because `lv_event_get_data` returns a global param.*/ void * event_act_param_save = event_act_param; event_act_param = param; @@ -437,8 +437,8 @@ void lv_obj_set_base_dir(lv_obj_t * obj, lv_bidi_dir_t dir) obj->spec_attr->base_dir = dir; lv_signal_send(obj, LV_SIGNAL_BASE_DIR_CHG, NULL); - /* Notify the children about the parent base dir has changed. - * (The children might have `LV_BIDI_DIR_INHERIT`)*/ + /*Notify the children about the parent base dir has changed. + *(The children might have `LV_BIDI_DIR_INHERIT`)*/ base_dir_refr_children(obj); } @@ -679,7 +679,7 @@ static void lv_obj_constructor(lv_obj_t * obj, const lv_obj_t * copy) } /*Add to the same group*/ if(copy->spec_attr && copy->spec_attr->group_p) { - obj->spec_attr->group_p = NULL; /*It was simply copied */ + obj->spec_attr->group_p = NULL; /*It was simply copied*/ lv_group_add_obj(copy->spec_attr->group_p, obj); } @@ -999,8 +999,8 @@ static lv_res_t lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param) } } else if(sign == LV_SIGNAL_BASE_DIR_CHG) { - /* The layout might depend on the base dir. - * E.g. the first is element is on the left or right*/ + /*The layout might depend on the base dir. + *E.g. the first is element is on the left or right*/ lv_obj_mark_layout_as_dirty(obj); } else if(sign == LV_SIGNAL_SCROLL) { @@ -1018,7 +1018,7 @@ static lv_res_t lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param) *s = LV_MAX(*s, d); } else if(sign == LV_SIGNAL_STYLE_CHG) { - /* Padding might have changed so the layout should be recalculated*/ + /*Padding might have changed so the layout should be recalculated*/ lv_obj_mark_layout_as_dirty(obj); /*Reposition non grid objects on by one*/ diff --git a/src/core/lv_obj.h b/src/core/lv_obj.h index 9e3d53613..170cb3477 100644 --- a/src/core/lv_obj.h +++ b/src/core/lv_obj.h @@ -44,8 +44,8 @@ struct _lv_obj_t; typedef enum { LV_EVENT_PRESSED, /**< The object has been pressed*/ LV_EVENT_PRESSING, /**< The object is being pressed (called continuously while pressing)*/ - LV_EVENT_PRESS_LOST, /**< User is still pressing but slid cursor/finger off of the object */ - LV_EVENT_SHORT_CLICKED, /**< User pressed object for a short period of time, then released it. Not called if scrolled. */ + LV_EVENT_PRESS_LOST, /**< User is still pressing but slid cursor/finger off of the object*/ + LV_EVENT_SHORT_CLICKED, /**< User pressed object for a short period of time, then released it. Not called if scrolled.*/ LV_EVENT_LONG_PRESSED, /**< Object has been pressed for at least `LV_INDEV_LONG_PRESS_TIME`. Not called if scrolled.*/ LV_EVENT_LONG_PRESSED_REPEAT, /**< Called after `LV_INDEV_LONG_PRESS_TIME` in every `LV_INDEV_LONG_PRESS_REP_TIME` ms. Not called if scrolled.*/ @@ -59,13 +59,13 @@ typedef enum { LV_EVENT_FOCUSED, LV_EVENT_DEFOCUSED, LV_EVENT_LEAVE, - LV_EVENT_VALUE_CHANGED, /**< The object's value has changed (i.e. slider moved) */ + LV_EVENT_VALUE_CHANGED, /**< The object's value has changed (i.e. slider moved)*/ LV_EVENT_INSERT, LV_EVENT_REFRESH, - LV_EVENT_DELETE, /**< Object is being deleted */ + LV_EVENT_DELETE, /**< Object is being deleted*/ - LV_EVENT_COVER_CHECK, /**< Check if the object fully covers the 'mask_p' area */ - LV_EVENT_REFR_EXT_DRAW_SIZE, /**< Draw extras on the object */ + LV_EVENT_COVER_CHECK, /**< Check if the object fully covers the 'mask_p' area*/ + LV_EVENT_REFR_EXT_DRAW_SIZE, /**< Draw extras on the object*/ LV_EVENT_DRAW_MAIN_BEGIN, LV_EVENT_DRAW_MAIN_END, @@ -74,8 +74,8 @@ typedef enum { LV_EVENT_DRAW_PART_BEGIN, LV_EVENT_DRAW_PART_END, - LV_EVENT_READY, /**< A process has finished */ - LV_EVENT_CANCEL, /**< A process has been cancelled */ + LV_EVENT_READY, /**< A process has finished*/ + LV_EVENT_CANCEL, /**< A process has been cancelled*/ _LV_EVENT_LAST /** Number of default events*/ }lv_event_t; @@ -100,32 +100,32 @@ typedef struct { /** Signals are for use by the object itself or to extend the object's functionality. * They determine a widget with a given type should behave. * Applications should use ::lv_obj_set_event_cb to be notified of events that occur - * on the object. */ + * on the object.*/ typedef enum { /*General signals*/ - LV_SIGNAL_CHILD_CHG, /**< Child was removed/added */ - LV_SIGNAL_COORD_CHG, /**< Object coordinates/size have changed */ - LV_SIGNAL_STYLE_CHG, /**< Object's style has changed */ + LV_SIGNAL_CHILD_CHG, /**< Child was removed/added*/ + LV_SIGNAL_COORD_CHG, /**< Object coordinates/size have changed*/ + LV_SIGNAL_STYLE_CHG, /**< Object's style has changed*/ LV_SIGNAL_BASE_DIR_CHG, /**< The base dir has changed*/ - LV_SIGNAL_REFR_EXT_DRAW_SIZE, /**< Object's extra padding has changed */ + LV_SIGNAL_REFR_EXT_DRAW_SIZE, /**< Object's extra padding has changed*/ LV_SIGNAL_GET_SELF_SIZE, /**< Get the internal size of a widget*/ /*Input device related*/ - LV_SIGNAL_HIT_TEST, /**< Advanced hit-testing */ + LV_SIGNAL_HIT_TEST, /**< Advanced hit-testing*/ LV_SIGNAL_PRESSED, /**< The object has been pressed*/ LV_SIGNAL_PRESSING, /**< The object is being pressed (called continuously while pressing)*/ - LV_SIGNAL_PRESS_LOST, /**< User is still pressing but slid cursor/finger off of the object */ - LV_SIGNAL_RELEASED, /**< User pressed object for a short period of time, then released it. Not called if scrolled. */ + LV_SIGNAL_PRESS_LOST, /**< User is still pressing but slid cursor/finger off of the object*/ + LV_SIGNAL_RELEASED, /**< User pressed object for a short period of time, then released it. Not called if scrolled.*/ LV_SIGNAL_LONG_PRESS, /**< Object has been pressed for at least `LV_INDEV_LONG_PRESS_TIME`. Not called if scrolled.*/ LV_SIGNAL_LONG_PRESS_REP, /**< Called after `LV_INDEV_LONG_PRESS_TIME` in every `LV_INDEV_LONG_PRESS_REP_TIME` ms. Not called if scrolled.*/ - LV_SIGNAL_SCROLL_BEGIN, /**< The scrolling has just begun */ - LV_SIGNAL_SCROLL, /**< The object has been scrolled */ - LV_SIGNAL_SCROLL_END, /**< The scrolling has ended */ + LV_SIGNAL_SCROLL_BEGIN, /**< The scrolling has just begun*/ + LV_SIGNAL_SCROLL, /**< The object has been scrolled*/ + LV_SIGNAL_SCROLL_END, /**< The scrolling has ended*/ LV_SIGNAL_GESTURE, /**< The object has been gesture*/ - LV_SIGNAL_LEAVE, /**< Another object is clicked or chosen via an input device */ - LV_SIGNAL_FOCUS, /**< The object was focused */ - LV_SIGNAL_DEFOCUS, /**< The object was de-focused */ - LV_SIGNAL_CONTROL, /**< Send a (control) character to the widget */ + LV_SIGNAL_LEAVE, /**< Another object is clicked or chosen via an input device*/ + LV_SIGNAL_FOCUS, /**< The object was focused*/ + LV_SIGNAL_DEFOCUS, /**< The object was de-focused*/ + LV_SIGNAL_CONTROL, /**< Send a (control) character to the widget*/ } lv_signal_t; /** @@ -155,7 +155,7 @@ enum { LV_STATE_USER_3 = 0x4000, LV_STATE_USER_4 = 0x8000, - LV_STATE_ANY = 0xFFFF, /**< Special value can be used in some functions to target all states */ + LV_STATE_ANY = 0xFFFF, /**< Special value can be used in some functions to target all states*/ }; typedef uint16_t lv_state_t; @@ -169,8 +169,8 @@ typedef uint16_t lv_state_t; enum { LV_PART_MAIN, /**< A background like rectangle*/ LV_PART_SCROLLBAR, /**< The scrollbar(s)*/ - LV_PART_INDICATOR, /**< Indicator, e.g. for slider, bar, switch, or the tick box of the checkbox */ - LV_PART_KNOB, /**< Like handle to grab to adjust the value */ + LV_PART_INDICATOR, /**< Indicator, e.g. for slider, bar, switch, or the tick box of the checkbox*/ + LV_PART_KNOB, /**< Like handle to grab to adjust the value*/ LV_PART_SELECTED, /**< Indicate the currently selected option or section*/ LV_PART_ITEMS, /**< Used if the widget has multiple similar elements (e.g. tabel cells)*/ LV_PART_TICKS, /**< Ticks on scale e.g. for a chart or meter*/ @@ -185,7 +185,7 @@ enum { LV_PART_CUSTOM_7, /**< Extension point for custom widgets*/ LV_PART_CUSTOM_8, /**< Extension point for custom widgets*/ - LV_PART_ANY = 0xFF, /**< Special value can be used in some functions to target all parts */ + LV_PART_ANY = 0xFF, /**< Special value can be used in some functions to target all parts*/ }; typedef uint16_t lv_part_t; @@ -195,24 +195,24 @@ typedef uint16_t lv_part_t; * OR-ed values are possible */ enum { - LV_OBJ_FLAG_HIDDEN = (1 << 0), /**< Make the object hidden. (Like it wasn't there at all) */ - LV_OBJ_FLAG_CLICKABLE = (1 << 1), /**< Make the object clickable by the input devices */ - LV_OBJ_FLAG_CLICK_FOCUSABLE = (1 << 2), /**< Add focused state to the object when clicked */ - LV_OBJ_FLAG_CHECKABLE = (1 << 3), /**< Toggle checked state when the object is clicked */ + LV_OBJ_FLAG_HIDDEN = (1 << 0), /**< Make the object hidden. (Like it wasn't there at all)*/ + LV_OBJ_FLAG_CLICKABLE = (1 << 1), /**< Make the object clickable by the input devices*/ + LV_OBJ_FLAG_CLICK_FOCUSABLE = (1 << 2), /**< Add focused state to the object when clicked*/ + LV_OBJ_FLAG_CHECKABLE = (1 << 3), /**< Toggle checked state when the object is clicked*/ LV_OBJ_FLAG_SCROLLABLE = (1 << 4), /**< Make the object scrollable*/ LV_OBJ_FLAG_SCROLL_ELASTIC = (1 << 5), /**< Allow scrolling inside but with slower speed*/ LV_OBJ_FLAG_SCROLL_MOMENTUM = (1 << 6), /**< Make the object scroll further when "thrown"*/ LV_OBJ_FLAG_SCROLL_ONE = (1 << 7), /**< Allow scrolling only one snapable children*/ - LV_OBJ_FLAG_SCROLL_CHAIN = (1 << 8), /**< Allow propagating the scroll to a parent */ + LV_OBJ_FLAG_SCROLL_CHAIN = (1 << 8), /**< Allow propagating the scroll to a parent*/ LV_OBJ_FLAG_SCROLL_ON_FOCUS = (1 << 9), /**< Automatically scroll object to make it visible when focused*/ LV_OBJ_FLAG_SNAPABLE = (1 << 10), /**< If scroll snap is enabled on the parent it can snap to this object*/ - LV_OBJ_FLAG_PRESS_LOCK = (1 << 11), /**< Keep the object pressed even if the press slid from the object */ - LV_OBJ_FLAG_EVENT_BUBBLE = (1 << 12), /**< Propagate the events to the parent too */ - LV_OBJ_FLAG_GESTURE_BUBBLE = (1 << 13), /**< Propagate the gestures to the parent */ - LV_OBJ_FLAG_FOCUS_BUBBLE = (1 << 14), /**< Propagate the focus to the parent */ - LV_OBJ_FLAG_ADV_HITTEST = (1 << 15), /**< Allow performing more accurate hit (click) test. E.g. consider rounded corners. */ - LV_OBJ_FLAG_IGNORE_LAYOUT = (1 << 16), /**< Make the object position-able by the layouts */ - LV_OBJ_FLAG_FLOATING = (1 << 17), /**< Do not scroll the object when the parent scrolls and ignore layout */ + LV_OBJ_FLAG_PRESS_LOCK = (1 << 11), /**< Keep the object pressed even if the press slid from the object*/ + LV_OBJ_FLAG_EVENT_BUBBLE = (1 << 12), /**< Propagate the events to the parent too*/ + LV_OBJ_FLAG_GESTURE_BUBBLE = (1 << 13), /**< Propagate the gestures to the parent*/ + LV_OBJ_FLAG_FOCUS_BUBBLE = (1 << 14), /**< Propagate the focus to the parent*/ + LV_OBJ_FLAG_ADV_HITTEST = (1 << 15), /**< Allow performing more accurate hit (click) test. E.g. consider rounded corners.*/ + LV_OBJ_FLAG_IGNORE_LAYOUT = (1 << 16), /**< Make the object position-able by the layouts*/ + LV_OBJ_FLAG_FLOATING = (1 << 17), /**< Do not scroll the object when the parent scrolls and ignore layout*/ LV_OBJ_FLAG_LAYOUT_1 = (1 << 23), /** Custom flag, free to use by layouts*/ LV_OBJ_FLAG_LAYOUT_2 = (1 << 24), /** Custom flag, free to use by layouts*/ @@ -246,23 +246,23 @@ extern const lv_obj_class_t lv_obj_class; */ typedef struct { struct _lv_obj_t ** children; /**< Store the pointer of the children in an array.*/ - uint32_t child_cnt; /**< Number of children */ + uint32_t child_cnt; /**< Number of children*/ lv_group_t * group_p; const lv_layout_dsc_t * layout_dsc; /**< Pointer to the layout descriptor*/ - lv_event_dsc_t * event_dsc; /**< Dynamically allocated event callback and user data array */ + lv_event_dsc_t * event_dsc; /**< Dynamically allocated event callback and user data array*/ lv_point_t scroll; /**< The current X/Y scroll offset*/ - uint8_t ext_click_pad; /**< Extra click padding in all direction */ - lv_coord_t ext_draw_size; /**< EXTend the size in every direction for drawing. */ + uint8_t ext_click_pad; /**< Extra click padding in all direction*/ + lv_coord_t ext_draw_size; /**< EXTend the size in every direction for drawing.*/ lv_scrollbar_mode_t scrollbar_mode :2; /**< How to display scrollbars*/ lv_scroll_snap_t scroll_snap_x : 2; /**< Where to align the snapable children horizontally*/ lv_scroll_snap_t scroll_snap_y : 2; /**< Where to align the snapable children horizontally*/ lv_dir_t scroll_dir :4; /**< The allowed scroll direction(s)*/ - lv_bidi_dir_t base_dir : 2; /**< Base direction of texts related to this object */ - uint8_t event_dsc_cnt; /**< Number of event callabcks stored in `event_cb` array */ + lv_bidi_dir_t base_dir : 2; /**< Base direction of texts related to this object*/ + uint8_t event_dsc_cnt; /**< Number of event callabcks stored in `event_cb` array*/ }lv_obj_spec_attr_t; typedef struct _lv_obj_t{ @@ -554,7 +554,7 @@ bool lv_obj_is_valid(const lv_obj_t * obj); #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_OBJ_H*/ diff --git a/src/core/lv_obj_class.c b/src/core/lv_obj_class.c index 9b5f031cf..bd25ab189 100644 --- a/src/core/lv_obj_class.c +++ b/src/core/lv_obj_class.c @@ -55,8 +55,8 @@ lv_obj_t * lv_obj_create_from_class(const lv_obj_class_t * class_p, lv_obj_t * p lv_obj_construct(obj, parent, copy); if(parent) { - /* Send a signal to the parent to notify it about the new child. - * Also triggers layout update*/ + /*Send a signal to the parent to notify it about the new child. + *Also triggers layout update*/ lv_signal_send(parent, LV_SIGNAL_CHILD_CHG, obj); /*Invalidate the area if not screen created*/ @@ -153,7 +153,7 @@ static uint32_t get_instance_size(const lv_obj_class_t * class_p) const lv_obj_class_t * base = class_p; while(base && base->instance_size == 0) base = base->base_class; - if(base == NULL) return 0; /*Never happens: set at least in `lv_obj` class */ + if(base == NULL) return 0; /*Never happens: set at least in `lv_obj` class*/ return base->instance_size; } diff --git a/src/core/lv_obj_class.h b/src/core/lv_obj_class.h index 246862462..e75535ca2 100644 --- a/src/core/lv_obj_class.h +++ b/src/core/lv_obj_class.h @@ -43,7 +43,7 @@ typedef struct _lv_obj_class_t{ void (*destructor_cb)(struct _lv_obj_t * obj); lv_signal_cb_t signal_cb; /**< Object type specific signal function*/ lv_draw_cb_t draw_cb; /**< Object type specific draw function*/ - uint32_t editable :2; /**< Value from ::lv_obj_class_editable_t */ + uint32_t editable :2; /**< Value from ::lv_obj_class_editable_t*/ uint32_t instance_size :20; }lv_obj_class_t; @@ -74,7 +74,7 @@ bool lv_obj_is_editable(struct _lv_obj_t * obj); #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_OBJ_CLASS_H*/ diff --git a/src/core/lv_obj_draw.c b/src/core/lv_obj_draw.c index 252ed0ae0..29861c6cc 100644 --- a/src/core/lv_obj_draw.c +++ b/src/core/lv_obj_draw.c @@ -396,8 +396,8 @@ void lv_obj_refresh_ext_draw_size(lv_obj_t * obj) if(obj->spec_attr) { obj->spec_attr->ext_draw_size = s_new; } - /* Allocate spec. attrs. only if the result is not zero. - * Zero is the default value if the spec. attr. are not defined. */ + /*Allocate spec. attrs. only if the result is not zero. + *Zero is the default value if the spec. attr. are not defined.*/ else if(s_new != 0) { lv_obj_allocate_spec_attr(obj); obj->spec_attr->ext_draw_size = s_new; diff --git a/src/core/lv_obj_draw.h b/src/core/lv_obj_draw.h index 1c1604fa1..073e02267 100644 --- a/src/core/lv_obj_draw.h +++ b/src/core/lv_obj_draw.h @@ -25,9 +25,9 @@ extern "C" { struct _lv_obj_t; -/** Design results */ +/** Design results*/ typedef enum { - LV_DRAW_RES_OK, /**< Draw ready */ + LV_DRAW_RES_OK, /**< Draw ready*/ LV_DRAW_RES_COVER, /**< Returned on `LV_DRAW_COVER_CHK` if the areas is fully covered*/ LV_DRAW_RES_NOT_COVER, /**< Returned on `LV_DRAW_COVER_CHK` if the areas is not covered*/ LV_DRAW_RES_MASKED, /**< Returned on `LV_DRAW_COVER_CHK` if the areas is masked out (children also not cover)*/ @@ -53,11 +53,11 @@ typedef struct const void * sub_part_ptr; }lv_obj_draw_dsc_t; -/** Design modes */ +/** Design modes*/ enum { - LV_DRAW_MODE_COVER_CHECK, /**< Check if the object fully covers the 'mask_p' area */ - LV_DRAW_MODE_MAIN_DRAW, /**< Draw the main portion of the object */ - LV_DRAW_MODE_POST_DRAW, /**< Draw extras on the object */ + LV_DRAW_MODE_COVER_CHECK, /**< Check if the object fully covers the 'mask_p' area*/ + LV_DRAW_MODE_MAIN_DRAW, /**< Draw the main portion of the object*/ + LV_DRAW_MODE_POST_DRAW, /**< Draw extras on the object*/ }; typedef uint8_t lv_draw_mode_t; @@ -155,7 +155,7 @@ lv_coord_t _lv_obj_get_ext_draw_size(const struct _lv_obj_t * obj); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_OBJ_DRAW_H*/ diff --git a/src/core/lv_obj_pos.c b/src/core/lv_obj_pos.c index 15791c948..afa2bd7d3 100644 --- a/src/core/lv_obj_pos.c +++ b/src/core/lv_obj_pos.c @@ -80,8 +80,8 @@ void lv_obj_set_size(lv_obj_t * obj, lv_coord_t w, lv_coord_t h) obj->w_set = w; obj->h_set = h; - /* If the width or height is set to special layout related value save them in w_set and h_set - * but use the current size on the object width*/ + /*If the width or height is set to special layout related value save them in w_set and h_set + *but use the current size on the object width*/ if(LV_COORD_IS_LAYOUT(w)) w = lv_obj_get_width(obj); if(LV_COORD_IS_LAYOUT(h)) h = lv_obj_get_height(obj); @@ -187,9 +187,9 @@ void lv_obj_update_layout(lv_obj_t * obj) layout_update_core(obj); }while(scr->layout_inv); /*Repeat until there where layout invalidations*/ - /* Restore the global state because other calls of this function needs this info too. - * Other calls might use different start object, but they need to know if there is dirty layout somewhere. - * However if the screen was updated it's sure that all layouts are ready. */ + /*Restore the global state because other calls of this function needs this info too. + *Other calls might use different start object, but they need to know if there is dirty layout somewhere. + *However if the screen was updated it's sure that all layouts are ready.*/ if(obj != scr) scr->layout_inv = 1; } @@ -472,9 +472,9 @@ void lv_obj_move_to(lv_obj_t * obj, lv_coord_t x, lv_coord_t y, bool notify) diff.x = x - obj->coords.x1; diff.y = y - obj->coords.y1; - /* Do nothing if the position is not changed */ - /* It is very important else recursive positioning can - * occur without position change*/ + /*Do nothing if the position is not changed*/ + /*It is very important else recursive positioning can + *occur without position change*/ if(diff.x == 0 && diff.y == 0) return; /*Invalidate the original area*/ @@ -490,8 +490,8 @@ void lv_obj_move_to(lv_obj_t * obj, lv_coord_t x, lv_coord_t y, bool notify) if(parent) { lv_obj_get_coords_fit(parent, &parent_fit_area); - /* If the object is already out of the parent and its position is changes - * surely the scrollbars also changes so invalidate them*/ + /*If the object is already out of the parent and its position is changes + *surely the scrollbars also changes so invalidate them*/ on1 = _lv_area_is_in(&ori, &parent_fit_area, 0); if(!on1) lv_obj_scrollbar_invalidate(parent); } @@ -512,8 +512,8 @@ void lv_obj_move_to(lv_obj_t * obj, lv_coord_t x, lv_coord_t y, bool notify) /*Invalidate the new area*/ lv_obj_invalidate(obj); - /* If the object was out of the parent invalidate the new scrollbar area too. - * If it wasn't out of the parent but out now, also invalidate the srollbars*/ + /*If the object was out of the parent invalidate the new scrollbar area too. + *If it wasn't out of the parent but out now, also invalidate the srollbars*/ if(parent) { bool on2 = _lv_area_is_in(&obj->coords, &parent_fit_area, 0); if(on1 || (!on1 && on2)) lv_obj_scrollbar_invalidate(parent); @@ -677,13 +677,13 @@ static bool refr_size(lv_obj_t * obj, lv_coord_t w, lv_coord_t h) lv_obj_t * parent = lv_obj_get_parent(obj); if(parent == NULL) return false; - /* If the size is managed by the layout don't let to overwrite it.*/ + /*If the size is managed by the layout don't let to overwrite it.*/ if(obj->w_set == LV_SIZE_LAYOUT) w = lv_obj_get_width(obj); if(obj->h_set == LV_SIZE_LAYOUT) h = lv_obj_get_height(obj); - /* Do nothing if the size is not changed */ - /* It is very important else recursive resizing can - * occur without size change*/ + /*Do nothing if the size is not changed*/ + /*It is very important else recursive resizing can + *occur without size change*/ if(lv_obj_get_width(obj) == w && lv_obj_get_height(obj) == h) { return false; } @@ -698,13 +698,13 @@ static bool refr_size(lv_obj_t * obj, lv_coord_t w, lv_coord_t h) lv_area_t parent_fit_area; lv_obj_get_coords_fit(parent, &parent_fit_area); - /* If the object is already out of the parent and its position is changes - * surely the scrollbars also changes so invalidate them*/ + /*If the object is already out of the parent and its position is changes + *surely the scrollbars also changes so invalidate them*/ bool on1 = _lv_area_is_in(&ori, &parent_fit_area, 0); if(!on1) lv_obj_scrollbar_invalidate(parent); - /* Set the length and height - * Be sure the content is not scrolled in an invalid position on the new size*/ + /*Set the length and height + *Be sure the content is not scrolled in an invalid position on the new size*/ obj->coords.y2 = obj->coords.y1 + h - 1; if(lv_obj_get_base_dir(obj) == LV_BIDI_DIR_RTL) { obj->coords.x1 = obj->coords.x2 - w + 1; @@ -722,8 +722,8 @@ static bool refr_size(lv_obj_t * obj, lv_coord_t w, lv_coord_t h) /*Invalidate the new area*/ lv_obj_invalidate(obj); - /* If the object was out of the parent invalidate the new scrollbar area too. - * If it wasn't out of the parent but out now, also invalidate the srollbars*/ + /*If the object was out of the parent invalidate the new scrollbar area too. + *If it wasn't out of the parent but out now, also invalidate the srollbars*/ bool on2 = _lv_area_is_in(&obj->coords, &parent_fit_area, 0); if(on1 || (!on1 && on2)) lv_obj_scrollbar_invalidate(parent); return true; diff --git a/src/core/lv_obj_pos.h b/src/core/lv_obj_pos.h index 8f4f91f34..ec1471660 100644 --- a/src/core/lv_obj_pos.h +++ b/src/core/lv_obj_pos.h @@ -327,7 +327,7 @@ bool lv_obj_hit_test(struct _lv_obj_t * obj, const lv_point_t * point); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_OBJ_POS_H*/ diff --git a/src/core/lv_obj_scroll.c b/src/core/lv_obj_scroll.c index 1c6f939dc..a30eb04af 100644 --- a/src/core/lv_obj_scroll.c +++ b/src/core/lv_obj_scroll.c @@ -158,8 +158,8 @@ lv_coord_t lv_obj_get_scroll_left(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); - /* Normally can't scroll the object out on the left. - * So simply use the current scroll position as "left size"*/ + /*Normally can't scroll the object out on the left. + *So simply use the current scroll position as "left size"*/ if(lv_obj_get_base_dir(obj) != LV_BIDI_DIR_RTL) { if(obj->spec_attr == NULL) return 0; return -obj->spec_attr->scroll.x; @@ -196,8 +196,8 @@ lv_coord_t lv_obj_get_scroll_right(lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); - /* With RTL base dir can't scroll to the object out on the right. - * So simply use the current scroll position as "right size"*/ + /*With RTL base dir can't scroll to the object out on the right. + *So simply use the current scroll position as "right size"*/ if(lv_obj_get_base_dir(obj) == LV_BIDI_DIR_RTL) { if(obj->spec_attr == NULL) return 0; return obj->spec_attr->scroll.x; @@ -636,7 +636,7 @@ static void scroll_area_into_view(const lv_area_t * area, lv_obj_t * child, lv_p break; } - /* Remove any pending scroll animations.*/ + /*Remove any pending scroll animations.*/ lv_anim_del(parent, scroll_x_anim); lv_anim_del(parent, scroll_y_anim); diff --git a/src/core/lv_obj_scroll.h b/src/core/lv_obj_scroll.h index 4a6bf4d20..2cfa76ac9 100644 --- a/src/core/lv_obj_scroll.h +++ b/src/core/lv_obj_scroll.h @@ -24,7 +24,7 @@ extern "C" { * TYPEDEFS **********************/ -/* Can't include lv_obj.h because it includes this header file */ +/*Can't include lv_obj.h because it includes this header file*/ struct _lv_obj_t; /** Scrollbar modes: shows when should the scrollbars be visible*/ @@ -37,12 +37,12 @@ enum { typedef uint8_t lv_scrollbar_mode_t; -/** Scroll span align options. Tells where to align the snapable children when scroll stops. */ +/** Scroll span align options. Tells where to align the snapable children when scroll stops.*/ enum { - LV_SCROLL_SNAP_NONE, /**< Do not align, leave where it is */ - LV_SCROLL_SNAP_START, /**< Align to to the left/top */ - LV_SCROLL_SNAP_END, /**< Align to to the right/bottom */ - LV_SCROLL_SNAP_CENTER /**< Align to to the center */ + LV_SCROLL_SNAP_NONE, /**< Do not align, leave where it is*/ + LV_SCROLL_SNAP_START, /**< Align to to the left/top*/ + LV_SCROLL_SNAP_END, /**< Align to to the right/bottom*/ + LV_SCROLL_SNAP_CENTER /**< Align to to the center*/ }; typedef uint8_t lv_scroll_snap_t; @@ -271,7 +271,7 @@ void lv_obj_scrollbar_invalidate(struct _lv_obj_t * obj); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_OBJ_SCROLL_H*/ diff --git a/src/core/lv_obj_style.c b/src/core/lv_obj_style.c index 697300efb..15c960e9e 100644 --- a/src/core/lv_obj_style.c +++ b/src/core/lv_obj_style.c @@ -12,7 +12,7 @@ #if defined(LV_GC_INCLUDE) #include LV_GC_INCLUDE -#endif /* LV_ENABLE_GC */ +#endif /*LV_ENABLE_GC*/ /********************* * DEFINES @@ -89,7 +89,7 @@ void lv_obj_add_style(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_ break; } - /*Now `i` is at the first normal style. Insert the new style before this */ + /*Now `i` is at the first normal style. Insert the new style before this*/ /*Allocate space for the new style and shift the rest of the style to the end*/ obj->style_list.style_cnt++; @@ -141,8 +141,8 @@ void lv_obj_remove_style(lv_obj_t * obj, uint32_t part, uint32_t state, lv_style obj->style_list.styles = lv_mem_realloc(obj->style_list.styles, obj->style_list.style_cnt * sizeof(lv_obj_style_t)); deleted = true; - /* The style from the current `i` index is removed, so `i` points to the next style. - * Therefore it doesn't needs to be incremented*/ + /*The style from the current `i` index is removed, so `i` points to the next style. + *Therefore it doesn't needs to be incremented*/ } if(deleted) { lv_obj_refresh_style(obj, part, LV_STYLE_PROP_ALL); @@ -266,7 +266,7 @@ void _lv_obj_style_create_transition(lv_obj_t * obj, lv_style_prop_t prop, uint8 obj->state = new_state; lv_obj_style_t * style_trans = get_trans_style(obj, part); - lv_style_set_prop(style_trans->style, prop, v1); /*Be sure `trans_style` has a valid value */ + lv_style_set_prop(style_trans->style, prop, v1); /*Be sure `trans_style` has a valid value*/ if(prop == LV_STYLE_RADIUS) { if(v1.num == LV_RADIUS_CIRCLE || v2.num == LV_RADIUS_CIRCLE) { @@ -419,8 +419,8 @@ static lv_style_t * get_local_style(lv_obj_t * obj, uint32_t part, uint32_t stat obj->style_list.styles = lv_mem_realloc(obj->style_list.styles, obj->style_list.style_cnt * sizeof(lv_obj_style_t)); for(i = obj->style_list.style_cnt - 1; i > 0 ; i--) { - /* Copy only normal styles (not local and transition). - * The new local style will be added as the last local style*/ + /*Copy only normal styles (not local and transition). + *The new local style will be added as the last local style*/ if(obj->style_list.styles[i - 1].is_local || obj->style_list.styles[i - 1].is_trans) break; obj->style_list.styles[i] = obj->style_list.styles[i - 1]; } @@ -497,8 +497,8 @@ static bool get_prop_core(const lv_obj_t * obj, uint8_t part, lv_style_prop_t pr if((obj_style->style->has_group & group) == 0) continue; - /* Be sure the style not specifies other state than the requested. - * E.g. For HOVER+PRESS object state, HOVER style only is OK, but HOVER+FOCUS style is not*/ + /*Be sure the style not specifies other state than the requested. + *E.g. For HOVER+PRESS object state, HOVER style only is OK, but HOVER+FOCUS style is not*/ if((obj_style->state & state_inv)) continue; /*Check only better candidates*/ @@ -598,8 +598,8 @@ static bool trans_del(lv_obj_t * obj, uint8_t part, lv_style_prop_t prop, trans_ tr_prev = _lv_ll_get_prev(&LV_GC_ROOT(_lv_obj_style_trans_ll), tr); if(tr->obj == obj && (part == tr->part || part == LV_PART_ANY) && (prop == tr->prop || prop == LV_STYLE_PROP_ALL)) { - /* Remove the transitioned property from trans. style - * to allow changing it by normal styles*/ + /*Remove the transitioned property from trans. style + *to allow changing it by normal styles*/ uint32_t i; for(i = 0; i < obj->style_list.style_cnt; i++) { if(obj->style_list.styles[i].is_trans && (part == LV_PART_ANY || obj->style_list.styles[i].part == part)) { @@ -695,7 +695,7 @@ static void trans_anim_start_cb(lv_anim_t * a) tr->prop = prop_tmp; lv_obj_style_t * style_trans = get_trans_style(tr->obj, tr->part); - lv_style_set_prop(style_trans->style, tr->prop, tr->start_value); /*Be sure `trans_style` has a valid value */ + lv_style_set_prop(style_trans->style, tr->prop, tr->start_value); /*Be sure `trans_style` has a valid value*/ } @@ -705,9 +705,9 @@ static void trans_anim_ready_cb(lv_anim_t * a) lv_obj_t * obj = tr->obj; lv_style_prop_t prop = tr->prop; - /* Remove the transitioned property from trans. style - * if there no more transitions for this property - * It allows changing it by normal styles*/ + /*Remove the transitioned property from trans. style + *if there no more transitions for this property + *It allows changing it by normal styles*/ bool running = false; trans_t * tr_i; _LV_LL_READ(&LV_GC_ROOT(_lv_obj_style_trans_ll), tr_i) { diff --git a/src/core/lv_obj_style.h b/src/core/lv_obj_style.h index 9ca13aeb3..91317d829 100644 --- a/src/core/lv_obj_style.h +++ b/src/core/lv_obj_style.h @@ -23,7 +23,7 @@ extern "C" { /********************** * TYPEDEFS **********************/ -/* Can't include lv_obj.h because it includes this header file */ +/*Can't include lv_obj.h because it includes this header file*/ struct _lv_obj_t; typedef enum { @@ -212,7 +212,7 @@ static inline void lv_obj_set_style_pad_gap(struct _lv_obj_t * obj, uint32_t par **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_TEMPL_H*/ diff --git a/src/core/lv_obj_tree.c b/src/core/lv_obj_tree.c index b0eb00a0d..688fb1e6a 100644 --- a/src/core/lv_obj_tree.c +++ b/src/core/lv_obj_tree.c @@ -19,7 +19,7 @@ #if defined(LV_USER_DATA_FREE_INCLUDE) #include LV_USER_DATA_FREE_INCLUDE -#endif /* LV_USE_USER_DATA_FREE */ +#endif /*LV_USE_USER_DATA_FREE*/ /********************** * TYPEDEFS @@ -349,7 +349,7 @@ static void obj_del_core(lv_obj_t * obj) lv_obj_remove_style(obj, LV_PART_ANY, LV_STATE_ANY, NULL); lv_obj_enable_style_refresh(true); - /* Reset all input devices if the object to delete is used*/ + /*Reset all input devices if the object to delete is used*/ lv_indev_t * indev = lv_indev_get_next(NULL); while(indev) { if(indev->proc.types.pointer.act_obj == obj || indev->proc.types.pointer.last_obj == obj) { @@ -365,7 +365,7 @@ static void obj_del_core(lv_obj_t * obj) indev = lv_indev_get_next(indev); } - /* All children deleted. Now clean up the object specific data*/ + /*All children deleted. Now clean up the object specific data*/ _lv_obj_destruct(obj); /*Remove the screen for the screen list*/ diff --git a/src/core/lv_obj_tree.h b/src/core/lv_obj_tree.h index 6d1f0ae54..2749ae90b 100644 --- a/src/core/lv_obj_tree.h +++ b/src/core/lv_obj_tree.h @@ -141,7 +141,7 @@ uint32_t lv_obj_get_child_id(const struct _lv_obj_t * obj); #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_OBJ_TREE_H*/ diff --git a/src/core/lv_refr.c b/src/core/lv_refr.c index f9a6cd25d..09b987f36 100644 --- a/src/core/lv_refr.c +++ b/src/core/lv_refr.c @@ -25,7 +25,7 @@ /********************* * DEFINES *********************/ -/* Draw translucent random colored areas on the invalidated (redrawn) areas*/ +/*Draw translucent random colored areas on the invalidated (redrawn) areas*/ #define MASK_AREA_DEBUG 0 /********************** @@ -192,7 +192,8 @@ void _lv_disp_refr_timer(lv_timer_t * tmr) disp_refr = tmr->user_data; #if LV_USE_PERF_MONITOR == 0 - /* Ensure the timer does not run again automatically. + /** + * Ensure the timer does not run again automatically. * This is done before refreshing in case refreshing invalidates something else. */ lv_timer_pause(tmr, true); @@ -561,8 +562,8 @@ static void lv_refr_area_part(const lv_area_t * area_p) lv_refr_obj_and_children(lv_disp_get_layer_top(disp_refr), &start_mask); lv_refr_obj_and_children(lv_disp_get_layer_sys(disp_refr), &start_mask); - /* In true double buffered mode flush only once when all areas were rendered. - * In normal mode flush after every area */ + /*In true double buffered mode flush only once when all areas were rendered. + *In normal mode flush after every area*/ if(lv_disp_is_true_double_buf(disp_refr) == false) { draw_buf_flush(); } @@ -578,7 +579,7 @@ static lv_obj_t * lv_refr_get_top_obj(const lv_area_t * area_p, lv_obj_t * obj) { lv_obj_t * found_p = NULL; - /*If this object is fully cover the draw area check the children too */ + /*If this object is fully cover the draw area check the children too*/ if(_lv_area_is_in(area_p, &obj->coords, 0) && lv_obj_has_flag(obj, LV_OBJ_FLAG_HIDDEN) == false) { lv_draw_res_t draw_res = call_draw_cb(obj, area_p, LV_DRAW_MODE_COVER_CHECK); if(draw_res == LV_DRAW_RES_MASKED) return NULL; @@ -622,16 +623,16 @@ static lv_obj_t * lv_refr_get_top_obj(const lv_area_t * area_p, lv_obj_t * obj) */ static void lv_refr_obj_and_children(lv_obj_t * top_p, const lv_area_t * mask_p) { - /* Normally always will be a top_obj (at least the screen) - * but in special cases (e.g. if the screen has alpha) it won't. - * In this case use the screen directly */ + /*Normally always will be a top_obj (at least the screen) + *but in special cases (e.g. if the screen has alpha) it won't. + *In this case use the screen directly*/ if(top_p == NULL) top_p = lv_disp_get_scr_act(disp_refr); if(top_p == NULL) return; /*Shouldn't happen*/ /*Refresh the top object and its children*/ lv_refr_obj(top_p, mask_p); - /*Draw the 'younger' sibling objects because they can be on top_obj */ + /*Draw the 'younger' sibling objects because they can be on top_obj*/ lv_obj_t * par; lv_obj_t * border_p = top_p; @@ -674,9 +675,9 @@ static void lv_refr_obj(lv_obj_t * obj, const lv_area_t * mask_ori_p) /*Do not refresh hidden objects*/ if(lv_obj_has_flag(obj, LV_OBJ_FLAG_HIDDEN)) return; - bool union_ok; /* Store the return value of area_union */ - /* Truncate the original mask to the coordinates of the parent - * because the parent and its children are visible only here */ + bool union_ok; /*Store the return value of area_union*/ + /*Truncate the original mask to the coordinates of the parent + *because the parent and its children are visible only here*/ lv_area_t obj_mask; lv_area_t obj_ext_mask; lv_area_t obj_area; @@ -690,7 +691,7 @@ static void lv_refr_obj(lv_obj_t * obj, const lv_area_t * mask_ori_p) /*Draw the parent and its children only if they ore on 'mask_parent'*/ if(union_ok != false) { - /* Redraw the object */ + /*Redraw the object*/ lv_event_send(obj, LV_EVENT_DRAW_MAIN_BEGIN, &obj_ext_mask); call_draw_cb(obj, &obj_ext_mask, LV_DRAW_MODE_MAIN_DRAW); lv_event_send(obj, LV_EVENT_DRAW_MAIN_END, &obj_ext_mask); @@ -721,11 +722,11 @@ static void lv_refr_obj(lv_obj_t * obj, const lv_area_t * mask_ori_p) child_area.y1 -= ext_size; child_area.x2 += ext_size; child_area.y2 += ext_size; - /* Get the union (common parts) of original mask (from obj) - * and its child */ + /*Get the union (common parts) of original mask (from obj) + *and its child*/ union_ok = _lv_area_intersect(&mask_child, &obj_mask, &child_area); - /*If the parent and the child has common area then refresh the child */ + /*If the parent and the child has common area then refresh the child*/ if(union_ok) { /*Refresh the next children*/ lv_refr_obj(child, &mask_child); @@ -733,7 +734,7 @@ static void lv_refr_obj(lv_obj_t * obj, const lv_area_t * mask_ori_p) } } - /* If all the children are redrawn make 'post draw' draw */ + /*If all the children are redrawn make 'post draw' draw*/ lv_event_send(obj, LV_EVENT_DRAW_POST_BEGIN, &obj_ext_mask); call_draw_cb(obj, &obj_ext_mask, LV_DRAW_MODE_POST_DRAW); lv_event_send(obj, LV_EVENT_DRAW_POST_END, &obj_ext_mask); @@ -744,7 +745,7 @@ static void draw_buf_rotate_180(lv_disp_drv_t *drv, lv_area_t *area, lv_color_t lv_coord_t area_w = lv_area_get_width(area); lv_coord_t area_h = lv_area_get_height(area); uint32_t total = area_w * area_h; - /* Swap the beginning and end values */ + /*Swap the beginning and end values*/ lv_color_t tmp; uint32_t i = total - 1, j = 0; while(i > j) { @@ -835,7 +836,7 @@ static void draw_buf_rotate(lv_area_t *area, lv_color_t *color_p) { draw_buf_rotate_180(drv, area, color_p); call_flush_cb(drv, area, color_p); } else if(drv->rotated == LV_DISP_ROT_90 || drv->rotated == LV_DISP_ROT_270) { - /*Allocate a temporary buffer to store rotated image */ + /*Allocate a temporary buffer to store rotated image*/ lv_color_t * rot_buf = NULL; lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp_refr); lv_coord_t area_w = lv_area_get_width(area); diff --git a/src/core/lv_refr.h b/src/core/lv_refr.h index 1bb1a6ee8..4ac3c2cf5 100644 --- a/src/core/lv_refr.h +++ b/src/core/lv_refr.h @@ -97,7 +97,7 @@ void _lv_disp_refr_timer(lv_timer_t * timer); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_REFR_H*/ diff --git a/src/core/lv_theme.h b/src/core/lv_theme.h index ae971f874..c46617db1 100644 --- a/src/core/lv_theme.h +++ b/src/core/lv_theme.h @@ -114,7 +114,7 @@ lv_color_t lv_theme_get_color_secondary(lv_obj_t * obj); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_THEME_H*/ diff --git a/src/draw/lv_draw.h b/src/draw/lv_draw.h index b3985f86c..d9e4cc5d6 100644 --- a/src/draw/lv_draw.h +++ b/src/draw/lv_draw.h @@ -53,7 +53,7 @@ extern "C" { *********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_DRAW_H*/ diff --git a/src/draw/lv_draw_arc.c b/src/draw/lv_draw_arc.c index 1e9940d7b..c95efac34 100644 --- a/src/draw/lv_draw_arc.c +++ b/src/draw/lv_draw_arc.c @@ -16,7 +16,7 @@ /********************* * DEFINES *********************/ -#define SPLIT_RADIUS_LIMIT 10 /*With radius greater then this the arc will drawn in quarters. A quarter is drawn only if there is arc in it */ +#define SPLIT_RADIUS_LIMIT 10 /*With radius greater then this the arc will drawn in quarters. A quarter is drawn only if there is arc in it*/ #define SPLIT_ANGLE_GAP_LIMIT 60 /*With small gaps in the arc don't bother with splitting because there is nothing to skip.*/ /********************** @@ -515,7 +515,7 @@ static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t thickness cir_x = ((radius - thick_half) * lv_trigo_sin(90 - angle)) >> (LV_TRIGO_SHIFT - ps); cir_y = ((radius - thick_half) * lv_trigo_sin(angle)) >> (LV_TRIGO_SHIFT - ps); - /* Actually the center of the pixel need to be calculated so apply 1/2 px offset*/ + /*Actually the center of the pixel need to be calculated so apply 1/2 px offset*/ if(cir_x > 0) { cir_x = (cir_x - pa) >> ps; res_area->x1 = cir_x - thick_half + thick_corr; diff --git a/src/draw/lv_draw_arc.h b/src/draw/lv_draw_arc.h index 885226e03..023ddefde 100644 --- a/src/draw/lv_draw_arc.h +++ b/src/draw/lv_draw_arc.h @@ -70,7 +70,7 @@ void lv_draw_arc_get_area(lv_coord_t x, lv_coord_t y, uint16_t radius, uint16_t **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_DRAW_ARC*/ diff --git a/src/draw/lv_draw_blend.c b/src/draw/lv_draw_blend.c index f1759d0e1..03fd31613 100644 --- a/src/draw/lv_draw_blend.c +++ b/src/draw/lv_draw_blend.c @@ -138,15 +138,15 @@ LV_ATTRIBUTE_FAST_MEM void _lv_blend_fill(const lv_area_t * clip_area, const lv_ if(disp->driver->gpu_wait_cb) disp->driver->gpu_wait_cb(disp->driver); - /* Get clipped fill area which is the real draw area. - * It is always the same or inside `fill_area` */ + /*Get clipped fill area which is the real draw area. + *It is always the same or inside `fill_area`*/ lv_area_t draw_area; bool is_common; is_common = _lv_area_intersect(&draw_area, clip_area, fill_area); if(!is_common) return; - /* Now `draw_area` has absolute coordinates. - * Make it relative to `disp_area` to simplify draw to `disp_buf`*/ + /*Now `draw_area` has absolute coordinates. + *Make it relative to `disp_area` to simplify draw to `disp_buf`*/ draw_area.x1 -= disp_area->x1; draw_area.y1 -= disp_area->y1; draw_area.x2 -= disp_area->x1; @@ -194,8 +194,8 @@ LV_ATTRIBUTE_FAST_MEM void _lv_blend_map(const lv_area_t * clip_area, const lv_a if(opa < LV_OPA_MIN) return; if(mask_res == LV_DRAW_MASK_RES_TRANSP) return; - /* Get clipped fill area which is the real draw area. - * It is always the same or inside `fill_area` */ + /*Get clipped fill area which is the real draw area. + *It is always the same or inside `fill_area`*/ lv_area_t draw_area; bool is_common; is_common = _lv_area_intersect(&draw_area, clip_area, map_area); @@ -208,8 +208,8 @@ LV_ATTRIBUTE_FAST_MEM void _lv_blend_map(const lv_area_t * clip_area, const lv_a if(disp->driver->gpu_wait_cb) disp->driver->gpu_wait_cb(disp->driver); - /* Now `draw_area` has absolute coordinates. - * Make it relative to `disp_area` to simplify draw to `disp_buf`*/ + /*Now `draw_area` has absolute coordinates. + *Make it relative to `disp_area` to simplify draw to `disp_buf`*/ draw_area.x1 -= disp_area->x1; draw_area.y1 -= disp_area->y1; draw_area.x2 -= disp_area->x1; @@ -260,9 +260,9 @@ static void fill_set_px(const lv_area_t * disp_area, lv_color_t * disp_buf, con } } else { - /* The mask is relative to the clipped area. - * In the cycles below mask will be indexed from `draw_area.x1` - * but it corresponds to zero index. So prepare `mask_tmp` accordingly. */ + /*The mask is relative to the clipped area. + *In the cycles below mask will be indexed from `draw_area.x1` + *but it corresponds to zero index. So prepare `mask_tmp` accordingly.*/ const lv_opa_t * mask_tmp = mask - draw_area->x1; /*Get the width of the `draw_area` it will be used to go to the next line of the mask*/ @@ -326,7 +326,7 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co if(lv_gpu_nxp_vglite_fill(disp_buf, disp_w, lv_area_get_height(disp_area), draw_area, color, opa) == LV_RES_OK) { return; } - /* Fall down to SW render in case of error */ + /*Fall down to SW render in case of error*/ } #elif LV_USE_GPU_STM32_DMA2D if(lv_area_get_size(draw_area) >= 240) { @@ -358,7 +358,7 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co if(lv_gpu_nxp_vglite_fill(disp_buf, disp_w, lv_area_get_height(disp_area), draw_area, color, opa) == LV_RES_OK) { return; } - /* Fall down to SW render in case of error */ + /*Fall down to SW render in case of error*/ } #endif lv_color_t last_dest_color = lv_color_black(); @@ -558,9 +558,9 @@ static void fill_blended(const lv_area_t * disp_area, lv_color_t * disp_buf, co /*Get the width of the `draw_area` it will be used to go to the next line of the mask*/ int32_t draw_area_w = lv_area_get_width(draw_area); - /* The mask is relative to the clipped area. - * In the cycles below mask will be indexed from `draw_area.x1` - * but it corresponds to zero index. So prepare `mask_tmp` accordingly. */ + /*The mask is relative to the clipped area. + *In the cycles below mask will be indexed from `draw_area.x1` + *but it corresponds to zero index. So prepare `mask_tmp` accordingly.*/ const lv_opa_t * mask_tmp = mask - draw_area->x1; /*Buffer the result color to avoid recalculating the same color*/ @@ -622,9 +622,9 @@ static void map_set_px(const lv_area_t * disp_area, lv_color_t * disp_buf, cons } } else { - /* The mask is relative to the clipped area. - * In the cycles below mask will be indexed from `draw_area.x1` - * but it corresponds to zero index. So prepare `mask_tmp` accordingly. */ + /*The mask is relative to the clipped area. + *In the cycles below mask will be indexed from `draw_area.x1` + *but it corresponds to zero index. So prepare `mask_tmp` accordingly.*/ const lv_opa_t * mask_tmp = mask - draw_area->x1; for(y = draw_area->y1; y <= draw_area->y2; y++) { @@ -718,7 +718,7 @@ LV_ATTRIBUTE_FAST_MEM static void map_normal(const lv_area_t * disp_area, lv_col if(lv_gpu_nxp_vglite_blit(&blit) == LV_RES_OK) { return; } - /* Fall down to SW render in case of error */ + /*Fall down to SW render in case of error*/ } #elif LV_USE_GPU_STM32_DMA2D if(lv_area_get_size(draw_area) >= 240) { @@ -768,7 +768,7 @@ LV_ATTRIBUTE_FAST_MEM static void map_normal(const lv_area_t * disp_area, lv_col if(lv_gpu_nxp_vglite_blit(&blit) == LV_RES_OK) { return; } - /* Fall down to SW render in case of error */ + /*Fall down to SW render in case of error*/ } #elif LV_USE_GPU_STM32_DMA2D if(lv_area_get_size(draw_area) >= 240) { @@ -801,7 +801,7 @@ LV_ATTRIBUTE_FAST_MEM static void map_normal(const lv_area_t * disp_area, lv_col else { /*Only the mask matters*/ if(opa > LV_OPA_MAX) { - /*Go to the first pixel of the row */ + /*Go to the first pixel of the row*/ int32_t x_end4 = draw_area_w - 4; @@ -941,9 +941,9 @@ static void map_blended(const lv_area_t * disp_area, lv_color_t * disp_buf, con } /*Masked*/ else { - /* The mask is relative to the clipped area. - * In the cycles below mask will be indexed from `draw_area.x1` - * but it corresponds to zero index. So prepare `mask_tmp` accordingly. */ + /*The mask is relative to the clipped area. + *In the cycles below mask will be indexed from `draw_area.x1` + *but it corresponds to zero index. So prepare `mask_tmp` accordingly.*/ const lv_opa_t * mask_tmp = mask - draw_area->x1; map_buf_tmp -= draw_area->x1; diff --git a/src/draw/lv_draw_blend.h b/src/draw/lv_draw_blend.h index fb1f9f8d6..a2002f628 100644 --- a/src/draw/lv_draw_blend.h +++ b/src/draw/lv_draw_blend.h @@ -44,7 +44,7 @@ LV_ATTRIBUTE_FAST_MEM void _lv_blend_map(const lv_area_t * clip_area, const lv_a **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_DRAW_BLEND_H*/ diff --git a/src/draw/lv_draw_img.c b/src/draw/lv_draw_img.c index 7dde8cd4f..8209575bd 100644 --- a/src/draw/lv_draw_img.c +++ b/src/draw/lv_draw_img.c @@ -248,8 +248,8 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords, show_error(coords, clip_area, cdsc->dec_dsc.error_msg); } - /* The decoder could open the image and gave the entire uncompressed image. - * Just draw it!*/ + /*The decoder could open the image and gave the entire uncompressed image. + *Just draw it!*/ else if(cdsc->dec_dsc.img_data) { lv_area_t map_area_rot; lv_area_copy(&map_area_rot, coords); @@ -276,7 +276,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_res_t lv_img_draw_core(const lv_area_t * coords, lv_draw_map(coords, &mask_com, cdsc->dec_dsc.img_data, draw_dsc, chroma_keyed, alpha_byte); } - /* The whole uncompressed image is not available. Try to read it line-by-line*/ + /*The whole uncompressed image is not available. Try to read it line-by-line*/ else { lv_area_t mask_com; /*Common area of mask and coords*/ bool union_ok; @@ -339,7 +339,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const const lv_draw_img_dsc_t * draw_dsc, bool chroma_key, bool alpha_byte) { - /* Use the clip area as draw area*/ + /*Use the clip area as draw area*/ lv_area_t draw_area; lv_area_copy(&draw_area, clip_area); @@ -347,8 +347,8 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp); const lv_area_t * disp_area = &draw_buf->area; - /* Now `draw_area` has absolute coordinates. - * Make it relative to `disp_area` to simplify draw to `disp_buf`*/ + /*Now `draw_area` has absolute coordinates. + *Make it relative to `disp_area` to simplify draw to `disp_buf`*/ draw_area.x1 -= disp_area->x1; draw_area.y1 -= disp_area->y1; draw_area.x2 -= disp_area->x1; @@ -365,16 +365,16 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const #if LV_DRAW_COMPLEX #if LV_USE_GPU_NXP_PXP - /* Simple case without masking and transformations */ + /*Simple case without masking and transformations*/ else if(other_mask_cnt == 0 && draw_dsc->angle == 0 && draw_dsc->zoom == LV_IMG_ZOOM_NONE && alpha_byte == false && - chroma_key == true && draw_dsc->recolor_opa == LV_OPA_TRANSP) { /* copy with color keying (+ alpha) */ + chroma_key == true && draw_dsc->recolor_opa == LV_OPA_TRANSP) { /*copy with color keying (+ alpha)*/ lv_gpu_nxp_pxp_enable_color_key(); _lv_blend_map(clip_area, map_area, (lv_color_t *)map_p, NULL, LV_DRAW_MASK_RES_FULL_COVER, draw_dsc->opa, draw_dsc->blend_mode); lv_gpu_nxp_pxp_disable_color_key(); } else if(other_mask_cnt == 0 && draw_dsc->angle == 0 && draw_dsc->zoom == LV_IMG_ZOOM_NONE && alpha_byte == false && - chroma_key == false && draw_dsc->recolor_opa != LV_OPA_TRANSP) { /* copy with recolor (+ alpha) */ + chroma_key == false && draw_dsc->recolor_opa != LV_OPA_TRANSP) { /*copy with recolor (+ alpha)*/ lv_gpu_nxp_pxp_enable_recolor(draw_dsc->recolor, draw_dsc->recolor_opa); _lv_blend_map(clip_area, map_area, (lv_color_t *)map_p, NULL, LV_DRAW_MASK_RES_FULL_COVER, draw_dsc->opa, draw_dsc->blend_mode); diff --git a/src/draw/lv_draw_img.h b/src/draw/lv_draw_img.h index 13e97a81c..894e91fc4 100644 --- a/src/draw/lv_draw_img.h +++ b/src/draw/lv_draw_img.h @@ -90,7 +90,7 @@ bool lv_img_cf_is_chroma_keyed(lv_img_cf_t cf); bool lv_img_cf_has_alpha(lv_img_cf_t cf); #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_DRAW_IMG_H*/ diff --git a/src/draw/lv_draw_label.c b/src/draw/lv_draw_label.c index fdadbe81f..8f10d81b8 100644 --- a/src/draw/lv_draw_label.c +++ b/src/draw/lv_draw_label.c @@ -274,10 +274,10 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(const lv_area_t * coords, const lv_area cmd_state = CMD_STATE_PAR; continue; } - else if(cmd_state == CMD_STATE_PAR) { /*Other start char in parameter escaped cmd. char */ + else if(cmd_state == CMD_STATE_PAR) { /*Other start char in parameter escaped cmd. char*/ cmd_state = CMD_STATE_WAIT; } - else if(cmd_state == CMD_STATE_IN) { /*Command end */ + else if(cmd_state == CMD_STATE_IN) { /*Command end*/ cmd_state = CMD_STATE_WAIT; continue; } @@ -413,21 +413,21 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_letter(const lv_point_t * pos_p, const lv_font_glyph_dsc_t g; bool g_ret = lv_font_get_glyph_dsc(font_p, &g, letter, '\0'); if(g_ret == false) { - /* Add warning if the dsc is not found - * but do not print warning for non printable ASCII chars (e.g. '\n')*/ + /*Add warning if the dsc is not found + *but do not print warning for non printable ASCII chars (e.g. '\n')*/ if(letter >= 0x20) { LV_LOG_WARN("lv_draw_letter: glyph dsc. not found"); } return; } - /* Don't draw anything if the character is empty. E.g. space */ + /*Don't draw anything if the character is empty. E.g. space*/ if((g.box_h == 0) || (g.box_w == 0)) return; int32_t pos_x = pos_p->x + g.ofs_x; int32_t pos_y = pos_p->y + (font_p->line_height - font_p->base_line) - g.box_h - g.ofs_y; - /*If the letter is completely out of mask don't draw it */ + /*If the letter is completely out of mask don't draw it*/ if(pos_x + g.box_w < clip_area->x1 || pos_x > clip_area->x2 || pos_y + g.box_h < clip_area->y1 || @@ -509,7 +509,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_ int32_t box_h = g->box_h; int32_t width_bit = box_w * bpp; /*Letter width in bits*/ - /* Calculate the col/row start/end on the map*/ + /*Calculate the col/row start/end on the map*/ int32_t col_start = pos_x >= clip_area->x1 ? 0 : clip_area->x1 - pos_x; int32_t col_end = pos_x + box_w <= clip_area->x2 ? box_w : clip_area->x2 - pos_x + 1; int32_t row_start = pos_y >= clip_area->y1 ? 0 : clip_area->y1 - pos_y; @@ -521,7 +521,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_coord_t pos_x, lv_coord_ uint8_t letter_px; uint32_t col_bit; - col_bit = bit_ofs & 0x7; /* "& 0x7" equals to "% 8" just faster */ + col_bit = bit_ofs & 0x7; /*"& 0x7" equals to "% 8" just faster*/ lv_coord_t hor_res = lv_disp_get_hor_res(_lv_refr_get_disp_refreshing()); uint32_t mask_buf_size = box_w * box_h > hor_res ? hor_res : box_w * box_h; @@ -649,7 +649,7 @@ static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_ int32_t box_h = g->box_h; int32_t width_bit = box_w * bpp; /*Letter width in bits*/ - /* Calculate the col/row start/end on the map*/ + /*Calculate the col/row start/end on the map*/ int32_t col_start = pos_x >= clip_area->x1 ? 0 : (clip_area->x1 - pos_x) * 3; int32_t col_end = pos_x + box_w / 3 <= clip_area->x2 ? box_w : (clip_area->x2 - pos_x + 1) * 3; int32_t row_start = pos_y >= clip_area->y1 ? 0 : clip_area->y1 - pos_y; @@ -662,7 +662,7 @@ static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_ uint8_t letter_px; lv_opa_t px_opa; int32_t col_bit; - col_bit = bit_ofs & 0x7; /* "& 0x7" equals to "% 8" just faster */ + col_bit = bit_ofs & 0x7; /*"& 0x7" equals to "% 8" just faster*/ int32_t mask_buf_size = box_w * box_h > _LV_MASK_BUF_MAX_SIZE ? _LV_MASK_BUF_MAX_SIZE : g->box_w * g->box_h; lv_opa_t * mask_buf = lv_mem_buf_get(mask_buf_size); diff --git a/src/draw/lv_draw_label.h b/src/draw/lv_draw_label.h index cf8357755..90f93080f 100644 --- a/src/draw/lv_draw_label.h +++ b/src/draw/lv_draw_label.h @@ -59,7 +59,7 @@ typedef struct { int32_t y; /** The 'y1' coordinate of the label when the hint was saved. - * Used to invalidate the hint if the label has moved too much. */ + * Used to invalidate the hint if the label has moved too much.*/ int32_t coord_y; } lv_draw_label_hint_t; @@ -99,7 +99,7 @@ extern const uint8_t _lv_bpp8_opa_table[]; **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_DRAW_LABEL_H*/ diff --git a/src/draw/lv_draw_line.c b/src/draw/lv_draw_line.c index 46c3fb043..23b610209 100644 --- a/src/draw/lv_draw_line.c +++ b/src/draw/lv_draw_line.c @@ -152,14 +152,14 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_hor(const lv_point_t * point1, const lv_disp_t * disp = _lv_refr_get_disp_refreshing(); lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp); const lv_area_t * disp_area = &draw_buf->area; - /* Get clipped fill area which is the real draw area. - * It is always the same or inside `fill_area` */ + /*Get clipped fill area which is the real draw area. + *It is always the same or inside `fill_area`*/ bool is_common; is_common = _lv_area_intersect(&draw_area, clip, &draw_area); if(!is_common) return; - /* Now `draw_area` has absolute coordinates. - * Make it relative to `disp_area` to simplify draw to `disp_buf`*/ + /*Now `draw_area` has absolute coordinates. + *Make it relative to `disp_area` to simplify draw to `disp_buf`*/ draw_area.x1 -= disp_area->x1; draw_area.y1 -= disp_area->y1; draw_area.x2 -= disp_area->x1; @@ -253,14 +253,14 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const lv_disp_t * disp = _lv_refr_get_disp_refreshing(); lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp); const lv_area_t * disp_area = &draw_buf->area; - /* Get clipped fill area which is the real draw area. - * It is always the same or inside `fill_area` */ + /*Get clipped fill area which is the real draw area. + *It is always the same or inside `fill_area`*/ bool is_common; is_common = _lv_area_intersect(&draw_area, clip, &draw_area); if(!is_common) return; - /* Now `draw_area` has absolute coordinates. - * Make it relative to `disp_area` to simplify draw to `disp_buf`*/ + /*Now `draw_area` has absolute coordinates. + *Make it relative to `disp_area` to simplify draw to `disp_buf`*/ draw_area.x1 -= draw_buf->area.x1; draw_area.y1 -= draw_buf->area.y1; draw_area.x2 -= draw_buf->area.x1; @@ -361,9 +361,9 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, cons draw_area.y1 = LV_MIN(p1.y, p2.y) - w; draw_area.y2 = LV_MAX(p1.y, p2.y) + w; - /* Get the union of `coords` and `clip`*/ - /* `clip` is already truncated to the `draw_buf` size - * in 'lv_refr_area' function */ + /*Get the union of `coords` and `clip`*/ + /*`clip` is already truncated to the `draw_buf` size + *in 'lv_refr_area' function*/ bool is_common = _lv_area_intersect(&draw_area, &draw_area, clip); if(is_common == false) return; @@ -412,15 +412,15 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, cons const lv_area_t * disp_area = &draw_buf->area; - /*Store the coordinates of the `draw_a` relative to the draw_buf */ + /*Store the coordinates of the `draw_a` relative to the draw_buf*/ draw_area.x1 -= disp_area->x1; draw_area.y1 -= disp_area->y1; draw_area.x2 -= disp_area->x1; draw_area.y2 -= disp_area->y1; - /* The real draw area is around the line. - * It's easy to calculate with steep lines, but the area can be very wide with very flat lines. - * So deal with it only with steep lines. */ + /*The real draw area is around the line. + *It's easy to calculate with steep lines, but the area can be very wide with very flat lines. + *So deal with it only with steep lines.*/ int32_t draw_area_w = lv_area_get_width(&draw_area); /*Draw the background line by line*/ diff --git a/src/draw/lv_draw_line.h b/src/draw/lv_draw_line.h index 26a449121..660c765a6 100644 --- a/src/draw/lv_draw_line.h +++ b/src/draw/lv_draw_line.h @@ -58,7 +58,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_DRAW_LINE_H*/ diff --git a/src/draw/lv_draw_mask.c b/src/draw/lv_draw_mask.c index 73ecef52f..cebec442d 100644 --- a/src/draw/lv_draw_mask.c +++ b/src/draw/lv_draw_mask.c @@ -282,10 +282,10 @@ void lv_draw_mask_line_points_init(lv_draw_mask_line_param_t * param, lv_coord_t void lv_draw_mask_line_angle_init(lv_draw_mask_line_param_t * param, lv_coord_t p1x, lv_coord_t py, int16_t angle, lv_draw_mask_line_side_t side) { - /* Find an optimal degree. - * lv_mask_line_points_init will swap the points to keep the smaller y in p1 - * Theoretically a line with `angle` or `angle+180` is the same only the points are swapped - * Find the degree which keeps the origo in place */ + /*Find an optimal degree. + *lv_mask_line_points_init will swap the points to keep the smaller y in p1 + *Theoretically a line with `angle` or `angle+180` is the same only the points are swapped + *Find the degree which keeps the origo in place*/ if(angle > 180) angle -= 180; /*> 180 will swap the origo*/ int32_t p2x; @@ -311,7 +311,7 @@ void lv_draw_mask_angle_init(lv_draw_mask_angle_param_t * param, lv_coord_t vert lv_draw_mask_line_side_t start_side; lv_draw_mask_line_side_t end_side; - /* Constrain the input angles */ + /*Constrain the input angles*/ if(start_angle < 0) start_angle = 0; else if(start_angle > 359) @@ -345,7 +345,7 @@ void lv_draw_mask_angle_init(lv_draw_mask_angle_param_t * param, lv_coord_t vert start_side = LV_DRAW_MASK_LINE_SIDE_RIGHT; } else - start_side = LV_DRAW_MASK_LINE_SIDE_RIGHT; /* silence compiler */ + start_side = LV_DRAW_MASK_LINE_SIDE_RIGHT; /*silence compiler*/ LV_ASSERT_MSG(end_angle >= 0 && start_angle <= 360, "Unexpected end angle"); @@ -356,7 +356,7 @@ void lv_draw_mask_angle_init(lv_draw_mask_angle_param_t * param, lv_coord_t vert end_side = LV_DRAW_MASK_LINE_SIDE_LEFT; } else - end_side = LV_DRAW_MASK_LINE_SIDE_RIGHT; /* silence compiler */ + end_side = LV_DRAW_MASK_LINE_SIDE_RIGHT; /*silence compiler*/ lv_draw_mask_line_angle_init(¶m->start_line, vertex_x, vertex_y, start_angle, start_side); lv_draw_mask_line_angle_init(¶m->end_line, vertex_x, vertex_y, end_angle, end_side); @@ -514,8 +514,8 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_flat(lv_opa_t * mask_b } } - /* At the end of the mask if the limit line is smaller then the mask's y. - * Then the mask is in the "good" area*/ + /*At the end of the mask if the limit line is smaller then the mask's y. + *Then the mask is in the "good" area*/ y_at_x = (int32_t)((int32_t)p->yx_steep * (abs_x + len)) >> 10; if(p->yx_steep > 0) { if(y_at_x < abs_y) { @@ -607,8 +607,8 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_steep(lv_opa_t * mask_ { int32_t k; int32_t x_at_y; - /* At the beginning of the mask if the limit line is greater then the mask's y. - * Then the mask is in the "wrong" area*/ + /*At the beginning of the mask if the limit line is greater then the mask's y. + *Then the mask is in the "wrong" area*/ x_at_y = (int32_t)((int32_t)p->xy_steep * abs_y) >> 10; if(p->xy_steep > 0) x_at_y++; if(x_at_y < abs_x) { @@ -620,8 +620,8 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_steep(lv_opa_t * mask_ } } - /* At the end of the mask if the limit line is smaller then the mask's y. - * Then the mask is in the "good" area*/ + /*At the end of the mask if the limit line is smaller then the mask's y. + *Then the mask is in the "good" area*/ x_at_y = (int32_t)((int32_t)p->xy_steep * (abs_y)) >> 10; if(x_at_y > abs_x + len) { if(p->inv) { @@ -758,7 +758,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * ma return LV_DRAW_MASK_RES_FULL_COVER; } - /*Start angle mask can work only from the end of end angle mask */ + /*Start angle mask can work only from the end of end angle mask*/ int32_t end_angle_first = (rel_y * p->end_line.xy_steep) >> 10; int32_t start_angle_last = ((rel_y + 1) * p->start_line.xy_steep) >> 10; @@ -800,7 +800,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * ma return LV_DRAW_MASK_RES_FULL_COVER; } - /*Start angle mask can work only from the end of end angle mask */ + /*Start angle mask can work only from the end of end angle mask*/ int32_t end_angle_first = (rel_y * p->end_line.xy_steep) >> 10; int32_t start_angle_last = ((rel_y + 1) * p->start_line.xy_steep) >> 10; @@ -950,14 +950,14 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m lv_sqrt_res_t x0; lv_sqrt_res_t x1; - /* y = 0 should mean the top of the circle */ + /*y = 0 should mean the top of the circle*/ int32_t y; if(abs_y < radius) { y = radius - abs_y; - /* Get the x intersection points for `abs_y` and `abs_y-1` - * Use the circle's equation x = sqrt(r^2 - y^2) - * Try to use the values from the previous run*/ + /*Get the x intersection points for `abs_y` and `abs_y-1` + *Use the circle's equation x = sqrt(r^2 - y^2) + *Try to use the values from the previous run*/ if(y == p->y_prev) { x0.f = p->y_prev_x.f; x0.i = p->y_prev_x.i; @@ -973,9 +973,9 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m else { y = radius - (h - abs_y) + 1; - /* Get the x intersection points for `abs_y` and `abs_y-1` - * Use the circle's equation x = sqrt(r^2 - y^2) - * Try to use the values from the previous run*/ + /*Get the x intersection points for `abs_y` and `abs_y-1` + *Use the circle's equation x = sqrt(r^2 - y^2) + *Try to use the values from the previous run*/ if((y - 1) == p->y_prev) { x1.f = p->y_prev_x.f; x1.i = p->y_prev_x.i; @@ -990,8 +990,8 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m p->y_prev_x.i = x0.i; } - /* If x1 is on the next round coordinate (e.g. x0: 3.5, x1:4.0) - * then treat x1 as x1: 3.99 to handle them as they were on the same pixel*/ + /*If x1 is on the next round coordinate (e.g. x0: 3.5, x1:4.0) + *then treat x1 as x1: 3.99 to handle them as they were on the same pixel*/ if(x0.i == x1.i - 1 && x1.f == 0) { x1.i--; x1.f = 0xFF; @@ -1089,8 +1089,8 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m /*Set all points which are crossed by the circle*/ for(; i <= x1.i; i++) { - /* These values are very close to each other. It's enough to approximate sqrt - * The non-approximated version is lv_sqrt(r2 - (i * i), &y_next, sqrt_mask); */ + /*These values are very close to each other. It's enough to approximate sqrt + *The non-approximated version is lv_sqrt(r2 - (i * i), &y_next, sqrt_mask);*/ sqrt_approx(&y_next, &y_prev, r2 - (i * i)); m = (y_prev.f + y_next.f) >> 1; diff --git a/src/draw/lv_draw_mask.h b/src/draw/lv_draw_mask.h index a0be7d8dd..d663fe0b1 100644 --- a/src/draw/lv_draw_mask.h +++ b/src/draw/lv_draw_mask.h @@ -99,7 +99,7 @@ typedef struct { lv_draw_mask_common_dsc_t dsc; struct { - /*First point */ + /*First point*/ lv_point_t p1; /*Second point*/ @@ -112,23 +112,23 @@ typedef struct { /*A point of the line*/ lv_point_t origo; - /* X / (1024*Y) steepness (X is 0..1023 range). What is the change of X in 1024 Y?*/ + /*X / (1024*Y) steepness (X is 0..1023 range). What is the change of X in 1024 Y?*/ int32_t xy_steep; - /* Y / (1024*X) steepness (Y is 0..1023 range). What is the change of Y in 1024 X?*/ + /*Y / (1024*X) steepness (Y is 0..1023 range). What is the change of Y in 1024 X?*/ int32_t yx_steep; - /*Helper which stores yx_steep for flat lines and xy_steep for steep (non flat) lines */ + /*Helper which stores yx_steep for flat lines and xy_steep for steep (non flat) lines*/ int32_t steep; - /*Steepness in 1 px in 0..255 range. Used only by flat lines. */ + /*Steepness in 1 px in 0..255 range. Used only by flat lines.*/ int32_t spx; /*1: It's a flat line? (Near to horizontal)*/ uint8_t flat : 1; - /* Invert the mask. The default is: Keep the left part. - * It is used to select left/right/top/bottom*/ + /*Invert the mask. The default is: Keep the left part. + *It is used to select left/right/top/bottom*/ uint8_t inv: 1; } lv_draw_mask_line_param_t; @@ -154,7 +154,7 @@ typedef struct { struct { lv_area_t rect; lv_coord_t radius; - /* Invert the mask. 0: Keep the pixels inside.*/ + /*Invert the mask. 0: Keep the pixels inside.*/ uint8_t outer: 1; } cfg; int32_t y_prev; @@ -318,7 +318,7 @@ void lv_draw_mask_map_init(lv_draw_mask_map_param_t * param, const lv_area_t * c **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_DRAW_MASK_H*/ diff --git a/src/draw/lv_draw_rect.c b/src/draw/lv_draw_rect.c index d2fa9b442..afa320c1e 100644 --- a/src/draw/lv_draw_rect.c +++ b/src/draw/lv_draw_rect.c @@ -142,8 +142,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are lv_disp_t * disp = _lv_refr_get_disp_refreshing(); lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp); - /* Get clipped fill area which is the real draw area. - * It is always the same or inside `fill_area` */ + /*Get clipped fill area which is the real draw area. + *It is always the same or inside `fill_area`*/ lv_area_t draw_area; bool is_common; is_common = _lv_area_intersect(&draw_area, &coords_bg, clip); @@ -151,8 +151,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are const lv_area_t * disp_area = &draw_buf->area; - /* Now `draw_area` has absolute coordinates. - * Make it relative to `disp_area` to simplify draw to `disp_buf`*/ + /*Now `draw_area` has absolute coordinates. + *Make it relative to `disp_area` to simplify draw to `disp_buf`*/ draw_area.x1 -= disp_area->x1; draw_area.y1 -= disp_area->y1; draw_area.x2 -= disp_area->x1; @@ -251,8 +251,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are grad_color = grad_get(dsc, lv_area_get_height(&coords_bg), y - coords_bg.y1); } - /* If there is not other mask and drawing the corner area split the drawing to corner and middle areas - * because it the middle mask shouldn't be taken into account (therefore its faster)*/ + /*If there is not other mask and drawing the corner area split the drawing to corner and middle areas + *because it the middle mask shouldn't be taken into account (therefore its faster)*/ if(simple_mode && split && (y < coords_bg.y1 + rout + 1 || y > coords_bg.y2 - rout - 1)) { @@ -423,8 +423,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv lv_disp_t * disp = _lv_refr_get_disp_refreshing(); lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp); - /* Get clipped fill area which is the real draw area. - * It is always the same or inside `fill_area` */ + /*Get clipped fill area which is the real draw area. + *It is always the same or inside `fill_area`*/ lv_area_t draw_area; bool is_common; is_common = _lv_area_intersect(&draw_area, coords, clip); @@ -432,8 +432,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv const lv_area_t * disp_area = &draw_buf->area; - /* Now `draw_area` has absolute coordinates. - * Make it relative to `disp_area` to simplify draw to `disp_buf`*/ + /*Now `draw_area` has absolute coordinates. + *Make it relative to `disp_area` to simplify draw to `disp_buf`*/ draw_area.x1 -= disp_area->x1; draw_area.y1 -= disp_area->y1; draw_area.x2 -= disp_area->x1; @@ -554,8 +554,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv lv_disp_t * disp = _lv_refr_get_disp_refreshing(); lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp); - /* Get clipped fill area which is the real draw area. - * It is always the same or inside `fill_area` */ + /*Get clipped fill area which is the real draw area. + *It is always the same or inside `fill_area`*/ lv_area_t draw_area; bool is_common; is_common = _lv_area_intersect(&draw_area, &sh_area, clip); @@ -563,8 +563,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv const lv_area_t * disp_area = &draw_buf->area; - /* Now `draw_area` has absolute coordinates. - * Make it relative to `disp_area` to simplify draw to `disp_buf`*/ + /*Now `draw_area` has absolute coordinates. + *Make it relative to `disp_area` to simplify draw to `disp_buf`*/ draw_area.x1 -= disp_area->x1; draw_area.y1 -= disp_area->y1; draw_area.x2 -= disp_area->x1; @@ -598,7 +598,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv lv_memcpy(sh_buf, sh_cache, corner_size * corner_size); } else { - /*A larger buffer is required for calculation */ + /*A larger buffer is required for calculation*/ sh_buf = lv_mem_buf_get(corner_size * corner_size * sizeof(uint16_t)); shadow_draw_corner_buf(&sh_rect_area, (uint16_t *)sh_buf, dsc->shadow_width, r_sh); @@ -1288,8 +1288,8 @@ static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * are lv_disp_t * disp = _lv_refr_get_disp_refreshing(); lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp); - /* Get clipped fill area which is the real draw area. - * It is always the same or inside `fill_area` */ + /*Get clipped fill area which is the real draw area. + *It is always the same or inside `fill_area`*/ lv_area_t draw_area; bool is_common; is_common = _lv_area_intersect(&draw_area, area_outer, clip); @@ -1297,8 +1297,8 @@ static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * are const lv_area_t * disp_area = &draw_buf->area; - /* Now `draw_area` has absolute coordinates. - * Make it relative to `disp_area` to simplify draw to `disp_buf`*/ + /*Now `draw_area` has absolute coordinates. + *Make it relative to `disp_area` to simplify draw to `disp_buf`*/ draw_area.x1 -= disp_area->x1; draw_area.y1 -= disp_area->y1; draw_area.x2 -= disp_area->x1; @@ -1364,7 +1364,7 @@ static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * are fill_area.y2++; } - /*Draw the lower corner area */ + /*Draw the lower corner area*/ int32_t lower_corner_end = area_outer->y2 - disp_area->y1 - corner_size; if(lower_corner_end <= upper_corner_end) lower_corner_end = upper_corner_end + 1; fill_area.y1 = disp_area->y1 + lower_corner_end; diff --git a/src/draw/lv_draw_rect.h b/src/draw/lv_draw_rect.h index a6203c73d..06cc47c27 100644 --- a/src/draw/lv_draw_rect.h +++ b/src/draw/lv_draw_rect.h @@ -50,7 +50,7 @@ typedef struct { lv_color_t border_color; lv_coord_t border_width; lv_opa_t border_opa; - uint8_t border_post : 1; /*There is a border it will be drawn later. */ + uint8_t border_post : 1; /*There is a border it will be drawn later.*/ lv_border_side_t border_side :5; /*Outline*/ @@ -109,7 +109,7 @@ void lv_draw_rect(const lv_area_t * coords, const lv_area_t * mask, const lv_dra **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_DRAW_RECT_H*/ diff --git a/src/draw/lv_draw_triangle.c b/src/draw/lv_draw_triangle.c index 4ed514cce..447e1e10c 100644 --- a/src/draw/lv_draw_triangle.c +++ b/src/draw/lv_draw_triangle.c @@ -78,7 +78,7 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are pcnt++; } } - /*The first and the last points are also adjacent */ + /*The first and the last points are also adjacent*/ if(points[0].x != points[point_cnt - 1].x || points[0].y != points[point_cnt - 1].y) { p[pcnt] = points[point_cnt - 1]; pcnt++; @@ -133,7 +133,8 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are i_next_right = y_min_i + 1; if(i_next_right > point_cnt - 1) i_next_right = 0; - /* Check if the order of points is inverted or not. + /** + * Check if the order of points is inverted or not. * The normal case is when the left point is on `y_min_i - 1` * Explanation: * if angle(p_left) < angle(p_right) -> inverted diff --git a/src/draw/lv_draw_triangle.h b/src/draw/lv_draw_triangle.h index 64a7b1c81..5a16585a1 100644 --- a/src/draw/lv_draw_triangle.h +++ b/src/draw/lv_draw_triangle.h @@ -50,7 +50,7 @@ void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_are **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_DRAW_TRIANGLE_H*/ diff --git a/src/draw/lv_img_buf.c b/src/draw/lv_img_buf.c index ba07ad1a7..e01c77313 100644 --- a/src/draw/lv_img_buf.c +++ b/src/draw/lv_img_buf.c @@ -67,9 +67,9 @@ lv_color_t lv_img_buf_get_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t uint8_t bit = x & 0x7; x = x >> 3; - /* Get the current pixel. - * dsc->header.w + 7 means rounding up to 8 because the lines are byte aligned - * so the possible real width are 8, 16, 24 ...*/ + /*Get the current pixel. + *dsc->header.w + 7 means rounding up to 8 because the lines are byte aligned + *so the possible real width are 8, 16, 24 ...*/ uint32_t px = ((dsc->header.w + 7) >> 3) * y + x; p_color.full = (buf_u8[px] & (1 << (7 - bit))) >> (7 - bit); } @@ -78,9 +78,9 @@ lv_color_t lv_img_buf_get_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t uint8_t bit = (x & 0x3) * 2; x = x >> 2; - /* Get the current pixel. - * dsc->header.w + 3 means rounding up to 4 because the lines are byte aligned - * so the possible real width are 4, 8, 12 ...*/ + /*Get the current pixel. + *dsc->header.w + 3 means rounding up to 4 because the lines are byte aligned + *so the possible real width are 4, 8, 12 ...*/ uint32_t px = ((dsc->header.w + 3) >> 2) * y + x; p_color.full = (buf_u8[px] & (3 << (6 - bit))) >> (6 - bit); } @@ -89,9 +89,9 @@ lv_color_t lv_img_buf_get_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t uint8_t bit = (x & 0x1) * 4; x = x >> 1; - /* Get the current pixel. - * dsc->header.w + 1 means rounding up to 2 because the lines are byte aligned - * so the possible real width are 2, 4, 6 ...*/ + /*Get the current pixel. + *dsc->header.w + 1 means rounding up to 2 because the lines are byte aligned + *so the possible real width are 2, 4, 6 ...*/ uint32_t px = ((dsc->header.w + 1) >> 1) * y + x; p_color.full = (buf_u8[px] & (0xF << (4 - bit))) >> (4 - bit); } @@ -127,9 +127,9 @@ lv_opa_t lv_img_buf_get_px_alpha(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y) uint8_t bit = x & 0x7; x = x >> 3; - /* Get the current pixel. - * dsc->header.w + 7 means rounding up to 8 because the lines are byte aligned - * so the possible real width are 8 ,16, 24 ...*/ + /*Get the current pixel. + *dsc->header.w + 7 means rounding up to 8 because the lines are byte aligned + *so the possible real width are 8 ,16, 24 ...*/ uint32_t px = ((dsc->header.w + 7) >> 3) * y + x; uint8_t px_opa = (buf_u8[px] & (1 << (7 - bit))) >> (7 - bit); return px_opa ? LV_OPA_TRANSP : LV_OPA_COVER; @@ -140,9 +140,9 @@ lv_opa_t lv_img_buf_get_px_alpha(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y) uint8_t bit = (x & 0x3) * 2; x = x >> 2; - /* Get the current pixel. - * dsc->header.w + 4 means rounding up to 8 because the lines are byte aligned - * so the possible real width are 4 ,8, 12 ...*/ + /*Get the current pixel. + *dsc->header.w + 4 means rounding up to 8 because the lines are byte aligned + *so the possible real width are 4 ,8, 12 ...*/ uint32_t px = ((dsc->header.w + 3) >> 2) * y + x; uint8_t px_opa = (buf_u8[px] & (3 << (6 - bit))) >> (6 - bit); return opa_table[px_opa]; @@ -155,9 +155,9 @@ lv_opa_t lv_img_buf_get_px_alpha(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y) uint8_t bit = (x & 0x1) * 4; x = x >> 1; - /* Get the current pixel. - * dsc->header.w + 1 means rounding up to 8 because the lines are byte aligned - * so the possible real width are 2 ,4, 6 ...*/ + /*Get the current pixel. + *dsc->header.w + 1 means rounding up to 8 because the lines are byte aligned + *so the possible real width are 2 ,4, 6 ...*/ uint32_t px = ((dsc->header.w + 1) >> 1) * y + x; uint8_t px_opa = (buf_u8[px] & (0xF << (4 - bit))) >> (4 - bit); return opa_table[px_opa]; @@ -192,9 +192,9 @@ void lv_img_buf_set_px_alpha(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_ uint8_t bit = x & 0x7; x = x >> 3; - /* Get the current pixel. - * dsc->header.w + 7 means rounding up to 8 because the lines are byte aligned - * so the possible real width are 8 ,16, 24 ...*/ + /*Get the current pixel. + *dsc->header.w + 7 means rounding up to 8 because the lines are byte aligned + *so the possible real width are 8 ,16, 24 ...*/ uint32_t px = ((dsc->header.w + 7) >> 3) * y + x; buf_u8[px] = buf_u8[px] & ~(1 << (7 - bit)); buf_u8[px] = buf_u8[px] | ((opa & 0x1) << (7 - bit)); @@ -204,9 +204,9 @@ void lv_img_buf_set_px_alpha(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_ uint8_t bit = (x & 0x3) * 2; x = x >> 2; - /* Get the current pixel. - * dsc->header.w + 4 means rounding up to 8 because the lines are byte aligned - * so the possible real width are 4 ,8, 12 ...*/ + /*Get the current pixel. + *dsc->header.w + 4 means rounding up to 8 because the lines are byte aligned + *so the possible real width are 4 ,8, 12 ...*/ uint32_t px = ((dsc->header.w + 3) >> 2) * y + x; buf_u8[px] = buf_u8[px] & ~(3 << (6 - bit)); buf_u8[px] = buf_u8[px] | ((opa & 0x3) << (6 - bit)); @@ -216,9 +216,9 @@ void lv_img_buf_set_px_alpha(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_ uint8_t bit = (x & 0x1) * 4; x = x >> 1; - /* Get the current pixel. - * dsc->header.w + 1 means rounding up to 8 because the lines are byte aligned - * so the possible real width are 2 ,4, 6 ...*/ + /*Get the current pixel. + *dsc->header.w + 1 means rounding up to 8 because the lines are byte aligned + *so the possible real width are 2 ,4, 6 ...*/ uint32_t px = ((dsc->header.w + 1) >> 1) * y + x; buf_u8[px] = buf_u8[px] & ~(0xF << (4 - bit)); buf_u8[px] = buf_u8[px] | ((opa & 0xF) << (4 - bit)); @@ -257,9 +257,9 @@ void lv_img_buf_set_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_ uint8_t bit = x & 0x7; x = x >> 3; - /* Get the current pixel. - * dsc->header.w + 7 means rounding up to 8 because the lines are byte aligned - * so the possible real width are 8 ,16, 24 ...*/ + /*Get the current pixel. + *dsc->header.w + 7 means rounding up to 8 because the lines are byte aligned + *so the possible real width are 8 ,16, 24 ...*/ uint32_t px = ((dsc->header.w + 7) >> 3) * y + x; buf_u8[px] = buf_u8[px] & ~(1 << (7 - bit)); buf_u8[px] = buf_u8[px] | ((c.full & 0x1) << (7 - bit)); @@ -269,9 +269,9 @@ void lv_img_buf_set_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_ uint8_t bit = (x & 0x3) * 2; x = x >> 2; - /* Get the current pixel. - * dsc->header.w + 3 means rounding up to 4 because the lines are byte aligned - * so the possible real width are 4, 8 ,12 ...*/ + /*Get the current pixel. + *dsc->header.w + 3 means rounding up to 4 because the lines are byte aligned + *so the possible real width are 4, 8 ,12 ...*/ uint32_t px = ((dsc->header.w + 3) >> 2) * y + x; buf_u8[px] = buf_u8[px] & ~(3 << (6 - bit)); @@ -282,9 +282,9 @@ void lv_img_buf_set_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_ uint8_t bit = (x & 0x1) * 4; x = x >> 1; - /* Get the current pixel. - * dsc->header.w + 1 means rounding up to 2 because the lines are byte aligned - * so the possible real width are 2 ,4, 6 ...*/ + /*Get the current pixel. + *dsc->header.w + 1 means rounding up to 2 because the lines are byte aligned + *so the possible real width are 2 ,4, 6 ...*/ uint32_t px = ((dsc->header.w + 1) >> 1) * y + x; buf_u8[px] = buf_u8[px] & ~(0xF << (4 - bit)); buf_u8[px] = buf_u8[px] | ((c.full & 0xF) << (4 - bit)); @@ -329,21 +329,21 @@ void lv_img_buf_set_palette(lv_img_dsc_t * dsc, uint8_t id, lv_color_t c) */ lv_img_dsc_t * lv_img_buf_alloc(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf) { - /* Allocate image descriptor */ + /*Allocate image descriptor*/ lv_img_dsc_t * dsc = lv_mem_alloc(sizeof(lv_img_dsc_t)); if(dsc == NULL) return NULL; lv_memset_00(dsc, sizeof(lv_img_dsc_t)); - /* Get image data size */ + /*Get image data size*/ dsc->data_size = lv_img_buf_get_img_size(w, h, cf); if(dsc->data_size == 0) { lv_mem_free(dsc); return NULL; } - /* Allocate raw buffer */ + /*Allocate raw buffer*/ dsc->data = lv_mem_alloc(dsc->data_size); if(dsc->data == NULL) { lv_mem_free(dsc); @@ -351,7 +351,7 @@ lv_img_dsc_t * lv_img_buf_alloc(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf) } lv_memset_00((uint8_t *)dsc->data, dsc->data_size); - /* Fill in header */ + /*Fill in header*/ dsc->header.always_zero = 0; dsc->header.w = w; dsc->header.h = h; @@ -453,8 +453,8 @@ void _lv_img_buf_transform_init(lv_img_transform_dsc_t * dsc) dsc->tmp.img_dsc.header.w = dsc->cfg.src_w; dsc->tmp.img_dsc.header.h = dsc->cfg.src_h; - /* The inverse of the zoom will be sued during the transformation - * + dsc->cfg.zoom / 2 for rounding*/ + /*The inverse of the zoom will be sued during the transformation + * + dsc->cfg.zoom / 2 for rounding*/ dsc->tmp.zoom_inv = (((256 * 256) << _LV_ZOOM_INV_UPSCALE) + dsc->cfg.zoom / 2) / dsc->cfg.zoom; dsc->res.opa = LV_OPA_COVER; diff --git a/src/draw/lv_img_buf.h b/src/draw/lv_img_buf.h index c0faa4231..d2752ae31 100644 --- a/src/draw/lv_img_buf.h +++ b/src/draw/lv_img_buf.h @@ -77,35 +77,36 @@ enum { LV_IMG_CF_ALPHA_4BIT, /**< Can have one color but 16 different alpha value*/ LV_IMG_CF_ALPHA_8BIT, /**< Can have one color but 256 different alpha value*/ - LV_IMG_CF_RESERVED_15, /**< Reserved for further use. */ - LV_IMG_CF_RESERVED_16, /**< Reserved for further use. */ - LV_IMG_CF_RESERVED_17, /**< Reserved for further use. */ - LV_IMG_CF_RESERVED_18, /**< Reserved for further use. */ - LV_IMG_CF_RESERVED_19, /**< Reserved for further use. */ - LV_IMG_CF_RESERVED_20, /**< Reserved for further use. */ - LV_IMG_CF_RESERVED_21, /**< Reserved for further use. */ - LV_IMG_CF_RESERVED_22, /**< Reserved for further use. */ - LV_IMG_CF_RESERVED_23, /**< Reserved for further use. */ + LV_IMG_CF_RESERVED_15, /**< Reserved for further use.*/ + LV_IMG_CF_RESERVED_16, /**< Reserved for further use.*/ + LV_IMG_CF_RESERVED_17, /**< Reserved for further use.*/ + LV_IMG_CF_RESERVED_18, /**< Reserved for further use.*/ + LV_IMG_CF_RESERVED_19, /**< Reserved for further use.*/ + LV_IMG_CF_RESERVED_20, /**< Reserved for further use.*/ + LV_IMG_CF_RESERVED_21, /**< Reserved for further use.*/ + LV_IMG_CF_RESERVED_22, /**< Reserved for further use.*/ + LV_IMG_CF_RESERVED_23, /**< Reserved for further use.*/ - LV_IMG_CF_USER_ENCODED_0, /**< User holder encoding format. */ - LV_IMG_CF_USER_ENCODED_1, /**< User holder encoding format. */ - LV_IMG_CF_USER_ENCODED_2, /**< User holder encoding format. */ - LV_IMG_CF_USER_ENCODED_3, /**< User holder encoding format. */ - LV_IMG_CF_USER_ENCODED_4, /**< User holder encoding format. */ - LV_IMG_CF_USER_ENCODED_5, /**< User holder encoding format. */ - LV_IMG_CF_USER_ENCODED_6, /**< User holder encoding format. */ - LV_IMG_CF_USER_ENCODED_7, /**< User holder encoding format. */ + LV_IMG_CF_USER_ENCODED_0, /**< User holder encoding format.*/ + LV_IMG_CF_USER_ENCODED_1, /**< User holder encoding format.*/ + LV_IMG_CF_USER_ENCODED_2, /**< User holder encoding format.*/ + LV_IMG_CF_USER_ENCODED_3, /**< User holder encoding format.*/ + LV_IMG_CF_USER_ENCODED_4, /**< User holder encoding format.*/ + LV_IMG_CF_USER_ENCODED_5, /**< User holder encoding format.*/ + LV_IMG_CF_USER_ENCODED_6, /**< User holder encoding format.*/ + LV_IMG_CF_USER_ENCODED_7, /**< User holder encoding format.*/ }; typedef uint8_t lv_img_cf_t; /** * LVGL image header */ -/* The first 8 bit is very important to distinguish the different source types. +/** + * The first 8 bit is very important to distinguish the different source types. * For more info see `lv_img_get_src_type()` in lv_img.c * On big endian systems the order is reversed so cf and always_zero must be at * the end of the struct. - * */ + */ #if LV_BIG_ENDIAN_SYSTEM typedef struct { @@ -114,13 +115,13 @@ typedef struct { uint32_t reserved : 2; /*Reserved to be used later*/ uint32_t always_zero : 3; /*It the upper bits of the first byte. Always zero to look like a non-printable character*/ - uint32_t cf : 5; /* Color format: See `lv_img_color_format_t`*/ + uint32_t cf : 5; /*Color format: See `lv_img_color_format_t`*/ } lv_img_header_t; #else typedef struct { - uint32_t cf : 5; /* Color format: See `lv_img_color_format_t`*/ + uint32_t cf : 5; /*Color format: See `lv_img_color_format_t`*/ uint32_t always_zero : 3; /*It the upper bits of the first byte. Always zero to look like a non-printable character*/ @@ -145,7 +146,7 @@ typedef struct { lv_coord_t src_w; /*width of the image source*/ lv_coord_t src_h; /*height of the image source*/ lv_coord_t pivot_x; /*pivot x*/ - lv_coord_t pivot_y; /* pivot y*/ + lv_coord_t pivot_y; /*pivot y*/ int16_t angle; /*angle to rotate*/ uint16_t zoom; /*256 no zoom, 128 half size, 512 double size*/ lv_color_t color; /*a color used for `LV_IMG_CF_INDEXED_1/2/4/8BIT` color formats*/ @@ -304,7 +305,7 @@ void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_IMG_BUF_H*/ diff --git a/src/draw/lv_img_cache.c b/src/draw/lv_img_cache.c index 84d9d0f26..167bea282 100644 --- a/src/draw/lv_img_cache.c +++ b/src/draw/lv_img_cache.c @@ -23,7 +23,7 @@ #define LV_IMG_CACHE_LIFE_GAIN 1 /*Don't let life to be greater than this limit because it would require a lot of time to - * "die" from very high values */ + * "die" from very high values*/ #define LV_IMG_CACHE_LIFE_LIMIT 1000 /********************** @@ -84,9 +84,9 @@ lv_img_cache_entry_t * _lv_img_cache_open(const void * src, lv_color_t color) for(i = 0; i < entry_cnt; i++) { if(color.full == cache[i].dec_dsc.color.full && lv_img_cache_match(src, cache[i].dec_dsc.src)) { - /* If opened increment its life. - * Image difficult to open should live longer to keep avoid frequent their recaching. - * Therefore increase `life` with `time_to_open`*/ + /*If opened increment its life. + *Image difficult to open should live longer to keep avoid frequent their recaching. + *Therefore increase `life` with `time_to_open`*/ cached_src = &cache[i]; cached_src->life += cached_src->dec_dsc.time_to_open * LV_IMG_CACHE_LIFE_GAIN; if(cached_src->life > LV_IMG_CACHE_LIFE_LIMIT) cached_src->life = LV_IMG_CACHE_LIFE_LIMIT; @@ -123,7 +123,7 @@ lv_img_cache_entry_t * _lv_img_cache_open(const void * src, lv_color_t color) if(open_res == LV_RES_INV) { LV_LOG_WARN("Image draw cannot open the image resource"); lv_memset_00(cached_src, sizeof(lv_img_cache_entry_t)); - cached_src->life = INT32_MIN; /*Make the empty entry very "weak" to force its use */ + cached_src->life = INT32_MIN; /*Make the empty entry very "weak" to force its us*/ return NULL; } diff --git a/src/draw/lv_img_cache.h b/src/draw/lv_img_cache.h index f8f8fc483..3846f6b42 100644 --- a/src/draw/lv_img_cache.h +++ b/src/draw/lv_img_cache.h @@ -29,11 +29,11 @@ extern "C" { * To avoid repeating this heavy load images can be cached. */ typedef struct { - lv_img_decoder_dsc_t dec_dsc; /**< Image information */ + lv_img_decoder_dsc_t dec_dsc; /**< Image information*/ /** Count the cache entries's life. Add `time_to_open` to `life` when the entry is used. * Decrement all lifes by one every in every ::lv_img_cache_open. - * If life == 0 the entry can be reused */ + * If life == 0 the entry can be reused*/ int32_t life; } lv_img_cache_entry_t; @@ -71,7 +71,7 @@ void lv_img_cache_invalidate_src(const void * src); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_IMG_CACHE_H*/ diff --git a/src/draw/lv_img_decoder.c b/src/draw/lv_img_decoder.c index 459bc5e6a..6fa0b0318 100644 --- a/src/draw/lv_img_decoder.c +++ b/src/draw/lv_img_decoder.c @@ -51,7 +51,7 @@ static lv_res_t lv_img_decoder_built_in_line_indexed(lv_img_decoder_dsc_t * dsc, /** * Initialize the image decoder module - * */ + */ void _lv_img_decoder_init(void) { _lv_ll_init(&LV_GC_ROOT(_lv_img_decoder_ll), sizeof(lv_img_decoder_t)); @@ -298,11 +298,11 @@ lv_res_t lv_img_decoder_built_in_info(lv_img_decoder_t * decoder, const void * s } else if(src_type == LV_IMG_SRC_SYMBOL) { /*The size depend on the font but it is unknown here. It should be handled outside of the - * function*/ + *function*/ header->w = 1; header->h = 1; - /* Symbols always have transparent parts. Important because of cover check in the draw - * function. The actual value doesn't matter because lv_draw_label will draw it*/ + /*Symbols always have transparent parts. Important because of cover check in the draw + *function. The actual value doesn't matter because lv_draw_label will draw it*/ header->cf = LV_IMG_CF_ALPHA_1BIT; } else { @@ -358,8 +358,8 @@ lv_res_t lv_img_decoder_built_in_open(lv_img_decoder_t * decoder, lv_img_decoder /*Process true color formats*/ if(cf == LV_IMG_CF_TRUE_COLOR || cf == LV_IMG_CF_TRUE_COLOR_ALPHA || cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED) { if(dsc->src_type == LV_IMG_SRC_VARIABLE) { - /* In case of uncompressed formats the image stored in the ROM/RAM. - * So simply give its pointer*/ + /*In case of uncompressed formats the image stored in the ROM/RAM. + *So simply give its pointer*/ dsc->img_data = ((lv_img_dsc_t *)dsc->src)->data; return LV_RES_OK; } @@ -420,7 +420,7 @@ lv_res_t lv_img_decoder_built_in_open(lv_img_decoder_t * decoder, lv_img_decoder return LV_RES_OK; } - /*Alpha indexed images. */ + /*Alpha indexed images.*/ else if(cf == LV_IMG_CF_ALPHA_1BIT || cf == LV_IMG_CF_ALPHA_2BIT || cf == LV_IMG_CF_ALPHA_4BIT || cf == LV_IMG_CF_ALPHA_8BIT) { return LV_RES_OK; /*Nothing to process*/ @@ -455,8 +455,8 @@ lv_res_t lv_img_decoder_built_in_read_line(lv_img_decoder_t * decoder, lv_img_de if(dsc->header.cf == LV_IMG_CF_TRUE_COLOR || dsc->header.cf == LV_IMG_CF_TRUE_COLOR_ALPHA || dsc->header.cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED) { - /* For TRUE_COLOR images read line required only for files. - * For variables the image data was returned in `open`*/ + /*For TRUE_COLOR images read line required only for files. + *For variables the image data was returned in `open`*/ if(dsc->src_type == LV_IMG_SRC_FILE) { res = lv_img_decoder_built_in_line_true_color(dsc, x, y, len, buf); } diff --git a/src/draw/lv_img_decoder.h b/src/draw/lv_img_decoder.h index 351db8f44..b06900067 100644 --- a/src/draw/lv_img_decoder.h +++ b/src/draw/lv_img_decoder.h @@ -30,17 +30,17 @@ extern "C" { **********************/ /** - * Source of image. */ + * Source of image.*/ enum { - LV_IMG_SRC_VARIABLE, /** Binary/C variable */ - LV_IMG_SRC_FILE, /** File in filesystem */ - LV_IMG_SRC_SYMBOL, /** Symbol (@ref lv_symbol_def.h) */ - LV_IMG_SRC_UNKNOWN, /** Unknown source */ + LV_IMG_SRC_VARIABLE, /** Binary/C variable*/ + LV_IMG_SRC_FILE, /** File in filesystem*/ + LV_IMG_SRC_SYMBOL, /** Symbol (@ref lv_symbol_def.h)*/ + LV_IMG_SRC_UNKNOWN, /** Unknown source*/ }; typedef uint8_t lv_img_src_t; -/* Decoder function definitions */ +/*Decoder function definitions*/ struct _lv_img_decoder; struct _lv_img_decoder_dsc; @@ -120,7 +120,7 @@ typedef struct _lv_img_decoder_dsc { uint32_t time_to_open; /**A text to display instead of the image when the image can't be opened. - * Can be set in `open` function or set NULL. */ + * Can be set in `open` function or set NULL.*/ const char * error_msg; /**Store any custom data here is required*/ @@ -263,7 +263,7 @@ void lv_img_decoder_built_in_close(lv_img_decoder_t * decoder, lv_img_decoder_ds **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_IMG_DECODER_H*/ diff --git a/src/extra/layouts/flex/lv_flex.c b/src/extra/layouts/flex/lv_flex.c index 915a93d21..06d5d47f2 100644 --- a/src/extra/layouts/flex/lv_flex.c +++ b/src/extra/layouts/flex/lv_flex.c @@ -191,7 +191,7 @@ static void flex_update(lv_obj_t * cont) track_first_item = f->rev ? cont->spec_attr->child_cnt - 1 : 0; track_t t; while(track_first_item < (int32_t)cont->spec_attr->child_cnt && track_first_item >= 0) { - /*Search the first item of the next row */ + /*Search the first item of the next row*/ next_track_first_item = find_track_end(cont, track_first_item, max_main_size, item_gap, &t); total_track_cross_size += t.track_cross_size + track_gap; track_cnt++; @@ -200,7 +200,7 @@ static void flex_update(lv_obj_t * cont) if(track_cnt) total_track_cross_size -= track_gap; /*No gap after the last track*/ - /* Place the tracks to get the start position */ + /*Place the tracks to get the start position*/ lv_coord_t max_cross_size = (row ? lv_obj_get_height_fit(cont) : lv_obj_get_width_fit(cont)); place_content(track_cross_place, max_cross_size, total_track_cross_size, track_cnt, cross_pos, &gap); } @@ -213,7 +213,7 @@ static void flex_update(lv_obj_t * cont) while(track_first_item < (int32_t)cont->spec_attr->child_cnt && track_first_item >= 0) { track_t t; - /*Search the first item of the next row */ + /*Search the first item of the next row*/ next_track_first_item = find_track_end(cont, track_first_item, max_main_size, item_gap, &t); if(rtl && !row) { @@ -357,8 +357,8 @@ static void children_repos(lv_obj_t * cont, int32_t item_first_id, int32_t item_ lv_coord_t cross_pos = 0; switch(f->cross_place) { case LV_FLEX_PLACE_CENTER: - /* Round up the cross size to avoid rounding error when dividing by 2 - * The issue comes up e,g, with column direction with center cross direction if an element's width changes*/ + /*Round up the cross size to avoid rounding error when dividing by 2 + *The issue comes up e,g, with column direction with center cross direction if an element's width changes*/ cross_pos = (((t->track_cross_size + 1) & (~1)) - area_get_cross_size(&item->coords)) / 2; break; case LV_FLEX_PLACE_END: diff --git a/src/extra/layouts/flex/lv_flex.h b/src/extra/layouts/flex/lv_flex.h index 138787f10..bfa25f90d 100644 --- a/src/extra/layouts/flex/lv_flex.h +++ b/src/extra/layouts/flex/lv_flex.h @@ -31,7 +31,7 @@ LV_EXPORT_CONST_INT(LV_OBJ_FLAG_FLEX_IN_NEW_TRACK); * TYPEDEFS **********************/ -/* Can't include lv_obj.h because it includes this header file */ +/*Can't include lv_obj.h because it includes this header file*/ struct _lv_obj_t; typedef enum { @@ -119,7 +119,7 @@ extern const lv_flex_t lv_flex_row_even; /**< Place the items evenly #endif /*LV_USE_FLEX*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_FLEX_H*/ diff --git a/src/extra/layouts/grid/lv_grid.c b/src/extra/layouts/grid/lv_grid.c index 68e5af26e..c09fab30e 100644 --- a/src/extra/layouts/grid/lv_grid.c +++ b/src/extra/layouts/grid/lv_grid.c @@ -15,7 +15,7 @@ *********************/ /** * Some helper defines - * */ + */ #define CELL_SHIFT 4 #define CELL_POS_MASK ((1 << CELL_SHIFT) - 1) #define CELL_SPAN_MASK (CELL_POS_MASK << CELL_SHIFT) @@ -145,8 +145,8 @@ static void full_refresh(lv_obj_t * cont) item_repos_hint_t hint; lv_memset_00(&hint, sizeof(hint)); - /* Calculate the grids absolute x and y coordinates. - * It will be used as helper during item repositioning to avoid calculating this value for every children*/ + /*Calculate the grids absolute x and y coordinates. + *It will be used as helper during item repositioning to avoid calculating this value for every children*/ lv_coord_t pad_left = lv_obj_get_style_pad_left(cont, LV_PART_MAIN); lv_coord_t pad_top = lv_obj_get_style_pad_top(cont, LV_PART_MAIN); hint.grid_abs.x = pad_left + cont->coords.x1 - lv_obj_get_scroll_x(cont); diff --git a/src/extra/layouts/grid/lv_grid.h b/src/extra/layouts/grid/lv_grid.h index da5db17ea..7f8a9e759 100644 --- a/src/extra/layouts/grid/lv_grid.h +++ b/src/extra/layouts/grid/lv_grid.h @@ -24,7 +24,7 @@ extern "C" { * TYPEDEFS **********************/ -/* Can't include lv_obj.h because it includes this header file */ +/*Can't include lv_obj.h because it includes this header file*/ struct _lv_obj_t; typedef enum { @@ -129,7 +129,7 @@ extern const lv_grid_t grid_12; #endif /*LV_USE_GRID*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_GRID_H*/ diff --git a/src/extra/layouts/lv_layouts.h b/src/extra/layouts/lv_layouts.h index 8303a9a81..0ad7b75b3 100644 --- a/src/extra/layouts/lv_layouts.h +++ b/src/extra/layouts/lv_layouts.h @@ -38,7 +38,7 @@ extern "C" { #endif #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_LAYOUTS_H*/ diff --git a/src/extra/themes/default/lv_theme_default.c b/src/extra/themes/default/lv_theme_default.c index 7a37ed535..5c75fa1b8 100644 --- a/src/extra/themes/default/lv_theme_default.c +++ b/src/extra/themes/default/lv_theme_default.c @@ -15,7 +15,7 @@ #if defined(LV_GC_INCLUDE) #include LV_GC_INCLUDE -#endif /* LV_ENABLE_GC */ +#endif /*LV_ENABLE_GC*/ /********************* * DEFINES @@ -523,9 +523,9 @@ lv_theme_t * lv_theme_default_init(lv_disp_t * disp, lv_color_palette_t palette_ const lv_font_t * font_small, const lv_font_t * font_normal, const lv_font_t * font_large) { - /* This trick is required only to avoid the garbage collection of - * styles' data if LVGL is used in a binding (e.g. Micropython) - * In a general case styles could be in simple `static lv_style_t my_style...` variables*/ + /*This trick is required only to avoid the garbage collection of + *styles' data if LVGL is used in a binding (e.g. Micropython) + *In a general case styles could be in simple `static lv_style_t my_style...` variables*/ if(!inited) { LV_GC_ROOT(_lv_theme_default_styles) = lv_mem_alloc(sizeof(my_theme_styles_t)); styles = (my_theme_styles_t *)LV_GC_ROOT(_lv_theme_default_styles); diff --git a/src/extra/themes/default/lv_theme_default.h b/src/extra/themes/default/lv_theme_default.h index 40671282f..02d010d17 100644 --- a/src/extra/themes/default/lv_theme_default.h +++ b/src/extra/themes/default/lv_theme_default.h @@ -49,7 +49,7 @@ bool lv_theme_default_is_inited(void); #endif #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_THEME_DEFAULT_H*/ diff --git a/src/extra/themes/lv_themes.h b/src/extra/themes/lv_themes.h index 0aec37fed..c55d465c1 100644 --- a/src/extra/themes/lv_themes.h +++ b/src/extra/themes/lv_themes.h @@ -32,7 +32,7 @@ extern "C" { **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_THEMES_H*/ diff --git a/src/extra/widgets/calendar/lv_calendar.c b/src/extra/widgets/calendar/lv_calendar.c index 02d305a72..3149a1e26 100644 --- a/src/extra/widgets/calendar/lv_calendar.c +++ b/src/extra/widgets/calendar/lv_calendar.c @@ -209,7 +209,7 @@ static void my_constructor(lv_obj_t * obj, const lv_obj_t * copy) LV_UNUSED(copy); lv_calendar_t * calendar = (lv_calendar_t *)obj; - /*Initialize the allocated 'ext' */ + /*Initialize the allocated 'ext'*/ calendar->today.year = 2020; calendar->today.month = 1; calendar->today.day = 1; @@ -365,4 +365,4 @@ static void highlight_update(lv_obj_t * obj) } } -#endif /* LV_USE_CALENDAR*/ +#endif /*LV_USE_CALENDAR*/ diff --git a/src/extra/widgets/calendar/lv_calendar.h b/src/extra/widgets/calendar/lv_calendar.h index 9a03e002f..0169620e6 100644 --- a/src/extra/widgets/calendar/lv_calendar.h +++ b/src/extra/widgets/calendar/lv_calendar.h @@ -37,7 +37,7 @@ typedef struct { /*Data of calendar*/ typedef struct { lv_btnmatrix_t btnm; - /*New data for this type */ + /*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)*/ @@ -145,10 +145,10 @@ bool lv_calendar_get_pressed_date(const lv_obj_t * calendar, lv_calendar_date_t * MACROS **********************/ -#endif /* LV_USE_CALENDAR*/ +#endif /*LV_USE_CALENDAR*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_CALENDAR_H*/ diff --git a/src/extra/widgets/calendar/lv_calendar_header_arrow.h b/src/extra/widgets/calendar/lv_calendar_header_arrow.h index 5e1a4d97a..52d38b5ca 100644 --- a/src/extra/widgets/calendar/lv_calendar_header_arrow.h +++ b/src/extra/widgets/calendar/lv_calendar_header_arrow.h @@ -43,7 +43,7 @@ lv_obj_t * lv_calendar_header_arrow_create(lv_obj_t * parent, lv_obj_t * calenda #endif /*LV_USE_CALENDAR_HEADER_ARROW*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_CALENDAR_H*/ diff --git a/src/extra/widgets/calendar/lv_calendar_header_dropdown.h b/src/extra/widgets/calendar/lv_calendar_header_dropdown.h index d218228ae..b29f1d576 100644 --- a/src/extra/widgets/calendar/lv_calendar_header_dropdown.h +++ b/src/extra/widgets/calendar/lv_calendar_header_dropdown.h @@ -42,7 +42,7 @@ lv_obj_t * lv_calendar_header_dropdown_create(lv_obj_t * parent, lv_obj_t * cale #endif /*LV_USE_CALENDAR_HEADER_ARROW*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_CALENDAR_H*/ diff --git a/src/extra/widgets/colorwheel/lv_colorwheel.c b/src/extra/widgets/colorwheel/lv_colorwheel.c index cb4e42ff5..b62d76ca4 100644 --- a/src/extra/widgets/colorwheel/lv_colorwheel.c +++ b/src/extra/widgets/colorwheel/lv_colorwheel.c @@ -17,7 +17,8 @@ #define LV_CPICKER_DEF_QF 3 -/* The OUTER_MASK_WIDTH define is required to assist with the placing of a mask over the outer ring of the widget as when the +/** + * The OUTER_MASK_WIDTH define is required to assist with the placing of a mask over the outer ring of the widget as when the * multicoloured radial lines are calculated for the outer ring of the widget their lengths are jittering because of the * integer based arithmetic. From tests the maximum delta was found to be 2 so the current value is set to 3 to achieve * appropriate masking. @@ -264,7 +265,7 @@ static void draw_disc_grad(lv_obj_t * obj, const lv_area_t * mask) lv_coord_t cir_w = lv_obj_get_style_arc_width(obj, LV_PART_MAIN); #if LV_DRAW_COMPLEX - /* Mask outer and inner ring of widget to tidy up ragged edges of lines while drawing outer ring */ + /*Mask outer and inner ring of widget to tidy up ragged edges of lines while drawing outer ring*/ lv_draw_mask_radius_param_t mask_out_param; lv_draw_mask_radius_init(&mask_out_param, &obj->coords, LV_RADIUS_CIRCLE, false); int16_t mask_out_id = lv_draw_mask_add(&mask_out_param, 0); @@ -279,8 +280,8 @@ static void draw_disc_grad(lv_obj_t * obj, const lv_area_t * mask) lv_draw_mask_radius_init(&mask_in_param, &mask_area, LV_RADIUS_CIRCLE, true); int16_t mask_in_id = lv_draw_mask_add(&mask_in_param, 0); - /* The inner and outer line ends will be masked out. - * So make lines a little bit longer because the masking makes a more even result */ + /*The inner and outer line ends will be masked out. + *So make lines a little bit longer because the masking makes a more even result*/ lv_coord_t cir_w_extra = line_dsc.width; #else lv_coord_t cir_w_extra = 0; @@ -288,7 +289,7 @@ static void draw_disc_grad(lv_obj_t * obj, const lv_area_t * mask) for(i = 0; i <= 256; i += LV_CPICKER_DEF_QF, a += 360 * LV_CPICKER_DEF_QF) { line_dsc.color = angle_to_mode_color_fast(obj, i); - uint16_t angle_trigo = (uint16_t)(a >> 8); /* i * 360 / 256 is the scale to apply, but we can skip multiplication here */ + uint16_t angle_trigo = (uint16_t)(a >> 8); /*i * 360 / 256 is the scale to apply, but we can skip multiplication here*/ lv_point_t p[2]; p[0].x = cx + ((r + cir_w_extra) * lv_trigo_sin(angle_trigo) >> LV_TRIGO_SHIFT); @@ -362,7 +363,7 @@ static lv_area_t get_knob_area(lv_obj_t * obj) */ static lv_res_t lv_colorwheel_signal(lv_obj_t * obj, lv_signal_t sign, void * param) { - /* Include the ancient signal function */ + /*Include the ancient signal function*/ lv_res_t res = lv_obj_signal_base(MY_CLASS, obj, sign, param); if(res != LV_RES_OK) return res; @@ -597,16 +598,17 @@ static lv_res_t double_click_reset(lv_obj_t * obj) #define HSV_PTR_SWAP(sextant,r,g,b) if((sextant) & 2) { SWAPPTR((r), (b)); } if((sextant) & 4) { SWAPPTR((g), (b)); } if(!((sextant) & 6)) { \ if(!((sextant) & 1)) { SWAPPTR((r), (g)); } } else { if((sextant) & 1) { SWAPPTR((r), (g)); } } -/* Based on the idea from https://www.vagrearg.org/content/hsvrgb - Here we want to compute an approximate RGB value from a HSV input color space. We don't want to be accurate - (for that, there's lv_color_hsv_to_rgb), but we want to be fast. - - Few tricks are used here: Hue is in range [0; 6 * 256] (so that the sextant is in the high byte and the fractional part is in the low byte) - both s and v are in [0; 255] range (very convenient to avoid divisions). - - We fold all symmetry by swapping the R, G, B pointers so that the code is the same for all sextants. - We replace division by 255 by a division by 256, a.k.a a shift right by 8 bits. - This is wrong, but since this is only used to compute the pixels on the screen and not the final color, it's ok. +/** + * Based on the idea from https://www.vagrearg.org/content/hsvrgb + * Here we want to compute an approximate RGB value from a HSV input color space. We don't want to be accurate + * (for that, there's lv_color_hsv_to_rgb), but we want to be fast. + * + * Few tricks are used here: Hue is in range [0; 6 * 256] (so that the sextant is in the high byte and the fractional part is in the low byte) + * both s and v are in [0; 255] range (very convenient to avoid divisions). + * + * We fold all symmetry by swapping the R, G, B pointers so that the code is the same for all sextants. + * We replace division by 255 by a division by 256, a.k.a a shift right by 8 bits. + * This is wrong, but since this is only used to compute the pixels on the screen and not the final color, it's ok. */ static void fast_hsv2rgb(uint16_t h, uint8_t s, uint8_t v, uint8_t *r, uint8_t *g , uint8_t *b); static void fast_hsv2rgb(uint16_t h, uint8_t s, uint8_t v, uint8_t *r, uint8_t *g , uint8_t *b) @@ -614,21 +616,21 @@ static void fast_hsv2rgb(uint16_t h, uint8_t s, uint8_t v, uint8_t *r, uint8_t * if (!s) { *r = *g = *b = v; return; } uint8_t sextant = h >> 8; - HSV_PTR_SWAP(sextant, r, g, b); /* Swap pointers so the conversion code is the same */ + HSV_PTR_SWAP(sextant, r, g, b); /*Swap pointers so the conversion code is the same*/ *g = v; uint8_t bb = ~s; - uint16_t ww = v * bb; /* Don't try to be precise, but instead, be fast */ + uint16_t ww = v * bb; /*Don't try to be precise, but instead, be fast*/ *b = ww >> 8; uint8_t h_frac = h & 0xff; if(!(sextant & 1)) { - /* Up slope */ - ww = !h_frac ? ((uint16_t)s << 8) : (s * (uint8_t)(-h_frac)); /* Skip multiply if not required */ + /*Up slope*/ + ww = !h_frac ? ((uint16_t)s << 8) : (s * (uint8_t)(-h_frac)); /*Skip multiply if not required*/ } else { - /* Down slope */ + /*Down slope*/ ww = s * h_frac; } bb = ww >> 8; @@ -647,15 +649,15 @@ static lv_color_t angle_to_mode_color_fast(lv_obj_t * obj, uint16_t angle) switch(ext->mode) { default: case LV_COLORWHEEL_MODE_HUE: - /* Don't recompute costly scaling if it does not change */ + /*Don't recompute costly scaling if it does not change*/ if (m != ext->mode) { s = (uint8_t)(((uint16_t)ext->hsv.s * 51) / 20); v = (uint8_t)(((uint16_t)ext->hsv.v * 51) / 20); m = ext->mode; } - fast_hsv2rgb(angle * 6, s, v, &r, &g, &b); /* A smart compiler will replace x * 6 by (x << 2) + (x << 1) if it's more efficient */ + fast_hsv2rgb(angle * 6, s, v, &r, &g, &b); /*A smart compiler will replace x * 6 by (x << 2) + (x << 1) if it's more efficient*/ break; case LV_COLORWHEEL_MODE_SATURATION: - /* Don't recompute costly scaling if it does not change */ + /*Don't recompute costly scaling if it does not change*/ if (m != ext->mode) { h = (uint16_t)(((uint32_t)ext->hsv.h * 6 * 256) / 360); v = (uint8_t)(((uint16_t)ext->hsv.v * 51) / 20); m = ext->mode; @@ -663,7 +665,7 @@ static lv_color_t angle_to_mode_color_fast(lv_obj_t * obj, uint16_t angle) fast_hsv2rgb(h, angle, v, &r, &g, &b); break; case LV_COLORWHEEL_MODE_VALUE: - /* Don't recompute costly scaling if it does not change */ + /*Don't recompute costly scaling if it does not change*/ if (m != ext->mode) { h = (uint16_t)(((uint32_t)ext->hsv.h * 6 * 256) / 360); s = (uint8_t)(((uint16_t)ext->hsv.s * 51) / 20); m = ext->mode; diff --git a/src/extra/widgets/colorwheel/lv_colorwheel.h b/src/extra/widgets/colorwheel/lv_colorwheel.h index 59484a52c..b257af93d 100644 --- a/src/extra/widgets/colorwheel/lv_colorwheel.h +++ b/src/extra/widgets/colorwheel/lv_colorwheel.h @@ -135,7 +135,7 @@ bool lv_colorwheel_get_color_mode_fixed(lv_obj_t * obj); #endif /*LV_USE_COLORWHEEL*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_COLORWHEEL_H*/ diff --git a/src/extra/widgets/imgbtn/lv_imgbtn.c b/src/extra/widgets/imgbtn/lv_imgbtn.c index 4902721ac..8c7bcd8cd 100644 --- a/src/extra/widgets/imgbtn/lv_imgbtn.c +++ b/src/extra/widgets/imgbtn/lv_imgbtn.c @@ -155,7 +155,7 @@ static void lv_imgbtn_constructor(lv_obj_t * obj, const lv_obj_t * copy) LV_UNUSED(copy); lv_imgbtn_t * imgbtn = (lv_imgbtn_t *)obj; - /*Initialize the allocated 'ext' */ + /*Initialize the allocated 'ext'*/ lv_memset_00((void *)imgbtn->img_src_mid, sizeof(imgbtn->img_src_mid)); lv_memset_00(imgbtn->img_src_left, sizeof(imgbtn->img_src_left)); lv_memset_00(imgbtn->img_src_right, sizeof(imgbtn->img_src_right)); diff --git a/src/extra/widgets/imgbtn/lv_imgbtn.h b/src/extra/widgets/imgbtn/lv_imgbtn.h index 6ab3fe5e0..56e71f7a1 100644 --- a/src/extra/widgets/imgbtn/lv_imgbtn.h +++ b/src/extra/widgets/imgbtn/lv_imgbtn.h @@ -120,7 +120,7 @@ const void * lv_imgbtn_get_src_right(lv_obj_t * imgbtn, lv_imgbtn_state_t state) #endif /*LV_USE_IMGBTN*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_IMGBTN_H*/ diff --git a/src/extra/widgets/keyboard/lv_keyboard.c b/src/extra/widgets/keyboard/lv_keyboard.c index e55824896..c58963b3f 100644 --- a/src/extra/widgets/keyboard/lv_keyboard.c +++ b/src/extra/widgets/keyboard/lv_keyboard.c @@ -350,4 +350,4 @@ static void lv_keyboard_update_map(lv_obj_t * obj) lv_btnmatrix_set_ctrl_map(obj, kb_ctrl[keyboard->mode]); } -#endif /* LV_USE_KEYBOARD*/ +#endif /*LV_USE_KEYBOARD*/ diff --git a/src/extra/widgets/keyboard/lv_keyboard.h b/src/extra/widgets/keyboard/lv_keyboard.h index 3a34a55dc..3c5f6da23 100644 --- a/src/extra/widgets/keyboard/lv_keyboard.h +++ b/src/extra/widgets/keyboard/lv_keyboard.h @@ -35,7 +35,7 @@ extern "C" { * TYPEDEFS **********************/ -/** Current keyboard mode. */ +/** Current keyboard mode.*/ enum { LV_KEYBOARD_MODE_TEXT_LOWER, LV_KEYBOARD_MODE_TEXT_UPPER, @@ -144,10 +144,10 @@ void lv_keyboard_def_event_cb(lv_obj_t * kb, lv_event_t event); * MACROS **********************/ -#endif /* LV_USE_KEYBOARD*/ +#endif /*LV_USE_KEYBOARD*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_KEYBOARD_H*/ diff --git a/src/extra/widgets/led/lv_led.h b/src/extra/widgets/led/lv_led.h index 2a1960a27..b3fe918e2 100644 --- a/src/extra/widgets/led/lv_led.h +++ b/src/extra/widgets/led/lv_led.h @@ -93,7 +93,7 @@ uint8_t lv_led_get_brightness(const lv_obj_t * obj); #endif /*LV_USE_LED*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif diff --git a/src/extra/widgets/list/lv_list.h b/src/extra/widgets/list/lv_list.h index 16de9a45a..f7b05f6a5 100644 --- a/src/extra/widgets/list/lv_list.h +++ b/src/extra/widgets/list/lv_list.h @@ -48,7 +48,7 @@ const char * lv_list_get_btn_text(lv_obj_t * list, lv_obj_t * btn); #endif /*LV_USE_LIST*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_LIST_H*/ diff --git a/src/extra/widgets/lv_widgets.h b/src/extra/widgets/lv_widgets.h index 94a4d3d79..a0a3725fd 100644 --- a/src/extra/widgets/lv_widgets.h +++ b/src/extra/widgets/lv_widgets.h @@ -46,7 +46,7 @@ extern "C" { **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_WIDGETS_H*/ diff --git a/src/extra/widgets/msgbox/lv_msgbox.h b/src/extra/widgets/msgbox/lv_msgbox.h index d340aa65d..024d74ba9 100644 --- a/src/extra/widgets/msgbox/lv_msgbox.h +++ b/src/extra/widgets/msgbox/lv_msgbox.h @@ -67,7 +67,7 @@ void lv_msgbox_close(lv_obj_t * mbox); #endif /*LV_USE_MSGBOX*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_MSGBOX_H*/ diff --git a/src/extra/widgets/spinbox/lv_spinbox.c b/src/extra/widgets/spinbox/lv_spinbox.c index c7dbd5653..06dd1ab94 100644 --- a/src/extra/widgets/spinbox/lv_spinbox.c +++ b/src/extra/widgets/spinbox/lv_spinbox.c @@ -303,7 +303,7 @@ static void lv_spinbox_constructor(lv_obj_t * obj, const lv_obj_t * copy) static lv_res_t lv_spinbox_signal(lv_obj_t * obj, lv_signal_t sign, void * param) { - /* Include the ancient signal function */ + /*Include the ancient signal function*/ lv_res_t res = LV_RES_OK; res = lv_obj_signal_base(MY_CLASS, obj, sign, param); if(res != LV_RES_OK) return res; diff --git a/src/extra/widgets/spinbox/lv_spinbox.h b/src/extra/widgets/spinbox/lv_spinbox.h index 80e5fde59..1d649fdde 100644 --- a/src/extra/widgets/spinbox/lv_spinbox.h +++ b/src/extra/widgets/spinbox/lv_spinbox.h @@ -34,7 +34,7 @@ extern "C" { /*Data of spinbox*/ typedef struct { lv_textarea_t ta; /*Ext. of ancestor*/ - /*New data for this type */ + /*New data for this type*/ int32_t value; int32_t range_max; int32_t range_min; @@ -166,6 +166,6 @@ void lv_spinbox_decrement(lv_obj_t * obj); #endif /*LV_USE_SPINBOX*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_USE_SPINBOX*/ diff --git a/src/extra/widgets/spinner/lv_spinner.h b/src/extra/widgets/spinner/lv_spinner.h index 8f465dfab..92cdac573 100644 --- a/src/extra/widgets/spinner/lv_spinner.h +++ b/src/extra/widgets/spinner/lv_spinner.h @@ -43,7 +43,7 @@ lv_obj_t * lv_spinner_create(lv_obj_t * par, uint32_t time, uint32_t arc_length) #endif /*LV_USE_SPINNER*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_SPINNER_H*/ diff --git a/src/extra/widgets/tabview/lv_tabview.h b/src/extra/widgets/tabview/lv_tabview.h index 98b7670c9..3ff22fd0c 100644 --- a/src/extra/widgets/tabview/lv_tabview.h +++ b/src/extra/widgets/tabview/lv_tabview.h @@ -60,7 +60,7 @@ uint16_t lv_tabview_get_tab_act(lv_obj_t * tv); #endif /*LV_USE_TABVIEW*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_TABVIEW_H*/ diff --git a/src/extra/widgets/tileview/lv_tileview.h b/src/extra/widgets/tileview/lv_tileview.h index e8703563e..32fc983fa 100644 --- a/src/extra/widgets/tileview/lv_tileview.h +++ b/src/extra/widgets/tileview/lv_tileview.h @@ -65,7 +65,7 @@ void lv_obj_set_tile_id(lv_obj_t * tv, uint32_t col_id, uint32_t row_id, lv_anim #endif /*LV_USE_TILEVIEW*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_TILEVIEW_H*/ diff --git a/src/extra/widgets/win/lv_win.h b/src/extra/widgets/win/lv_win.h index 8b1a0db6c..fd69691aa 100644 --- a/src/extra/widgets/win/lv_win.h +++ b/src/extra/widgets/win/lv_win.h @@ -45,7 +45,7 @@ lv_obj_t * lv_win_get_content(lv_obj_t * win); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_WIN_H*/ diff --git a/src/font/lv_font.h b/src/font/lv_font.h index fd313fbef..58954071d 100644 --- a/src/font/lv_font.h +++ b/src/font/lv_font.h @@ -33,9 +33,9 @@ extern "C" { * General types *-----------------*/ -/** Describes the properties of a glyph. */ +/** Describes the properties of a glyph.*/ typedef struct { - uint16_t adv_w; /**< The glyph needs this space. Draw the next glyph after this width. */ + uint16_t adv_w; /**< The glyph needs this space. Draw the next glyph after this width.*/ uint16_t box_w; /**< Width of the glyph's bounding box*/ uint16_t box_h; /**< Height of the glyph's bounding box*/ int16_t ofs_x; /**< x offset of the bounding box*/ @@ -43,7 +43,7 @@ typedef struct { uint8_t bpp; /**< Bit-per-pixel: 1, 2, 4, 8*/ } lv_font_glyph_dsc_t; -/** The bitmaps might be upscaled by 3 to achieve subpixel rendering. */ +/** The bitmaps might be upscaled by 3 to achieve subpixel rendering.*/ enum { LV_FONT_SUBPX_NONE, LV_FONT_SUBPX_HOR, @@ -71,7 +71,7 @@ typedef struct _lv_font_struct { const void * dsc; /**< Store implementation specific or run_time data or caching here*/ #if LV_USE_USER_DATA - void * user_data; /**< Custom user data for font. */ + void * user_data; /**< Custom user data for font.*/ #endif } lv_font_t; @@ -238,7 +238,7 @@ LV_FONT_CUSTOM_DECLARE #endif #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*USE_FONT*/ diff --git a/src/font/lv_font_fmt_txt.c b/src/font/lv_font_fmt_txt.c index 9146b42f3..6c5b8994d 100644 --- a/src/font/lv_font_fmt_txt.c +++ b/src/font/lv_font_fmt_txt.c @@ -44,7 +44,7 @@ static int32_t kern_pair_16_compare(const void * ref, const void * element); static inline void bits_write(uint8_t * out, uint32_t bit_pos, uint8_t val, uint8_t len); static inline void rle_init(const uint8_t * in, uint8_t bpp); static inline uint8_t rle_next(void); -#endif /* LV_USE_FONT_COMPRESSED */ +#endif /*LV_USE_FONT_COMPRESSED*/ /********************** * STATIC VARIABLES @@ -56,7 +56,7 @@ static int32_t kern_pair_16_compare(const void * ref, const void * element); static uint8_t rle_prev_v; static uint8_t rle_cnt; static rle_state_t rle_state; -#endif /* LV_USE_FONT_COMPRESSED */ +#endif /*LV_USE_FONT_COMPRESSED*/ /********************** * GLOBAL PROTOTYPES @@ -123,7 +123,7 @@ const uint8_t * lv_font_get_bitmap_fmt_txt(const lv_font_t * font, uint32_t unic decompress(&fdsc->glyph_bitmap[gdsc->bitmap_index], LV_GC_ROOT(_lv_font_decompr_buf), gdsc->box_w, gdsc->box_h, (uint8_t)fdsc->bpp, prefilter); return LV_GC_ROOT(_lv_font_decompr_buf); -#else /* !LV_USE_FONT_COMPRESSED */ +#else /*!LV_USE_FONT_COMPRESSED*/ return NULL; #endif } @@ -271,8 +271,8 @@ static int8_t get_kern_value(const lv_font_t * font, uint32_t gid_left, uint32_t /*Kern pairs*/ const lv_font_fmt_txt_kern_pair_t * kdsc = fdsc->kern_dsc; if(kdsc->glyph_ids_size == 0) { - /* Use binary search to find the kern value. - * The pairs are ordered left_id first, then right_id secondly. */ + /*Use binary search to find the kern value. + *The pairs are ordered left_id first, then right_id secondly.*/ const uint16_t * g_ids = kdsc->glyph_ids; uint16_t g_id_both = (gid_right << 8) + gid_left; /*Create one number from the ids*/ uint16_t * kid_p = _lv_utils_bsearch(&g_id_both, g_ids, kdsc->pair_cnt, 2, kern_pair_8_compare); @@ -284,8 +284,8 @@ static int8_t get_kern_value(const lv_font_t * font, uint32_t gid_left, uint32_t } } else if(kdsc->glyph_ids_size == 1) { - /* Use binary search to find the kern value. - * The pairs are ordered left_id first, then right_id secondly. */ + /*Use binary search to find the kern value. + *The pairs are ordered left_id first, then right_id secondly.*/ const uint32_t * g_ids = kdsc->glyph_ids; uint32_t g_id_both = (gid_right << 16) + gid_left; /*Create one number from the ids*/ uint32_t * kid_p = _lv_utils_bsearch(&g_id_both, g_ids, kdsc->pair_cnt, 4, kern_pair_16_compare); @@ -307,8 +307,8 @@ static int8_t get_kern_value(const lv_font_t * font, uint32_t gid_left, uint32_t uint8_t left_class = kdsc->left_class_mapping[gid_left]; uint8_t right_class = kdsc->right_class_mapping[gid_right]; - /* If class = 0, kerning not exist for that glyph - * else got the value form `class_pair_values` 2D array*/ + /*If class = 0, kerning not exist for that glyph + *else got the value form `class_pair_values` 2D array*/ if(left_class > 0 && right_class > 0) { value = kdsc->class_pair_values[(left_class - 1) * kdsc->right_class_cnt + (right_class - 1)]; } @@ -567,7 +567,7 @@ static inline uint8_t rle_next(void) return ret; } -#endif /* LV_USE_FONT_COMPRESSED */ +#endif /*LV_USE_FONT_COMPRESSED*/ /** Code Comparator. * diff --git a/src/font/lv_font_fmt_txt.h b/src/font/lv_font_fmt_txt.h index 76056841c..5a650494b 100644 --- a/src/font/lv_font_fmt_txt.h +++ b/src/font/lv_font_fmt_txt.h @@ -26,18 +26,18 @@ extern "C" { * TYPEDEFS **********************/ -/** This describes a glyph. */ +/** This describes a glyph.*/ typedef struct { #if LV_FONT_FMT_TXT_LARGE == 0 - uint32_t bitmap_index : 20; /**< Start index of the bitmap. A font can be max 1 MB. */ - uint32_t adv_w : 12; /**< Draw the next glyph after this width. 8.4 format (real_value * 16 is stored). */ + uint32_t bitmap_index : 20; /**< Start index of the bitmap. A font can be max 1 MB.*/ + uint32_t adv_w : 12; /**< Draw the next glyph after this width. 8.4 format (real_value * 16 is stored).*/ uint8_t box_w; /**< Width of the glyph's bounding box*/ uint8_t box_h; /**< Height of the glyph's bounding box*/ int8_t ofs_x; /**< x offset of the bounding box*/ int8_t ofs_y; /**< y offset of the bounding box. Measured from the top of the line*/ #else - uint32_t bitmap_index; /**< Start index of the bitmap. A font can be max 4 GB. */ - uint32_t adv_w; /**< Draw the next glyph after this width. 28.4 format (real_value * 16 is stored). */ + uint32_t bitmap_index; /**< Start index of the bitmap. A font can be max 4 GB.*/ + uint32_t adv_w; /**< Draw the next glyph after this width. 28.4 format (real_value * 16 is stored).*/ uint16_t box_w; /**< Width of the glyph's bounding box*/ uint16_t box_h; /**< Height of the glyph's bounding box*/ int16_t ofs_x; /**< x offset of the bounding box*/ @@ -45,7 +45,7 @@ typedef struct { #endif } lv_font_fmt_txt_glyph_dsc_t; -/** Format of font character map. */ +/** Format of font character map.*/ enum { LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL, LV_FONT_FMT_TXT_CMAP_SPARSE_FULL, @@ -55,19 +55,20 @@ enum { typedef uint8_t lv_font_fmt_txt_cmap_type_t; -/* Map codepoints to a `glyph_dsc`s +/** + * Map codepoints to a `glyph_dsc`s * Several formats are supported to optimize memory usage * See https://github.com/lvgl/lv_font_conv/blob/master/doc/font_spec.md */ typedef struct { - /** First Unicode character for this range */ + /** First Unicode character for this range*/ uint32_t range_start; /** Number of Unicode characters related to this range. * Last Unicode character = range_start + range_length - 1*/ uint16_t range_length; - /** First glyph ID (array index of `glyph_dsc`) for this range */ + /** First glyph ID (array index of `glyph_dsc`) for this range*/ uint16_t glyph_id_start; /* @@ -155,7 +156,7 @@ typedef struct { uint32_t last_glyph_id; }lv_font_fmt_txt_glyph_cache_t; -/*Describe store additional data for fonts */ +/*Describe store additional data for fonts*/ typedef struct { /*The bitmaps of all glyphs*/ const uint8_t * glyph_bitmap; @@ -163,11 +164,12 @@ typedef struct { /*Describe the glyphs*/ const lv_font_fmt_txt_glyph_dsc_t * glyph_dsc; - /* Map the glyphs to Unicode characters. - * Array of `lv_font_cmap_fmt_txt_t` variables*/ + /*Map the glyphs to Unicode characters. + *Array of `lv_font_cmap_fmt_txt_t` variables*/ const lv_font_fmt_txt_cmap_t * cmaps; - /* Store kerning values. + /** + * Store kerning values. * Can be `lv_font_fmt_txt_kern_pair_t * or `lv_font_kern_classes_fmt_txt_t *` * depending on `kern_classes` */ @@ -232,7 +234,7 @@ void _lv_font_clean_up_fmt_txt(void); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_FONT_FMT_TXT_H*/ diff --git a/src/font/lv_font_loader.c b/src/font/lv_font_loader.c index 7fc8172ea..54e53c607 100644 --- a/src/font/lv_font_loader.c +++ b/src/font/lv_font_loader.c @@ -441,7 +441,7 @@ static int32_t load_glyph(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc, int next_offset = (i < loca_count - 1) ? glyph_offset[i + 1] : (uint32_t)glyph_length; int bmp_size = next_offset - glyph_offset[i] - nbits / 8; - if(nbits % 8 == 0) { /* Fast path */ + if(nbits % 8 == 0) { /*Fast path*/ if(lv_fs_read(fp, &glyph_bmp[cur_bmp_size], bmp_size, NULL) != LV_FS_RES_OK) { return -1; } @@ -485,7 +485,7 @@ static bool lvgl_load_font(lv_fs_file_t * fp, lv_font_t * font) font->dsc = font_dsc; - /* header */ + /*header*/ int32_t header_length = read_label(fp, 0, "head"); if(header_length < 0) { return false; @@ -508,14 +508,14 @@ static bool lvgl_load_font(lv_fs_file_t * fp, lv_font_t * font) font_dsc->kern_scale = font_header.kerning_scale; font_dsc->bitmap_format = font_header.compression_id; - /* cmaps */ + /*cmaps*/ uint32_t cmaps_start = header_length; int32_t cmaps_length = load_cmaps(fp, font_dsc, cmaps_start); if(cmaps_length < 0) { return false; } - /* loca */ + /*loca*/ uint32_t loca_start = cmaps_start + cmaps_length; int32_t loca_length = read_label(fp, loca_start, "loca"); if(loca_length < 0) { @@ -555,7 +555,7 @@ static bool lvgl_load_font(lv_fs_file_t * fp, lv_font_t * font) return false; } - /* glyph */ + /*glyph*/ uint32_t glyph_start = loca_start + loca_length; int32_t glyph_length = load_glyph( fp, font_dsc, glyph_start, glyph_offset, loca_count, &font_header); @@ -594,7 +594,7 @@ int32_t load_kern(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc, uint8_t f return -1; } - if(0 == kern_format_type) { /* sorted pairs */ + if(0 == kern_format_type) { /*sorted pairs*/ lv_font_fmt_txt_kern_pair_t * kern_pair = lv_mem_alloc(sizeof(lv_font_fmt_txt_kern_pair_t)); memset(kern_pair, 0, sizeof(lv_font_fmt_txt_kern_pair_t)); @@ -631,7 +631,7 @@ int32_t load_kern(lv_fs_file_t * fp, lv_font_fmt_txt_dsc_t * font_dsc, uint8_t f return -1; } } - else if(3 == kern_format_type) { /* array M*N of classes */ + else if(3 == kern_format_type) { /*array M*N of classes*/ lv_font_fmt_txt_kern_classes_t * kern_classes = lv_mem_alloc(sizeof(lv_font_fmt_txt_kern_classes_t)); diff --git a/src/font/lv_font_loader.h b/src/font/lv_font_loader.h index 589b0bc25..783cb2e75 100644 --- a/src/font/lv_font_loader.h +++ b/src/font/lv_font_loader.h @@ -34,7 +34,7 @@ void lv_font_free(lv_font_t * font); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_FONT_LOADER_H*/ diff --git a/src/font/lv_symbol_def.h b/src/font/lv_symbol_def.h index eeaf47d8c..6dbe90786 100644 --- a/src/font/lv_symbol_def.h +++ b/src/font/lv_symbol_def.h @@ -1,6 +1,6 @@ #ifndef LV_SYMBOL_DEF_H #define LV_SYMBOL_DEF_H -/* clang-format off */ +/*clang-format off*/ #ifdef __cplusplus extern "C" { @@ -12,7 +12,7 @@ extern "C" { * Symbols from FontAwesome font *-----------------------------*/ -/* In the font converter use this list as range: +/*In the font converter use this list as range: 61441, 61448, 61451, 61452, 61453, 61457, 61459, 61461, 61465, 61468, 61473, 61478, 61479, 61480, 61502, 61512, 61515, 61516, 61517, 61521, 61522, 61523, 61524, 61543, 61544, 61550, 61552, 61553, 61556, 61559, @@ -156,7 +156,7 @@ enum { }; #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_SYMBOL_DEF_H*/ diff --git a/src/gpu/lv_gpu_nxp_pxp.c b/src/gpu/lv_gpu_nxp_pxp.c index 212d2f863..5d986938a 100644 --- a/src/gpu/lv_gpu_nxp_pxp.c +++ b/src/gpu/lv_gpu_nxp_pxp.c @@ -109,7 +109,7 @@ lv_res_t lv_gpu_nxp_pxp_init(lv_nxp_pxp_cfg_t * cfg) } PXP_Init(PXP); - PXP_EnableCsc1(PXP, false); /* Disable CSC1, it is enabled by default. */ + PXP_EnableCsc1(PXP, false); /*Disable CSC1, it is enabled by default.*/ PXP_EnableInterrupts(PXP, kPXP_CompleteInterruptEnable); pxp_cfg = *cfg; @@ -147,10 +147,10 @@ void lv_gpu_nxp_pxp_fill(lv_color_t * dest_buf, lv_coord_t dest_width, const lv_ lv_opa_t opa) { PXP_Init(LV_GPU_NXP_PXP_ID); - PXP_EnableCsc1(LV_GPU_NXP_PXP_ID, false); /* Disable CSC1, it is enabled by default. */ - PXP_SetProcessBlockSize(PXP, kPXP_BlockSize16); /* Block size 16x16 for higher performance */ + PXP_EnableCsc1(LV_GPU_NXP_PXP_ID, false); /*Disable CSC1, it is enabled by default.*/ + PXP_SetProcessBlockSize(PXP, kPXP_BlockSize16); /*Block size 16x16 for higher performance*/ - /* OUT buffer configure */ + /*OUT buffer configure*/ pxp_output_buffer_config_t outputConfig = { .pixelFormat = PXP_OUT_PIXEL_FORMAT, .interlacedMode = kPXP_OutputProgressive, @@ -165,17 +165,17 @@ void lv_gpu_nxp_pxp_fill(lv_color_t * dest_buf, lv_coord_t dest_width, const lv_ PXP_SetOutputBufferConfig(LV_GPU_NXP_PXP_ID, &outputConfig); if(opa > LV_OPA_MAX) { - /* Simple color fill without opacity - AS disabled, PS as color generator */ - PXP_SetAlphaSurfacePosition(LV_GPU_NXP_PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U); /* Disable AS. */ - PXP_SetProcessSurfacePosition(LV_GPU_NXP_PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U); /* Disable PS. */ + /*Simple color fill without opacity - AS disabled, PS as color generator*/ + PXP_SetAlphaSurfacePosition(LV_GPU_NXP_PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U); /*Disable AS.*/ + PXP_SetProcessSurfacePosition(LV_GPU_NXP_PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U); /*Disable PS.*/ PXP_SetProcessSurfaceBackGroundColor(LV_GPU_NXP_PXP_ID, lv_color_to32(color)); } else { - /* Fill with opacity - AS used as source (same as OUT), PS used as color generator, blended together */ + /*Fill with opacity - AS used as source (same as OUT), PS used as color generator, blended together*/ pxp_as_buffer_config_t asBufferConfig; pxp_porter_duff_config_t pdConfig; - /* Set AS to OUT */ + /*Set AS to OUT*/ asBufferConfig.pixelFormat = PXP_AS_PIXEL_FORMAT; asBufferConfig.bufferAddr = (uint32_t)outputConfig.buffer0Addr; asBufferConfig.pitchBytes = outputConfig.pitchBytes; @@ -184,11 +184,11 @@ void lv_gpu_nxp_pxp_fill(lv_color_t * dest_buf, lv_coord_t dest_width, const lv_ PXP_SetAlphaSurfacePosition(LV_GPU_NXP_PXP_ID, 0U, 0U, fill_area->x2 - fill_area->x1 + 1, fill_area->y2 - fill_area->y1 + 1); - /* Disable PS, use as color generator */ + /*Disable PS, use as color generator*/ PXP_SetProcessSurfacePosition(LV_GPU_NXP_PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U); PXP_SetProcessSurfaceBackGroundColor(LV_GPU_NXP_PXP_ID, lv_color_to32(color)); - /* Configure Porter-Duff blending - For RGB 565 only! */ + /*Configure Porter-Duff blending - For RGB 565 only!*/ pdConfig.enable = 1; pdConfig.dstColorMode = kPXP_PorterDuffColorStraight; pdConfig.srcColorMode = kPXP_PorterDuffColorStraight; @@ -198,12 +198,12 @@ void lv_gpu_nxp_pxp_fill(lv_color_t * dest_buf, lv_coord_t dest_width, const lv_ pdConfig.dstFactorMode = kPXP_PorterDuffFactorStraight; pdConfig.srcGlobalAlpha = opa; pdConfig.dstGlobalAlpha = 255 - opa; - pdConfig.srcAlphaMode = kPXP_PorterDuffAlphaStraight; /* don't care */ - pdConfig.dstAlphaMode = kPXP_PorterDuffAlphaStraight; /* don't care */ + pdConfig.srcAlphaMode = kPXP_PorterDuffAlphaStraight; /*don't care*/ + pdConfig.dstAlphaMode = kPXP_PorterDuffAlphaStraight; /*don't care*/ PXP_SetPorterDuffConfig(LV_GPU_NXP_PXP_ID, &pdConfig); } - lv_gpu_nxp_pxp_run(); /* Start PXP task */ + lv_gpu_nxp_pxp_run(); /*Start PXP task*/ } /** @@ -226,14 +226,14 @@ void lv_gpu_nxp_pxp_blit(lv_color_t * dest, lv_coord_t dest_width, const lv_colo lv_coord_t copy_width, lv_coord_t copy_height, lv_opa_t opa) { - if(recolorEnabled) { /* switch to recolor version of blit */ + if(recolorEnabled) { /*switch to recolor version of blit*/ lv_gpu_nxp_pxp_blit_recolor(dest, dest_width, src, src_width, copy_width, copy_height, opa, recolor, recolorOpa); return; }; PXP_Init(PXP); - PXP_EnableCsc1(PXP, false); /* Disable CSC1, it is enabled by default. */ - PXP_SetProcessBlockSize(PXP, kPXP_BlockSize16); /* block size 16x16 for higher performance */ + PXP_EnableCsc1(PXP, false); /*Disable CSC1, it is enabled by default.*/ + PXP_SetProcessBlockSize(PXP, kPXP_BlockSize16); /*block size 16x16 for higher performance*/ pxp_output_buffer_config_t outputBufferConfig; pxp_as_buffer_config_t asBufferConfig; @@ -245,12 +245,12 @@ void lv_gpu_nxp_pxp_blit(lv_color_t * dest, lv_coord_t dest_width, const lv_colo asBlendConfig.ropMode = kPXP_RopMergeAs; if(opa >= LV_OPA_MAX && !colorKeyEnabled) { - /* Simple blit, no effect - Disable PS buffer */ + /*Simple blit, no effect - Disable PS buffer*/ PXP_SetProcessSurfacePosition(LV_GPU_NXP_PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U); } else { - /* Alpha blending or color keying enabled - PS must be enabled to fetch background pixels - PS and OUT buffers are the same, blend will be done in-place */ + /*Alpha blending or color keying enabled - PS must be enabled to fetch background pixels + PS and OUT buffers are the same, blend will be done in-place*/ pxp_ps_buffer_config_t psBufferConfig = { .pixelFormat = PXP_PS_PIXEL_FORMAT, .swapByte = false, @@ -264,7 +264,7 @@ void lv_gpu_nxp_pxp_blit(lv_color_t * dest, lv_coord_t dest_width, const lv_colo PXP_SetProcessSurfacePosition(LV_GPU_NXP_PXP_ID, 0U, 0U, copy_width - 1, copy_height - 1); } - /* AS buffer - source image */ + /*AS buffer - source image*/ asBufferConfig.pixelFormat = PXP_AS_PIXEL_FORMAT; asBufferConfig.bufferAddr = (uint32_t)src; asBufferConfig.pitchBytes = src_width * sizeof(lv_color_t); @@ -280,7 +280,7 @@ void lv_gpu_nxp_pxp_blit(lv_color_t * dest, lv_coord_t dest_width, const lv_colo } PXP_EnableAlphaSurfaceOverlayColorKey(LV_GPU_NXP_PXP_ID, colorKeyEnabled); - /* Output buffer. */ + /*Output buffer.*/ outputBufferConfig.pixelFormat = (pxp_output_pixel_format_t)PXP_OUT_PIXEL_FORMAT; outputBufferConfig.interlacedMode = kPXP_OutputProgressive; outputBufferConfig.buffer0Addr = (uint32_t)dest; @@ -293,7 +293,7 @@ void lv_gpu_nxp_pxp_blit(lv_color_t * dest, lv_coord_t dest_width, const lv_colo lv_gpu_nxp_invalidate_cache(outputBufferConfig.buffer0Addr, outputBufferConfig.width, outputBufferConfig.height, outputBufferConfig.pitchBytes, sizeof(lv_color_t)); - lv_gpu_nxp_pxp_run(); /* Start PXP task */ + lv_gpu_nxp_pxp_run(); /*Start PXP task*/ } /** @@ -375,21 +375,21 @@ static void lv_gpu_nxp_pxp_blit_recolor(lv_color_t * dest, lv_coord_t dest_width pxp_as_buffer_config_t asBufferConfig; if(colorKeyEnabled) { - /* should never get here, recolor & color keying not supported. Draw black box instead. */ + /*should never get here, recolor & color keying not supported. Draw black box instead.*/ const lv_area_t fill_area = {.x1 = 0, .y1 = 0, .x2 = copy_width - 1, .y2 = copy_height - 1}; lv_gpu_nxp_pxp_fill(dest, dest_width, &fill_area, lv_color_black(), LV_OPA_MAX); LV_LOG_WARN("Recoloring and color keying is not supported. Black rectangle rendered."); return ; } else { - /* Recoloring without color keying */ + /*Recoloring without color keying*/ if(opa > LV_OPA_MAX) { - /* Recolor with full opacity - AS source image, PS color generator, OUT destination */ + /*Recolor with full opacity - AS source image, PS color generator, OUT destination*/ PXP_Init(PXP); - PXP_EnableCsc1(PXP, false); /* Disable CSC1, it is enabled by default. */ - PXP_SetProcessBlockSize(PXP, kPXP_BlockSize16); /* block size 16x16 for higher performance */ + PXP_EnableCsc1(PXP, false); /*Disable CSC1, it is enabled by default.*/ + PXP_SetProcessBlockSize(PXP, kPXP_BlockSize16); /*block size 16x16 for higher performance*/ - /* AS buffer - source image */ + /*AS buffer - source image*/ asBufferConfig.pixelFormat = PXP_AS_PIXEL_FORMAT; asBufferConfig.bufferAddr = (uint32_t)src; asBufferConfig.pitchBytes = src_width * sizeof(lv_color_t); @@ -399,11 +399,11 @@ static void lv_gpu_nxp_pxp_blit_recolor(lv_color_t * dest, lv_coord_t dest_width lv_gpu_nxp_invalidate_cache(asBufferConfig.bufferAddr, copy_width, copy_height, asBufferConfig.pitchBytes, sizeof(lv_color_t)); - /* Disable PS buffer, use as color generator */ + /*Disable PS buffer, use as color generator*/ PXP_SetProcessSurfacePosition(LV_GPU_NXP_PXP_ID, 0xFFFFU, 0xFFFFU, 0U, 0U); PXP_SetProcessSurfaceBackGroundColor(LV_GPU_NXP_PXP_ID, lv_color_to32(recolor)); - /* Output buffer */ + /*Output buffer*/ outputBufferConfig.pixelFormat = (pxp_output_pixel_format_t)PXP_OUT_PIXEL_FORMAT; outputBufferConfig.interlacedMode = kPXP_OutputProgressive; outputBufferConfig.buffer0Addr = (uint32_t)dest; @@ -418,7 +418,7 @@ static void lv_gpu_nxp_pxp_blit_recolor(lv_color_t * dest, lv_coord_t dest_width pxp_porter_duff_config_t pdConfig; - /* Configure Porter-Duff blending - For RGB 565 only! */ + /*Configure Porter-Duff blending - For RGB 565 only!*/ pdConfig.enable = 1; pdConfig.dstColorMode = kPXP_PorterDuffColorStraight; pdConfig.srcColorMode = kPXP_PorterDuffColorStraight; @@ -428,27 +428,27 @@ static void lv_gpu_nxp_pxp_blit_recolor(lv_color_t * dest, lv_coord_t dest_width pdConfig.dstFactorMode = kPXP_PorterDuffFactorStraight; pdConfig.srcGlobalAlpha = recolorOpa; pdConfig.dstGlobalAlpha = 255 - recolorOpa; - pdConfig.srcAlphaMode = kPXP_PorterDuffAlphaStraight; /* don't care */ - pdConfig.dstAlphaMode = kPXP_PorterDuffAlphaStraight; /* don't care */ + pdConfig.srcAlphaMode = kPXP_PorterDuffAlphaStraight; /*don't care*/ + pdConfig.dstAlphaMode = kPXP_PorterDuffAlphaStraight; /*don't care*/ PXP_SetPorterDuffConfig(LV_GPU_NXP_PXP_ID, &pdConfig); - lv_gpu_nxp_pxp_run(); /* Start PXP task */ + lv_gpu_nxp_pxp_run(); /*Start PXP task*/ } else { - /* Recolor with transparency */ + /*Recolor with transparency*/ - /* Step 1: Recolor with full opacity to temporary buffer */ + /*Step 1: Recolor with full opacity to temporary buffer*/ lv_color_t * tmpBuf = (lv_color_t *)lv_mem_buf_get(copy_width * copy_height * sizeof(lv_color_t)); lv_gpu_nxp_pxp_blit_recolor(tmpBuf, copy_width, src, src_width, copy_width, copy_height, LV_OPA_COVER, recolor, recolorOpa); - /* Step 2: BLIT temporary results with required opacity to output */ - lv_gpu_nxp_pxp_disable_recolor(); /* make sure to take BLIT path, not the recolor */ + /*Step 2: BLIT temporary results with required opacity to output*/ + lv_gpu_nxp_pxp_disable_recolor(); /*make sure to take BLIT path, not the recolor*/ lv_gpu_nxp_pxp_blit(dest, dest_width, tmpBuf, copy_width, copy_width, copy_height, opa); - lv_gpu_nxp_pxp_enable_recolor(recolor, recolorOpa); /* restore state */ + lv_gpu_nxp_pxp_enable_recolor(recolor, recolorOpa); /*restore state*/ - /* Step 3: Clean-up memory */ + /*Step 3: Clean-up memory*/ lv_mem_buf_release(tmpBuf); } } @@ -473,4 +473,4 @@ static void lv_gpu_nxp_invalidate_cache(uint32_t address, uint32_t width, uint32 address += stride; } } -#endif /* LV_USE_GPU && LV_USE_GPU_NXP_PXP */ +#endif /*LV_USE_GPU && LV_USE_GPU_NXP_PXP*/ diff --git a/src/gpu/lv_gpu_nxp_pxp.h b/src/gpu/lv_gpu_nxp_pxp.h index 3cd168841..9d3957246 100644 --- a/src/gpu/lv_gpu_nxp_pxp.h +++ b/src/gpu/lv_gpu_nxp_pxp.h @@ -45,29 +45,29 @@ extern "C" { * DEFINES *********************/ -/** PXP module instance to use */ +/** PXP module instance to use*/ #define LV_GPU_NXP_PXP_ID PXP -/** PXP interrupt line ID */ +/** PXP interrupt line I*/ #define LV_GPU_NXP_PXP_IRQ_ID PXP_IRQn #ifndef LV_GPU_NXP_PXP_BLIT_SIZE_LIMIT -/** Minimum area (in pixels) for image copy with 100% opacity to be handled by PXP */ +/** Minimum area (in pixels) for image copy with 100% opacity to be handled by PXP*/ #define LV_GPU_NXP_PXP_BLIT_SIZE_LIMIT 32 #endif #ifndef LV_GPU_NXP_PXP_BLIT_OPA_SIZE_LIMIT -/** Minimum area (in pixels) for image copy with transparency to be handled by PXP */ +/** Minimum area (in pixels) for image copy with transparency to be handled by PXP*/ #define LV_GPU_NXP_PXP_BLIT_OPA_SIZE_LIMIT 16 #endif #ifndef LV_GPU_NXP_PXP_FILL_SIZE_LIMIT -/** Minimum area (in pixels) to be filled by PXP with 100% opacity */ +/** Minimum area (in pixels) to be filled by PXP with 100% opacity*/ #define LV_GPU_NXP_PXP_FILL_SIZE_LIMIT 64 #endif #ifndef LV_GPU_NXP_PXP_FILL_OPA_SIZE_LIMIT -/** Minimum area (in pixels) to be filled by PXP with transparency */ +/** Minimum area (in pixels) to be filled by PXP with transparency*/ #define LV_GPU_NXP_PXP_FILL_OPA_SIZE_LIMIT 32 #endif @@ -79,13 +79,13 @@ extern "C" { * interrupt init/wait/deinit. */ typedef struct { - /** Callback for PXP interrupt initialization */ + /** Callback for PXP interrupt initialization*/ lv_res_t (*pxp_interrupt_init)(void); - /** Callback for PXP interrupt de-initialization */ + /** Callback for PXP interrupt de-initialization*/ void (*pxp_interrupt_deinit)(void); - /** Callback that should start PXP and wait for operation complete */ + /** Callback that should start PXP and wait for operation complete*/ void (*pxp_run)(void); } lv_nxp_pxp_cfg_t; @@ -176,7 +176,7 @@ void lv_gpu_nxp_pxp_disable_recolor(void); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif -#endif /* LV_SRC_LV_GPU_LV_GPU_NXP_PXP_H_ */ +#endif /*LV_SRC_LV_GPU_LV_GPU_NXP_PXP_H_*/ diff --git a/src/gpu/lv_gpu_nxp_pxp_osa.c b/src/gpu/lv_gpu_nxp_pxp_osa.c index 81163c10a..8e56efbf5 100644 --- a/src/gpu/lv_gpu_nxp_pxp_osa.c +++ b/src/gpu/lv_gpu_nxp_pxp_osa.c @@ -162,4 +162,4 @@ lv_nxp_pxp_cfg_t pxp_default_cfg = { .pxp_run = _lv_gpu_nxp_pxp_run }; -#endif /* LV_USE_GPU_NXP_PXP && LV_USE_GPU_NXP_PXP_AUTO_INIT */ +#endif /*LV_USE_GPU_NXP_PXP && LV_USE_GPU_NXP_PXP_AUTO_INIT*/ diff --git a/src/gpu/lv_gpu_nxp_pxp_osa.h b/src/gpu/lv_gpu_nxp_pxp_osa.h index eacd009ef..ab30b8d06 100644 --- a/src/gpu/lv_gpu_nxp_pxp_osa.h +++ b/src/gpu/lv_gpu_nxp_pxp_osa.h @@ -41,7 +41,7 @@ extern lv_nxp_pxp_cfg_t pxp_default_cfg; #endif #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif -#endif /* LV_SRC_LV_GPU_LV_GPU_NXP_PXP_OSA_H_ */ +#endif /*LV_SRC_LV_GPU_LV_GPU_NXP_PXP_OSA_H_*/ diff --git a/src/gpu/lv_gpu_nxp_vglite.c b/src/gpu/lv_gpu_nxp_vglite.c index ad7286a7f..64fd654bc 100644 --- a/src/gpu/lv_gpu_nxp_vglite.c +++ b/src/gpu/lv_gpu_nxp_vglite.c @@ -91,7 +91,7 @@ lv_res_t lv_gpu_nxp_vglite_fill(lv_color_t * dest_buf, lv_coord_t dest_width, lv vg_lite_buffer_t rt; vg_lite_rectangle_t rect; vg_lite_error_t err = VG_LITE_SUCCESS; - lv_color32_t col32 = {.full = lv_color_to32(color)}; /* Convert color to RGBA8888 */ + lv_color32_t col32 = {.full = lv_color_to32(color)}; /*Convert color to RGBA8888*/ lv_disp_t * disp = _lv_refr_get_disp_refreshing(); if(init_vg_buf(&rt, dest_width, dest_height, dest_width * sizeof(lv_color_t), dest_buf) != LV_RES_OK) { @@ -101,24 +101,24 @@ lv_res_t lv_gpu_nxp_vglite_fill(lv_color_t * dest_buf, lv_coord_t dest_width, lv return LV_RES_INV; } - if(opa >= LV_OPA_MAX) { /* Opaque fill */ + if(opa >= LV_OPA_MAX) { /*Opaque fill*/ rect.x = fill_area->x1; rect.y = fill_area->y1; rect.width = (fill_area->x2 - fill_area->x1) + 1; rect.height = (fill_area->y2 - fill_area->y1) + 1; - if(disp && disp->driver->clean_dcache_cb) { /* Clean & invalidate cache */ + if(disp && disp->driver->clean_dcache_cb) { /*Clean & invalidate cache*/ disp->driver->clean_dcache_cb(&disp->driver); } err |= vg_lite_clear(&rt, &rect, col32.full); err |= vg_lite_finish(); } - else { /* fill with transparency */ + else { /*fill with transparency*/ vg_lite_path_t path; lv_color32_t colMix; - int16_t path_data[] = { /* VG rectangular path */ + int16_t path_data[] = { /*VG rectangular path*/ VLC_OP_MOVE, fill_area->x1, fill_area->y1, VLC_OP_LINE, fill_area->x2 + 1, fill_area->y1, VLC_OP_LINE, fill_area->x2 + 1, fill_area->y2 + 1, @@ -136,19 +136,19 @@ lv_res_t lv_gpu_nxp_vglite_fill(lv_color_t * dest_buf, lv_coord_t dest_width, lv return LV_RES_INV; } - colMix.ch.red = ((uint16_t)col32.ch.red * opa) >> 8; /* Pre-multiply color */ + colMix.ch.red = ((uint16_t)col32.ch.red * opa) >> 8; /*Pre-multiply color*/ colMix.ch.green = ((uint16_t)col32.ch.green * opa) >> 8; colMix.ch.blue = ((uint16_t)col32.ch.blue * opa) >> 8; colMix.ch.alpha = opa; - if(disp && disp->driver->clean_dcache_cb) { /* Clean & invalidate cache */ + if(disp && disp->driver->clean_dcache_cb) { /*Clean & invalidate cache*/ disp->driver->clean_dcache_cb(&disp->driver); } vg_lite_matrix_t matrix; vg_lite_identity(&matrix); - /* Draw rectangle */ + /*Draw rectangle*/ err |= vg_lite_draw(&rt, &path, VG_LITE_FILL_EVEN_ODD, &matrix, VG_LITE_BLEND_SRC_OVER, colMix.full); if(err) { #if LV_GPU_NXP_VG_LITE_LOG_ERRORS @@ -187,15 +187,15 @@ lv_res_t lv_gpu_nxp_vglite_blit(lv_gpu_nxp_vglite_blit_info_t * blit) lv_disp_t * disp = _lv_refr_get_disp_refreshing(); if(blit->opa < LV_OPA_MIN) { - return LV_RES_OK; /* Nothing to BLIT */ + return LV_RES_OK; /*Nothing to BLIT*/ } if(!blit) { - /* Wrong parameter */ + /*Wrong parameter*/ return LV_RES_INV; } - /* Wrap src/dst buffer into VG-Lite buffer */ + /*Wrap src/dst buffer into VG-Lite buffer*/ if(init_vg_buf(&src_vgbuf, blit->src_width, blit->src_height, blit->src_stride, blit->src) != LV_RES_OK) { #if LV_GPU_NXP_VG_LITE_LOG_ERRORS LV_LOG_ERROR("init_vg_buf reported error. BLIT failed."); @@ -210,7 +210,7 @@ lv_res_t lv_gpu_nxp_vglite_blit(lv_gpu_nxp_vglite_blit_info_t * blit) return LV_RES_INV; } - rect[0] = 0; /* Crop */ + rect[0] = 0; /*Crop*/ rect[1] = 0; rect[2] = blit->src_width; rect[3] = blit->src_height; @@ -219,7 +219,7 @@ lv_res_t lv_gpu_nxp_vglite_blit(lv_gpu_nxp_vglite_blit_info_t * blit) vg_lite_identity(&matrix); vg_lite_translate(blit->dst_area.x1, blit->dst_area.y1, &matrix); - if(disp && disp->driver->clean_dcache_cb) { /* Clean & invalidate cache */ + if(disp && disp->driver->clean_dcache_cb) { /*Clean & invalidate cache*/ disp->driver->clean_dcache_cb(&disp->driver); } @@ -264,14 +264,14 @@ lv_res_t lv_gpu_nxp_vglite_blit(lv_gpu_nxp_vglite_blit_info_t * blit) static lv_res_t init_vg_buf(vg_lite_buffer_t * dst, uint32_t width, uint32_t height, uint32_t stride, const lv_color_t * ptr) { - if((((uintptr_t)ptr) % LV_ATTRIBUTE_MEM_ALIGN_SIZE) != 0x0) { /* Test for alignment */ + if((((uintptr_t)ptr) % LV_ATTRIBUTE_MEM_ALIGN_SIZE) != 0x0) { /*Test for alignment*/ #if LV_GPU_NXP_VG_LITE_LOG_ERRORS LV_LOG_ERROR("ptr (0x%X) not aligned to %d.", (size_t) ptr, LV_ATTRIBUTE_MEM_ALIGN_SIZE); #endif return LV_RES_INV; } - if((stride % LV_GPU_NXP_VG_LITE_STRIDE_ALIGN_PX) != 0x0) { /* Test for stride alignment */ + if((stride % LV_GPU_NXP_VG_LITE_STRIDE_ALIGN_PX) != 0x0) { /*Test for stride alignment*/ #if LV_GPU_NXP_VG_LITE_LOG_ERRORS LV_LOG_ERROR("Buffer stride (%d px) not aligned to %d px.", stride, LV_GPU_NXP_VG_LITE_STRIDE_ALIGN_PX); #endif @@ -296,4 +296,4 @@ static lv_res_t init_vg_buf(vg_lite_buffer_t * dst, uint32_t width, uint32_t hei return LV_RES_OK; } -#endif /* LV_USE_GPU_NXP_VG_LITE */ +#endif /*LV_USE_GPU_NXP_VG_LITE*/ diff --git a/src/gpu/lv_gpu_nxp_vglite.h b/src/gpu/lv_gpu_nxp_vglite.h index bdadfd695..e4ac43d2b 100644 --- a/src/gpu/lv_gpu_nxp_vglite.h +++ b/src/gpu/lv_gpu_nxp_vglite.h @@ -43,31 +43,31 @@ extern "C" { * DEFINES *********************/ -/** Stride in px required by VG-Lite HW. Don't change this. */ +/** Stride in px required by VG-Lite HW. Don't change this.*/ #define LV_GPU_NXP_VG_LITE_STRIDE_ALIGN_PX 16 #ifndef LV_GPU_NXP_VG_LITE_FILL_SIZE_LIMIT -/** Minimum area (in pixels) to be filled by VG-Lite with 100% opacity */ +/** Minimum area (in pixels) to be filled by VG-Lite with 100% opacity*/ #define LV_GPU_NXP_VG_LITE_FILL_SIZE_LIMIT 32 #endif #ifndef LV_GPU_NXP_VG_LITE_FILL_OPA_SIZE_LIMIT -/** Minimum area (in pixels) to be filled by VG-Lite with transparency */ +/** Minimum area (in pixels) to be filled by VG-Lite with transparency*/ #define LV_GPU_NXP_VG_LITE_FILL_OPA_SIZE_LIMIT 32 #endif #ifndef LV_GPU_NXP_VG_LITE_BLIT_SIZE_LIMIT -/** Minimum area (in pixels) for image copy with 100% opacity to be handled by VG-Lite */ +/** Minimum area (in pixels) for image copy with 100% opacity to be handled by VG-Lite*/ #define LV_GPU_NXP_VG_LITE_BLIT_SIZE_LIMIT 32 #endif #ifndef LV_GPU_NXP_VG_LITE_BLIT_OPA_SIZE_LIMIT -/** Minimum area (in pixels) for image copy with transparency to be handled by VG-Lite */ +/** Minimum area (in pixels) for image copy with transparency to be handled by VG-Lite*/ #define LV_GPU_NXP_VG_LITE_BLIT_OPA_SIZE_LIMIT 32 #endif #ifndef LV_GPU_NXP_VG_LITE_LOG_ERRORS -/** Enable logging of VG-Lite errors (\see LV_LOG_ERROR) */ +/** Enable logging of VG-Lite errors (\see LV_LOG_ERROR)*/ #define LV_GPU_NXP_VG_LITE_LOG_ERRORS 1 #endif @@ -80,19 +80,19 @@ extern "C" { */ typedef struct { - const lv_color_t * src; /**< Source buffer pointer (must be aligned on 32 bytes) */ - lv_area_t src_area; /**< Area to be copied from source */ - lv_coord_t src_width; /**< Source buffer width */ - lv_coord_t src_height; /**< Source buffer height */ - uint32_t src_stride; /**< Source buffer stride in bytes (must be aligned on 16 px) */ + const lv_color_t * src; /**< Source buffer pointer (must be aligned on 32 bytes)*/ + lv_area_t src_area; /**< Area to be copied from source*/ + lv_coord_t src_width; /**< Source buffer width*/ + lv_coord_t src_height; /**< Source buffer height*/ + uint32_t src_stride; /**< Source buffer stride in bytes (must be aligned on 16 px)*/ - const lv_color_t * dst; /**< Destination buffer pointer (must be aligned on 32 bytes) */ - lv_area_t dst_area; /**< Target area in destination buffer (must be the same as src_area) */ - lv_coord_t dst_width; /**< Destination buffer width */ - lv_coord_t dst_height; /**< Destination buffer height */ - uint32_t dst_stride; /**< Destination buffer stride in bytes (must be aligned on 16 px) */ + const lv_color_t * dst; /**< Destination buffer pointer (must be aligned on 32 bytes)*/ + lv_area_t dst_area; /**< Target area in destination buffer (must be the same as src_area)*/ + lv_coord_t dst_width; /**< Destination buffer width*/ + lv_coord_t dst_height; /**< Destination buffer height*/ + uint32_t dst_stride; /**< Destination buffer stride in bytes (must be aligned on 16 px)*/ - lv_opa_t opa; /**< Opacity - alpha mix (0 = source not copied, 255 = 100% opaque) */ + lv_opa_t opa; /**< Opacity - alpha mix (0 = source not copied, 255 = 100% opaque)*/ } lv_gpu_nxp_vglite_blit_info_t; @@ -127,7 +127,7 @@ lv_res_t lv_gpu_nxp_vglite_fill(lv_color_t * dest_buf, lv_coord_t dest_width, lv lv_res_t lv_gpu_nxp_vglite_blit(lv_gpu_nxp_vglite_blit_info_t * blit); #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif -#endif /* LV_SRC_LV_GPU_LV_GPU_NXP_VGLITE_H_ */ +#endif /*LV_SRC_LV_GPU_LV_GPU_NXP_VGLITE_H_*/ diff --git a/src/gpu/lv_gpu_stm32_dma2d.c b/src/gpu/lv_gpu_stm32_dma2d.c index c4dac92b3..f3cf1808c 100644 --- a/src/gpu/lv_gpu_stm32_dma2d.c +++ b/src/gpu/lv_gpu_stm32_dma2d.c @@ -62,7 +62,7 @@ static void wait_finish(void); */ void lv_gpu_stm32_dma2d_init(void) { - /* Enable DMA2D clock */ + /*Enable DMA2D clock*/ #if defined(STM32F4) || defined(STM32F7) RCC->AHB1ENR |= RCC_AHB1ENR_DMA2DEN; #elif defined(STM32H7) @@ -71,13 +71,13 @@ void lv_gpu_stm32_dma2d_init(void) # warning "LVGL can't enable the clock of DMA2D" #endif - /* Wait for hardware access to complete */ + /*Wait for hardware access to complete*/ __asm volatile("DSB\n"); - /* Delay after setting peripheral clock */ + /*Delay after setting peripheral clock*/ volatile uint32_t temp = RCC->AHB1ENR; - /* set output colour mode */ + /*set output colour mode*/ DMA2D->OPFCCR = LV_DMA2D_COLOR_FORMAT; } @@ -96,12 +96,12 @@ void lv_gpu_stm32_dma2d_fill(lv_color_t * buf, lv_coord_t buf_w, lv_color_t colo DMA2D->CR = 0x30000; DMA2D->OMAR = (uint32_t)buf; - /* as input color mode is same as output we don't need to convert here do we? */ + /*as input color mode is same as output we don't need to convert here do we?*/ DMA2D->OCOLR = color.full; DMA2D->OOR = buf_w - fill_w; DMA2D->NLR = (fill_w << DMA2D_NLR_PL_Pos) | (fill_h << DMA2D_NLR_NL_Pos); - /* start transfer */ + /*start transfer*/ DMA2D->CR |= DMA2D_CR_START_Msk; wait_finish(); @@ -124,12 +124,12 @@ void lv_gpu_stm32_dma2d_fill_mask(lv_color_t * buf, lv_coord_t buf_w, lv_color_t #if 0 invalidate_cache(); - /* Configure the DMA2D Mode, Color Mode and line output offset */ + /*Configure the DMA2D Mode, Color Mode and line output offset*/ hdma2d.Init.Mode = DMA2D_M2M_BLEND; hdma2d.Init.ColorMode = DMA2D_OUTPUT_FORMAT; hdma2d.Init.OutputOffset = buf_w - fill_w; - /* Configure the foreground -> The character */ + /*Configure the foreground -> The character*/ lv_color32_t c32; c32.full = lv_color_to32(color); c32.ch.alpha = opa; @@ -138,13 +138,13 @@ void lv_gpu_stm32_dma2d_fill_mask(lv_color_t * buf, lv_coord_t buf_w, lv_color_t hdma2d.LayerCfg[1].InputColorMode = DMA2D_INPUT_A8; hdma2d.LayerCfg[1].InputOffset = 0; - /* Configure the background -> Display buffer */ + /*Configure the background -> Display buffer*/ hdma2d.LayerCfg[0].AlphaMode = DMA2D_NO_MODIF_ALPHA; hdma2d.LayerCfg[0].InputAlpha = 0x00; hdma2d.LayerCfg[0].InputColorMode = DMA2D_INPUT_FORMAT; hdma2d.LayerCfg[0].InputOffset = buf_w - fill_w; - /* DMA2D Initialization */ + /*DMA2D Initialization*/ HAL_DMA2D_Init(&hdma2d); HAL_DMA2D_ConfigLayer(&hdma2d, 0); HAL_DMA2D_ConfigLayer(&hdma2d, 1); @@ -169,7 +169,7 @@ void lv_gpu_stm32_dma2d_copy(lv_color_t * buf, lv_coord_t buf_w, const lv_color_ invalidate_cache(); DMA2D->CR = 0; - /* copy output colour mode, this register controls both input and output colour format */ + /*copy output colour mode, this register controls both input and output colour format*/ DMA2D->FGPFCCR = LV_DMA2D_COLOR_FORMAT; DMA2D->FGMAR = (uint32_t)map; DMA2D->FGOR = map_w - copy_w; @@ -177,7 +177,7 @@ void lv_gpu_stm32_dma2d_copy(lv_color_t * buf, lv_coord_t buf_w, const lv_color_ DMA2D->OOR = buf_w - copy_w; DMA2D->NLR = (copy_w << DMA2D_NLR_PL_Pos) | (copy_h << DMA2D_NLR_NL_Pos); - /* start transfer */ + /*start transfer*/ DMA2D->CR |= DMA2D_CR_START_Msk; wait_finish(); } @@ -204,9 +204,9 @@ void lv_gpu_stm32_dma2d_blend(lv_color_t * buf, lv_coord_t buf_w, const lv_color DMA2D->BGOR = buf_w - copy_w; DMA2D->FGPFCCR = (uint32_t)LV_DMA2D_COLOR_FORMAT - /* alpha mode 2, replace with foreground * alpha value */ + /*alpha mode 2, replace with foreground * alpha value*/ | (2 << DMA2D_FGPFCCR_AM_Pos) - /* alpha value */ + /*alpha value*/ | (opa << DMA2D_FGPFCCR_ALPHA_Pos); DMA2D->FGMAR = (uint32_t)map; DMA2D->FGOR = map_w - copy_w; @@ -215,7 +215,7 @@ void lv_gpu_stm32_dma2d_blend(lv_color_t * buf, lv_coord_t buf_w, const lv_color DMA2D->OOR = buf_w - copy_w; DMA2D->NLR = (copy_w << DMA2D_NLR_PL_Pos) | (copy_h << DMA2D_NLR_NL_Pos); - /* start transfer */ + /*start transfer*/ DMA2D->CR |= DMA2D_CR_START_Msk; wait_finish(); } diff --git a/src/gpu/lv_gpu_stm32_dma2d.h b/src/gpu/lv_gpu_stm32_dma2d.h index cf61e42f5..82e66646d 100644 --- a/src/gpu/lv_gpu_stm32_dma2d.h +++ b/src/gpu/lv_gpu_stm32_dma2d.h @@ -103,7 +103,7 @@ void lv_gpu_stm32_dma2d_wait_cb(lv_disp_drv_t * drv); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_GPU_STM32_DMA2D_H*/ diff --git a/src/hal/lv_hal.h b/src/hal/lv_hal.h index a5e0a1dd5..cb63f3e73 100644 --- a/src/hal/lv_hal.h +++ b/src/hal/lv_hal.h @@ -34,7 +34,7 @@ extern "C" { **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif diff --git a/src/hal/lv_hal_disp.c b/src/hal/lv_hal_disp.c index 07977dffe..19c1c6b75 100644 --- a/src/hal/lv_hal_disp.c +++ b/src/hal/lv_hal_disp.c @@ -195,7 +195,7 @@ void lv_disp_remove(lv_disp_t * disp) bool was_default = false; if(disp == lv_disp_get_default()) was_default = true; - /*Detach the input devices */ + /*Detach the input devices*/ lv_indev_t * indev; indev = lv_indev_get_next(NULL); while(indev) { diff --git a/src/hal/lv_hal_disp.h b/src/hal/lv_hal_disp.h index 3fdfaf35e..d7d111695 100644 --- a/src/hal/lv_hal_disp.h +++ b/src/hal/lv_hal_disp.h @@ -27,7 +27,7 @@ extern "C" { * DEFINES *********************/ #ifndef LV_INV_BUF_SIZE -#define LV_INV_BUF_SIZE 32 /*Buffer size for invalid areas */ +#define LV_INV_BUF_SIZE 32 /*Buffer size for invalid areas*/ #endif #ifndef LV_ATTRIBUTE_FLUSH_READY @@ -47,8 +47,8 @@ struct _lv_theme_t; * Structure for holding display buffer information. */ typedef struct { - void * buf1; /**< First display buffer. */ - void * buf2; /**< Second display buffer. */ + void * buf1; /**< First display buffer.*/ + void * buf2; /**< Second display buffer.*/ /*Internal, used by the library*/ void * buf_act; @@ -77,15 +77,15 @@ typedef enum { */ typedef struct _lv_disp_drv_t { - lv_coord_t hor_res; /**< Horizontal resolution. */ - lv_coord_t ver_res; /**< Vertical resolution. */ + lv_coord_t hor_res; /**< Horizontal resolution.*/ + lv_coord_t ver_res; /**< Vertical resolution.*/ /** Pointer to a buffer initialized with `lv_disp_draw_buf_init()`. - * LVGL will use this buffer(s) to draw the screens contents */ + * LVGL will use this buffer(s) to draw the screens contents*/ lv_disp_draw_buf_t * draw_buf; - uint32_t sw_rotate : 1; /**< 1: use software rotation (slower) */ - uint32_t antialiasing : 1; /**< 1: anti-aliasing is enabled on this display. */ + uint32_t sw_rotate : 1; /**< 1: use software rotation (slower)*/ + uint32_t antialiasing : 1; /**< 1: anti-aliasing is enabled on this display.*/ uint32_t rotated : 2; /**< 1: turn the display by 90 degree. @warning Does not update coordinates for you!*/ /**Handle if the screen doesn't have a solid (opa == LV_OPA_COVER) background. @@ -98,7 +98,7 @@ typedef struct _lv_disp_drv_t { uint32_t dpi : 10; /** MANDATORY: Write the internal buffer (draw_buf) to the display. 'lv_disp_flush_ready()' has to be - * called when finished */ + * called when finished*/ void (*flush_cb)(struct _lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p); /** OPTIONAL: Extend the invalidated areas to match with the display drivers requirements @@ -107,23 +107,23 @@ typedef struct _lv_disp_drv_t { /** OPTIONAL: Set a pixel in a buffer according to the special requirements of the display * Can be used for color format not supported in LittelvGL. E.g. 2 bit -> 4 gray scales - * @note Much slower then drawing with supported color formats. */ + * @note Much slower then drawing with supported color formats.*/ void (*set_px_cb)(struct _lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y, lv_color_t color, lv_opa_t opa); /** OPTIONAL: Called after every refresh cycle to tell the rendering and flushing time + the - * number of flushed pixels */ + * number of flushed pixels*/ void (*monitor_cb)(struct _lv_disp_drv_t * disp_drv, uint32_t time, uint32_t px); /** OPTIONAL: Called periodically while lvgl waits for operation to be completed. * For example flushing or GPU - * User can execute very simple tasks here or yield the task */ + * User can execute very simple tasks here or yield the task*/ void (*wait_cb)(struct _lv_disp_drv_t * disp_drv); - /** OPTIONAL: Called when lvgl needs any CPU cache that affects rendering to be cleaned */ + /** OPTIONAL: Called when lvgl needs any CPU cache that affects rendering to be cleaned*/ void (*clean_dcache_cb)(struct _lv_disp_drv_t * disp_drv); - /** OPTIONAL: called to wait while the gpu is working */ + /** OPTIONAL: called to wait while the gpu is working*/ void (*gpu_wait_cb)(struct _lv_disp_drv_t * disp_drv); /** OPTIONAL: called when driver parameters are updated */ @@ -138,7 +138,7 @@ typedef struct _lv_disp_drv_t { lv_color_t color_chroma_key; #if LV_USE_USER_DATA - void * user_data; /**< Custom display driver user data */ + void * user_data; /**< Custom display driver user data*/ #endif } lv_disp_drv_t; @@ -158,16 +158,16 @@ typedef struct _lv_disp_t { struct _lv_theme_t * theme; /** Screens of the display*/ - struct _lv_obj_t ** screens; /**< Array of screen objects. */ - struct _lv_obj_t * act_scr; /**< Currently active screen on this display */ - struct _lv_obj_t * prev_scr; /**< Previous screen. Used during screen animations */ + struct _lv_obj_t ** screens; /**< Array of screen objects.*/ + struct _lv_obj_t * act_scr; /**< Currently active screen on this display*/ + struct _lv_obj_t * prev_scr; /**< Previous screen. Used during screen animations*/ struct _lv_obj_t * scr_to_load; /**< The screen prepared to load in lv_scr_load_anim*/ - struct _lv_obj_t * top_layer; /**< @see lv_disp_get_layer_top */ - struct _lv_obj_t * sys_layer; /**< @see lv_disp_get_layer_sys */ + struct _lv_obj_t * top_layer; /**< @see lv_disp_get_layer_top*/ + struct _lv_obj_t * sys_layer; /**< @see lv_disp_get_layer_sys*/ uint32_t screen_cnt; - uint8_t del_prev : 1; /**< 1: Automatically delete the previous screen when the screen load animation is ready */ + uint8_t del_prev : 1; /**< 1: Automatically delete the previous screen when the screen load animation is ready*/ - lv_opa_t bg_opa; /**driver->type == LV_INDEV_TYPE_POINTER) { data->point.x = indev->proc.types.pointer.act_point.x; data->point.y = indev->proc.types.pointer.act_point.y; @@ -145,7 +145,7 @@ bool _lv_indev_read(lv_indev_t * indev, lv_indev_data_t * data) else if(indev->driver->type == LV_INDEV_TYPE_KEYPAD) { data->key = indev->proc.types.keypad.last_key; } - /*For compatibility assume that used button was enter (encoder push) */ + /*For compatibility assume that used button was enter (encoder push)*/ else if(indev->driver->type == LV_INDEV_TYPE_ENCODER) { data->key = LV_KEY_ENTER; } diff --git a/src/hal/lv_hal_indev.h b/src/hal/lv_hal_indev.h index 5fc355900..131905505 100644 --- a/src/hal/lv_hal_indev.h +++ b/src/hal/lv_hal_indev.h @@ -26,25 +26,25 @@ extern "C" { * DEFINES *********************/ -/* Drag threshold in pixels */ +/*Drag threshold in pixels*/ #define LV_INDEV_DEF_SCROLL_LIMIT 10 -/* Drag throw slow-down in [%]. Greater value -> faster slow-down */ +/*Drag throw slow-down in [%]. Greater value -> faster slow-down*/ #define LV_INDEV_DEF_SCROLL_THROW 10 -/* Long press time in milliseconds. - * Time to send `LV_EVENT_LONG_PRESSSED`) */ +/*Long press time in milliseconds. + *Time to send `LV_EVENT_LONG_PRESSSED`)*/ #define LV_INDEV_DEF_LONG_PRESS_TIME 400 -/* Repeated trigger period in long press [ms] - * Time between `LV_EVENT_LONG_PRESSED_REPEAT */ +/*Repeated trigger period in long press [ms] + *Time between `LV_EVENT_LONG_PRESSED_REPEAT*/ #define LV_INDEV_DEF_LONG_PRESS_REP_TIME 100 -/* Gesture threshold in pixels */ +/*Gesture threshold in pixels*/ #define LV_INDEV_DEF_GESTURE_LIMIT 50 -/* Gesture min velocity at release before swipe (pixels)*/ +/*Gesture min velocity at release before swipe (pixels)*/ #define LV_INDEV_DEF_GESTURE_MIN_VELOCITY 3 @@ -81,14 +81,14 @@ enum { typedef uint8_t lv_indev_scroll_dir_t; enum { - LV_GESTURE_DIR_TOP, /**< Gesture dir up. */ - LV_GESTURE_DIR_BOTTOM, /**< Gesture dir down. */ - LV_GESTURE_DIR_LEFT, /**< Gesture dir left. */ - LV_GESTURE_DIR_RIGHT, /**< Gesture dir right. */ + LV_GESTURE_DIR_TOP, /**< Gesture dir up.*/ + LV_GESTURE_DIR_BOTTOM, /**< Gesture dir down.*/ + LV_GESTURE_DIR_LEFT, /**< Gesture dir left.*/ + LV_GESTURE_DIR_RIGHT, /**< Gesture dir right.*/ }; typedef uint8_t lv_gesture_dir_t; -/** Data structure passed to an input driver to fill */ +/** Data structure passed to an input driver to fill*/ typedef struct { lv_point_t point; /**< For LV_INDEV_TYPE_POINTER the currently pressed point*/ uint32_t key; /**< For LV_INDEV_TYPE_KEYPAD the currently pressed key*/ @@ -106,7 +106,7 @@ typedef struct _lv_indev_drv_t { /**< Function pointer to read input device data. * Return 'true' if there is more data to be read (buffered). - * Most drivers can safely return 'false' */ + * Most drivers can safely return 'false'*/ bool (*read_cb)(struct _lv_indev_drv_t * indev_drv, lv_indev_data_t * data); /** Called when an action happened on the input device. @@ -126,19 +126,19 @@ typedef struct _lv_indev_drv_t { /**< Number of pixels to slide before actually drag the object*/ uint8_t scroll_limit; - /**< Drag throw slow-down in [%]. Greater value means faster slow-down */ + /**< Drag throw slow-down in [%]. Greater value means faster slow-down*/ uint8_t scroll_throw; - /**< At least this difference should between two points to evaluate as gesture */ + /**< At least this difference should between two points to evaluate as gesture*/ uint8_t gesture_min_velocity; - /**< At least this difference should be to send a gesture */ + /**< At least this difference should be to send a gesture*/ uint8_t gesture_limit; /**< Long press time in milliseconds*/ uint16_t long_press_time; - /**< Repeated trigger period in long press [ms] */ + /**< Repeated trigger period in long press [ms]*/ uint16_t long_press_rep_time; } lv_indev_drv_t; @@ -146,7 +146,7 @@ typedef struct _lv_indev_drv_t { * Internally used by the library, you should not need to touch it. */ typedef struct _lv_indev_proc_t { - lv_indev_state_t state; /**< Current state of the input device. */ + lv_indev_state_t state; /**< Current state of the input device.*/ /*Flags*/ uint8_t long_pr_sent : 1; uint8_t reset_query : 1; @@ -156,9 +156,9 @@ typedef struct _lv_indev_proc_t { union { struct { /*Pointer and button data*/ - lv_point_t act_point; /**< Current point of input device. */ - lv_point_t last_point; /**< Last point of input device. */ - lv_point_t vect; /**< Difference between `act_point` and `last_point`. */ + lv_point_t act_point; /**< Current point of input device.*/ + lv_point_t last_point; /**< Last point of input device.*/ + lv_point_t vect; /**< Difference between `act_point` and `last_point`.*/ lv_point_t scroll_sum; /*Count the dragged pixels to check LV_INDEV_DEF_SCROLL_LIMIT*/ lv_point_t scroll_throw_vect; lv_point_t scroll_throw_vect_ori; @@ -243,7 +243,7 @@ bool _lv_indev_read(lv_indev_t * indev, lv_indev_data_t * data); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif diff --git a/src/hal/lv_hal_tick.c b/src/hal/lv_hal_tick.c index 2ceb7adf6..1430b6fb3 100644 --- a/src/hal/lv_hal_tick.c +++ b/src/hal/lv_hal_tick.c @@ -57,16 +57,16 @@ uint32_t lv_tick_get(void) { #if LV_TICK_CUSTOM == 0 - /* If `lv_tick_inc` is called from an interrupt while `sys_time` is read - * the result might be corrupted. - * This loop detects if `lv_tick_inc` was called while reading `sys_time`. - * If `tick_irq_flag` was cleared in `lv_tick_inc` try to read again - * until `tick_irq_flag` remains `1`. */ + /*If `lv_tick_inc` is called from an interrupt while `sys_time` is read + *the result might be corrupted. + *This loop detects if `lv_tick_inc` was called while reading `sys_time`. + *If `tick_irq_flag` was cleared in `lv_tick_inc` try to read again + *until `tick_irq_flag` remains `1`.*/ uint32_t result; do { tick_irq_flag = 1; result = sys_time; - } while(!tick_irq_flag); /*Continue until see a non interrupted cycle */ + } while(!tick_irq_flag); /*Continue until see a non interrupted cycle*/ return result; #else diff --git a/src/hal/lv_hal_tick.h b/src/hal/lv_hal_tick.h index a6068660c..f6986bd66 100644 --- a/src/hal/lv_hal_tick.h +++ b/src/hal/lv_hal_tick.h @@ -61,7 +61,7 @@ uint32_t lv_tick_elaps(uint32_t prev_tick); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_HAL_TICK_H*/ diff --git a/src/lv_api_map.h b/src/lv_api_map.h index d19650e90..2f3c811e8 100644 --- a/src/lv_api_map.h +++ b/src/lv_api_map.h @@ -41,7 +41,7 @@ static inline LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_task_handler(void) **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_API_MAP_H*/ diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h index 21813f742..3aa0579e6 100644 --- a/src/lv_conf_internal.h +++ b/src/lv_conf_internal.h @@ -6,18 +6,18 @@ #ifndef LV_CONF_INTERNAL_H #define LV_CONF_INTERNAL_H -/* clang-format off */ +/*clang-format off */ #include -/* Handle special Kconfig options */ +/*Handle special Kconfig options */ #include "lv_conf_kconfig.h" #ifdef CONFIG_LV_CONF_SKIP #define LV_CONF_SKIP #endif -/* If "lv_conf.h" is available from here try to use it later.*/ +/*If "lv_conf.h" is available from here try to use it later.*/ #if defined __has_include # if __has_include("lv_conf.h") # ifndef LV_CONF_INCLUDE_SIMPLE @@ -41,7 +41,7 @@ # endif #endif -/* clang-format off */ +/*clang-format off */ #include @@ -50,7 +50,7 @@ COLOR SETTINGS *====================*/ -/* Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888) */ +/*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888) */ #ifndef LV_COLOR_DEPTH # ifdef CONFIG_LV_COLOR_DEPTH # define LV_COLOR_DEPTH CONFIG_LV_COLOR_DEPTH @@ -59,7 +59,7 @@ # endif #endif -/* Swap the 2 bytes of RGB565 color. Useful if the display has a 8 bit interface (e.g. SPI)*/ +/*Swap the 2 bytes of RGB565 color. Useful if the display has a 8 bit interface (e.g. SPI)*/ #ifndef LV_COLOR_16_SWAP # ifdef CONFIG_LV_COLOR_16_SWAP # define LV_COLOR_16_SWAP CONFIG_LV_COLOR_16_SWAP @@ -92,7 +92,7 @@ MEMORY SETTINGS *=========================*/ -/* 1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()` */ +/*1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()` */ #ifndef LV_MEM_CUSTOM # ifdef CONFIG_LV_MEM_CUSTOM # define LV_MEM_CUSTOM CONFIG_LV_MEM_CUSTOM @@ -101,16 +101,16 @@ # endif #endif #if LV_MEM_CUSTOM == 0 -/* Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/ +/*Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/ #ifndef LV_MEM_SIZE # ifdef CONFIG_LV_MEM_SIZE # define LV_MEM_SIZE CONFIG_LV_MEM_SIZE # else -# define LV_MEM_SIZE (32U * 1024U) /* [bytes] */ +# define LV_MEM_SIZE (32U * 1024U) /*[bytes] */ # endif #endif -/* Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too. */ +/*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too. */ #ifndef LV_MEM_ADR # ifdef CONFIG_LV_MEM_ADR # define LV_MEM_ADR CONFIG_LV_MEM_ADR @@ -149,7 +149,7 @@ #endif #endif /*LV_MEM_CUSTOM*/ -/* Use the standard `memcpy` and `memset` instead of LVGL's own functions. (Might or might not be faster). */ +/*Use the standard `memcpy` and `memset` instead of LVGL's own functions. (Might or might not be faster). */ #ifndef LV_MEMCPY_MEMSET_STD # ifdef CONFIG_LV_MEMCPY_MEMSET_STD # define LV_MEMCPY_MEMSET_STD CONFIG_LV_MEMCPY_MEMSET_STD @@ -162,7 +162,7 @@ HAL SETTINGS *====================*/ -/* Default display refresh period. LVG will redraw changed ares with this period time */ +/*Default display refresh period. LVG will redraw changed ares with this period time */ #ifndef LV_DISP_DEF_REFR_PERIOD # ifdef CONFIG_LV_DISP_DEF_REFR_PERIOD # define LV_DISP_DEF_REFR_PERIOD CONFIG_LV_DISP_DEF_REFR_PERIOD @@ -171,7 +171,7 @@ # endif #endif -/* Input device read period in milliseconds */ +/*Input device read period in milliseconds */ #ifndef LV_INDEV_DEF_READ_PERIOD # ifdef CONFIG_LV_INDEV_DEF_READ_PERIOD # define LV_INDEV_DEF_READ_PERIOD CONFIG_LV_INDEV_DEF_READ_PERIOD @@ -260,7 +260,7 @@ # endif #endif -/* Maximum buffer size to allocate for rotation. Only used if software rotation is enabled in the display driver. */ +/*Maximum buffer size to allocate for rotation. Only used if software rotation is enabled in the display driver. */ #ifndef LV_DISP_ROT_MAX_BUF # ifdef CONFIG_LV_DISP_ROT_MAX_BUF # define LV_DISP_ROT_MAX_BUF CONFIG_LV_DISP_ROT_MAX_BUF @@ -292,7 +292,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ #endif #endif -/* Use NXP's PXP GPU iMX RTxxx platforms */ +/*Use NXP's PXP GPU iMX RTxxx platforms */ #ifndef LV_USE_GPU_NXP_PXP # ifdef CONFIG_LV_USE_GPU_NXP_PXP # define LV_USE_GPU_NXP_PXP CONFIG_LV_USE_GPU_NXP_PXP @@ -305,7 +305,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ * and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol FSL_RTOS_FREE_RTOS * has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected. *0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init() - * */ + */ #ifndef LV_USE_GPU_NXP_PXP_AUTO_INIT # ifdef CONFIG_LV_USE_GPU_NXP_PXP_AUTO_INIT # define LV_USE_GPU_NXP_PXP_AUTO_INIT CONFIG_LV_USE_GPU_NXP_PXP_AUTO_INIT @@ -315,7 +315,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ #endif #endif -/* Use NXP's VG-Lite GPU iMX RTxxx platforms */ +/*Use NXP's VG-Lite GPU iMX RTxxx platforms */ #ifndef LV_USE_GPU_NXP_VG_LITE # ifdef CONFIG_LV_USE_GPU_NXP_VG_LITE # define LV_USE_GPU_NXP_VG_LITE CONFIG_LV_USE_GPU_NXP_VG_LITE @@ -578,13 +578,13 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ # define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/ # endif #endif -#endif /* LV_ENABLE_GC */ +#endif /*LV_ENABLE_GC */ /*===================== * COMPILER SETTINGS *====================*/ -/* For big endian systems set to 1 */ +/*For big endian systems set to 1 */ #ifndef LV_BIG_ENDIAN_SYSTEM # ifdef CONFIG_LV_BIG_ENDIAN_SYSTEM # define LV_BIG_ENDIAN_SYSTEM CONFIG_LV_BIG_ENDIAN_SYSTEM @@ -593,7 +593,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ # endif #endif -/* Define a custom attribute to `lv_tick_inc` function */ +/*Define a custom attribute to `lv_tick_inc` function */ #ifndef LV_ATTRIBUTE_TICK_INC # ifdef CONFIG_LV_ATTRIBUTE_TICK_INC # define LV_ATTRIBUTE_TICK_INC CONFIG_LV_ATTRIBUTE_TICK_INC @@ -602,7 +602,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ # endif #endif -/* Define a custom attribute to `lv_timer_handler` function */ +/*Define a custom attribute to `lv_timer_handler` function */ #ifndef LV_ATTRIBUTE_TIMER_HANDLER # ifdef CONFIG_LV_ATTRIBUTE_TIMER_HANDLER # define LV_ATTRIBUTE_TIMER_HANDLER CONFIG_LV_ATTRIBUTE_TIMER_HANDLER @@ -611,7 +611,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ # endif #endif -/* Define a custom attribute to `lv_disp_flush_ready` function */ +/*Define a custom attribute to `lv_disp_flush_ready` function */ #ifndef LV_ATTRIBUTE_FLUSH_READY # ifdef CONFIG_LV_ATTRIBUTE_FLUSH_READY # define LV_ATTRIBUTE_FLUSH_READY CONFIG_LV_ATTRIBUTE_FLUSH_READY @@ -620,7 +620,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ # endif #endif -/* Required alignment size for buffers */ +/*Required alignment size for buffers */ #ifndef LV_ATTRIBUTE_MEM_ALIGN_SIZE # ifdef CONFIG_LV_ATTRIBUTE_MEM_ALIGN_SIZE # define LV_ATTRIBUTE_MEM_ALIGN_SIZE CONFIG_LV_ATTRIBUTE_MEM_ALIGN_SIZE @@ -639,7 +639,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ # endif #endif -/* Attribute to mark large constant arrays for example font's bitmaps */ +/*Attribute to mark large constant arrays for example font's bitmaps */ #ifndef LV_ATTRIBUTE_LARGE_CONST # ifdef CONFIG_LV_ATTRIBUTE_LARGE_CONST # define LV_ATTRIBUTE_LARGE_CONST CONFIG_LV_ATTRIBUTE_LARGE_CONST @@ -648,7 +648,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ # endif #endif -/* Complier prefix for a big array declaration in RAM*/ +/*Complier prefix for a big array declaration in RAM*/ #ifndef LV_ATTRIBUTE_LARGE_RAM_ARRAY # ifdef CONFIG_LV_ATTRIBUTE_LARGE_RAM_ARRAY # define LV_ATTRIBUTE_LARGE_RAM_ARRAY CONFIG_LV_ATTRIBUTE_LARGE_RAM_ARRAY @@ -657,7 +657,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ # endif #endif -/* Place performance critical functions into a faster memory (e.g RAM) */ +/*Place performance critical functions into a faster memory (e.g RAM) */ #ifndef LV_ATTRIBUTE_FAST_MEM # ifdef CONFIG_LV_ATTRIBUTE_FAST_MEM # define LV_ATTRIBUTE_FAST_MEM CONFIG_LV_ATTRIBUTE_FAST_MEM @@ -666,7 +666,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ # endif #endif -/* Prefix variables that are used in GPU accelerated operations, often these need to be placed in RAM sections that are DMA accessible */ +/*Prefix variables that are used in GPU accelerated operations, often these need to be placed in RAM sections that are DMA accessible */ #ifndef LV_ATTRIBUTE_DMA # ifdef CONFIG_LV_ATTRIBUTE_DMA # define LV_ATTRIBUTE_DMA CONFIG_LV_ATTRIBUTE_DMA @@ -848,7 +848,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ # endif #endif -/* Demonstrate special features */ +/*Demonstrate special features */ #ifndef LV_FONT_MONTSERRAT_12_SUBPX # ifdef CONFIG_LV_FONT_MONTSERRAT_12_SUBPX # define LV_FONT_MONTSERRAT_12_SUBPX CONFIG_LV_FONT_MONTSERRAT_12_SUBPX @@ -926,7 +926,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ # endif #endif -/* Enables/disables support for compressed fonts. */ +/*Enables/disables support for compressed fonts. */ #ifndef LV_USE_FONT_COMPRESSED # ifdef CONFIG_LV_USE_FONT_COMPRESSED # define LV_USE_FONT_COMPRESSED CONFIG_LV_USE_FONT_COMPRESSED @@ -935,7 +935,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ # endif #endif -/* Enable subpixel rendering */ +/*Enable subpixel rendering */ #ifndef LV_USE_FONT_SUBPX # ifdef CONFIG_LV_USE_FONT_SUBPX # define LV_USE_FONT_SUBPX CONFIG_LV_USE_FONT_SUBPX @@ -944,7 +944,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ # endif #endif #if LV_USE_FONT_SUBPX -/* Set the pixel order of the display. Physical order of RGB channels. Doesn't matter with "normal" fonts.*/ +/*Set the pixel order of the display. Physical order of RGB channels. Doesn't matter with "normal" fonts.*/ #ifndef LV_FONT_SUBPX_BGR # ifdef CONFIG_LV_FONT_SUBPX_BGR # define LV_FONT_SUBPX_BGR CONFIG_LV_FONT_SUBPX_BGR @@ -962,7 +962,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ * Your IDE or editor should have the same character encoding * - LV_TXT_ENC_UTF8 * - LV_TXT_ENC_ASCII - * */ + */ #ifndef LV_TXT_ENC # ifdef CONFIG_LV_TXT_ENC # define LV_TXT_ENC CONFIG_LV_TXT_ENC @@ -1010,7 +1010,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ # endif #endif -/* The control character to use for signalling text recoloring. */ +/*The control character to use for signalling text recoloring. */ #ifndef LV_TXT_COLOR_CMD # ifdef CONFIG_LV_TXT_COLOR_CMD # define LV_TXT_COLOR_CMD CONFIG_LV_TXT_COLOR_CMD @@ -1057,7 +1057,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ * WIDGET USAGE *================*/ -/* Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html */ +/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html */ #ifndef LV_USE_ARC # ifdef CONFIG_LV_USE_ARC @@ -1383,7 +1383,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ /*----------- * Themes *----------*/ -/* A simple, impressive and very complete theme */ +/*A simple, impressive and very complete theme */ #ifndef LV_USE_THEME_DEFAULT # ifdef CONFIG_LV_USE_THEME_DEFAULT # define LV_USE_THEME_DEFAULT CONFIG_LV_USE_THEME_DEFAULT @@ -1393,7 +1393,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ #endif #if LV_USE_THEME_DEFAULT -/* 1: Light mode; 0: Dark mode*/ +/*1: Light mode; 0: Dark mode*/ #ifndef LV_THEME_DEFAULT_PALETTE_LIGHT # ifdef CONFIG_LV_THEME_DEFAULT_PALETTE_LIGHT # define LV_THEME_DEFAULT_PALETTE_LIGHT CONFIG_LV_THEME_DEFAULT_PALETTE_LIGHT @@ -1402,7 +1402,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ # endif #endif -/* 1: Enable grow on press*/ +/*1: Enable grow on press*/ #ifndef LV_THEME_DEFAULT_GROW # ifdef CONFIG_LV_THEME_DEFAULT_GROW # define LV_THEME_DEFAULT_GROW CONFIG_LV_THEME_DEFAULT_GROW @@ -1462,7 +1462,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ typedef void * lv_obj_user_data_t; # endif -# if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) /* Disable warnings for Visual Studio*/ +# if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) /*Disable warnings for Visual Studio*/ # define _CRT_SECURE_NO_WARNINGS # endif diff --git a/src/lv_conf_kconfig.h b/src/lv_conf_kconfig.h index 6225ed02a..439caf540 100644 --- a/src/lv_conf_kconfig.h +++ b/src/lv_conf_kconfig.h @@ -83,7 +83,8 @@ extern "C" { * FONT SELECTION *******************/ -/* NOTE: In Kconfig instead of `LV_THEME_DEFAULT_FONT_SMALL` +/** + * NOTE: In Kconfig instead of `LV_THEME_DEFAULT_FONT_SMALL` * `CONFIG_LV_THEME_DEFAULT_FONT_SMALL_` is defined * hence the large selection with if-s */ @@ -414,7 +415,7 @@ extern "C" { #endif #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_CONF_KCONFIG_H*/ diff --git a/src/lvgl.h b/src/lvgl.h index 343456b1b..a7db27c36 100644 --- a/src/lvgl.h +++ b/src/lvgl.h @@ -33,7 +33,7 @@ extern "C" { **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LVGL_SRC_H*/ diff --git a/src/misc/lv_anim.c b/src/misc/lv_anim.c index 9157ca9f7..df2f19c46 100644 --- a/src/misc/lv_anim.c +++ b/src/misc/lv_anim.c @@ -93,7 +93,7 @@ void lv_anim_init(lv_anim_t * a) void lv_anim_start(lv_anim_t * a) { TRACE_ANIM("begin"); - /* Do not let two animations for the same 'var' with the same 'fp'*/ + /*Do not let two animations for the same 'var' with the same 'fp'*/ if(a->exec_cb != NULL) lv_anim_del(a->var, a->exec_cb); /*fp == NULL would delete all animations of var*/ @@ -123,8 +123,8 @@ void lv_anim_start(lv_anim_t * a) if(new_anim->exec_cb && new_anim->var) new_anim->exec_cb(new_anim->var, new_anim->start_value); } - /* Creating an animation changed the linked list. - * It's important if it happens in a ready callback. (see `anim_timer`)*/ + /*Creating an animation changed the linked list. + *It's important if it happens in a ready callback. (see `anim_timer`)*/ anim_mark_list_change(); TRACE_ANIM("finished"); @@ -265,8 +265,8 @@ int32_t lv_anim_path_linear(const lv_anim_path_t * path, const lv_anim_t * a) /*Calculate the current step*/ int32_t step = lv_map(a->act_time, 0, a->time, 0, LV_ANIM_RESOLUTION); - /* Get the new value which will be proportional to `step` - * and the `start` and `end` values*/ + /*Get the new value which will be proportional to `step` + *and the `start` and `end` values*/ int32_t new_value; new_value = step * (a->end_value - a->start_value); new_value = new_value >> LV_ANIM_RES_SHIFT; @@ -495,8 +495,8 @@ static void anim_timer(lv_timer_t * param) } } - /* If the linked list changed due to anim. delete then it's not safe to continue - * the reading of the list from here -> start from the head*/ + /*If the linked list changed due to anim. delete then it's not safe to continue + *the reading of the list from here -> start from the head*/ if(anim_list_changed) a = _lv_ll_get_head(&LV_GC_ROOT(_lv_anim_ll)); else @@ -520,7 +520,7 @@ static void anim_ready_handler(lv_anim_t * a) /*Delete the animation if * - no repeat left and no play back (simple one shot animation) - * - no repeat, play back is enabled and play back is ready */ + * - no repeat, play back is enabled and play back is ready*/ if(a->repeat_cnt == 0 && ((a->playback_time == 0) || (a->playback_time && a->playback_now == 1))) { /*Create copy from the animation and delete the animation from the list. @@ -529,10 +529,10 @@ static void anim_ready_handler(lv_anim_t * a) lv_memcpy(&a_tmp, a, sizeof(lv_anim_t)); _lv_ll_remove(&LV_GC_ROOT(_lv_anim_ll), a); lv_mem_free(a); - /*Flag that the list has changed */ + /*Flag that the list has changed*/ anim_mark_list_change(); - /* Call the callback function at the end*/ + /*Call the callback function at the end*/ if(a_tmp.ready_cb != NULL) a_tmp.ready_cb(&a_tmp); } /*If the animation is not deleted then restart it*/ diff --git a/src/misc/lv_anim.h b/src/misc/lv_anim.h index d3a6a93da..6db2b5884 100644 --- a/src/misc/lv_anim.h +++ b/src/misc/lv_anim.h @@ -78,7 +78,7 @@ typedef struct _lv_anim_t { #endif lv_anim_path_t path; /**< Describe the path (curve) of animations*/ int32_t start_value; /**< Start value*/ - int32_t current_value; /**< Current value */ + int32_t current_value; /**< Current value*/ int32_t end_value; /**< End value*/ int32_t time; /**< Animation time in ms*/ int32_t act_time; /**< Current time in animation. Set to negative to make delay.*/ @@ -86,7 +86,7 @@ typedef struct _lv_anim_t { uint32_t playback_time; /**< Duration of playback animation*/ uint32_t repeat_delay; /**< Wait before repeat*/ uint16_t repeat_cnt; /**< Repeat count for the animation*/ - uint8_t early_apply : 1; /**< 1: Apply start value immediately even is there is `delay` */ + uint8_t early_apply : 1; /**< 1: Apply start value immediately even is there is `delay`*/ /*Animation system use these - user shouldn't set*/ uint8_t playback_now : 1; /**< Play back is in progress*/ @@ -436,7 +436,7 @@ extern const lv_anim_path_t lv_anim_path_def; **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_ANIM_H*/ diff --git a/src/misc/lv_area.c b/src/misc/lv_area.c index fd07cd6d3..609bc9f17 100644 --- a/src/misc/lv_area.c +++ b/src/misc/lv_area.c @@ -112,7 +112,7 @@ uint32_t lv_area_get_size(const lv_area_t * area_p) */ bool _lv_area_intersect(lv_area_t * res_p, const lv_area_t * a1_p, const lv_area_t * a2_p) { - /* Get the smaller area from 'a1_p' and 'a2_p' */ + /*Get the smaller area from 'a1_p' and 'a2_p'*/ res_p->x1 = LV_MAX(a1_p->x1, a2_p->x1); res_p->y1 = LV_MAX(a1_p->y1, a2_p->y1); res_p->x2 = LV_MIN(a1_p->x2, a2_p->x2); @@ -391,11 +391,11 @@ static bool lv_point_within_circle(const lv_area_t * area, const lv_point_t * p) { lv_coord_t r = (area->x2 - area->x1) / 2; - /* Circle center */ + /*Circle center*/ lv_coord_t cx = area->x1 + r; lv_coord_t cy = area->y1 + r; - /*Simplify the code by moving everything to (0, 0) */ + /*Simplify the code by moving everything to (0, 0)*/ lv_coord_t px = p->x - cx; lv_coord_t py = p->y - cy; diff --git a/src/misc/lv_area.h b/src/misc/lv_area.h index 7c2f5aba7..0f9564f63 100644 --- a/src/misc/lv_area.h +++ b/src/misc/lv_area.h @@ -30,7 +30,7 @@ typedef int32_t lv_coord_t; typedef int16_t lv_coord_t; #endif -/*To allow some special values in the end reduce the max value */ +/*To allow some special values in the end reduce the max value*/ #define LV_COORD_MAX ((lv_coord_t)((uint32_t)((uint32_t)1 << (8 * sizeof(lv_coord_t) - 1)) - _LV_COORD_MAX_REDUCE)) #define LV_COORD_MIN (-LV_COORD_MAX) @@ -49,7 +49,7 @@ typedef struct { lv_coord_t y; } lv_point_t; -/** Represents an area of the screen. */ +/** Represents an area of the screen.*/ typedef struct { lv_coord_t x1; lv_coord_t y1; @@ -57,7 +57,7 @@ typedef struct { lv_coord_t y2; } lv_area_t; -/** Alignments */ +/** Alignments*/ enum { LV_ALIGN_CENTER = 0, LV_ALIGN_IN_TOP_LEFT, @@ -252,7 +252,7 @@ void _lv_area_align(const lv_area_t * base, const lv_area_t * to_align, lv_align #define LV_SIZE_LAYOUT LV_COORD_SET_SPEC(1002) /*The size is managed by the layout therefore `lv_obj_set_width/height/size()` can't change is*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif diff --git a/src/misc/lv_assert.h b/src/misc/lv_assert.h index 6658851f1..0132ac4d5 100644 --- a/src/misc/lv_assert.h +++ b/src/misc/lv_assert.h @@ -72,7 +72,7 @@ extern "C" { #endif #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_ASSERT_H*/ diff --git a/src/misc/lv_async.c b/src/misc/lv_async.c index 056767f71..d2324406a 100644 --- a/src/misc/lv_async.c +++ b/src/misc/lv_async.c @@ -42,14 +42,14 @@ static void lv_async_timer_cb(lv_timer_t * timer); lv_res_t lv_async_call(lv_async_cb_t async_xcb, void * user_data) { - /*Allocate an info structure */ + /*Allocate an info structure*/ lv_async_info_t * info = lv_mem_alloc(sizeof(lv_async_info_t)); if(info == NULL) return LV_RES_INV; - /* Create a new timer */ - /* Use highest priority so that it will run before a refresh */ + /*Create a new timer*/ + /*Use highest priority so that it will run before a refresh*/ lv_timer_t * timer = lv_timer_create(lv_async_timer_cb, 0, info); if(timer == NULL) { diff --git a/src/misc/lv_async.h b/src/misc/lv_async.h index 9dab96a52..2a687cde1 100644 --- a/src/misc/lv_async.h +++ b/src/misc/lv_async.h @@ -49,7 +49,7 @@ lv_res_t lv_async_call(lv_async_cb_t async_xcb, void * user_data); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_ASYNC_H*/ diff --git a/src/misc/lv_bidi.c b/src/misc/lv_bidi.c index 431e25898..4a6f8fba1 100644 --- a/src/misc/lv_bidi.c +++ b/src/misc/lv_bidi.c @@ -117,7 +117,7 @@ lv_bidi_dir_t _lv_bidi_detect_base_dir(const char * txt) if(dir == LV_BIDI_DIR_RTL || dir == LV_BIDI_DIR_LTR) return dir; } - /*If there were no strong char earlier return with the default base dir */ + /*If there were no strong char earlier return with the default base dir*/ if(LV_BIDI_BASE_DIR_DEF == LV_BIDI_DIR_AUTO) return LV_BIDI_DIR_LTR; else return LV_BIDI_BASE_DIR_DEF; } @@ -369,7 +369,7 @@ static bool lv_bidi_letter_is_rtl(uint32_t letter) if(letter >= 0x5d0 && letter <= 0x5ea) return true; if(letter == 0x202E) return true; /*Unicode of LV_BIDI_RLO*/ - /* Check for Persian and Arabic characters [https://en.wikipedia.org/wiki/Arabic_script_in_Unicode]*/ + /*Check for Persian and Arabic characters [https://en.wikipedia.org/wiki/Arabic_script_in_Unicode]*/ if(letter >= 0x600 && letter <= 0x6FF) return true; if(letter >= 0xFB50 && letter <= 0xFDFF) return true; if(letter >= 0xFE70 && letter <= 0xFEFF) return true; @@ -458,12 +458,12 @@ static lv_bidi_dir_t get_next_run(const char * txt, lv_bidi_dir_t base_dir, uint /*New dir found?*/ if((next_dir == LV_BIDI_DIR_RTL || next_dir == LV_BIDI_DIR_LTR) && next_dir != run_dir) { - /*Include neutrals if `run_dir == base_dir` */ + /*Include neutrals if `run_dir == base_dir`*/ if(run_dir == base_dir) { *len = i_prev; *pos_conv_len = pos_conv_i_prev; } - /*Exclude neutrals if `run_dir != base_dir` */ + /*Exclude neutrals if `run_dir != base_dir`*/ else { *len = i_last_strong; *pos_conv_len = pos_conv_i_last_strong; @@ -483,12 +483,12 @@ static lv_bidi_dir_t get_next_run(const char * txt, lv_bidi_dir_t base_dir, uint /*Handle end of of string. Apply `base_dir` on trailing neutrals*/ - /*Include neutrals if `run_dir == base_dir` */ + /*Include neutrals if `run_dir == base_dir`*/ if(run_dir == base_dir) { *len = i_prev; *pos_conv_len = pos_conv_i_prev; } - /*Exclude neutrals if `run_dir != base_dir` */ + /*Exclude neutrals if `run_dir != base_dir`*/ else { *len = i_last_strong; *pos_conv_len = pos_conv_i_last_strong; @@ -521,7 +521,7 @@ static void rtl_reverse(char * dest, const char * src, uint32_t len, uint16_t * /*No need to call `char_change_to_pair` because there not such chars here*/ - /*Finish on non-weak char */ + /*Finish on non-weak char*/ /*but treat number and currency related chars as weak*/ if(lv_bidi_letter_is_weak(letter) == false && letter != '.' && letter != ',' && letter != '$' && letter != '%') { _lv_txt_encoded_next(src, &i); /*Rewind one letter*/ @@ -589,8 +589,8 @@ static lv_bidi_dir_t bracket_process(const char * txt, uint32_t next_pos, uint32 /*Is the letter an opening bracket?*/ for(i = 0; bracket_left[i] != '\0'; i++) { if(bracket_left[i] == letter) { - /* If so find it's matching closing bracket. - * If a char with base dir. direction is found then the brackets will have `base_dir` direction*/ + /*If so find it's matching closing bracket. + *If a char with base dir. direction is found then the brackets will have `base_dir` direction*/ uint32_t txt_i = next_pos; while(txt_i < len) { uint32_t letter_next = _lv_txt_encoded_next(txt, &txt_i); diff --git a/src/misc/lv_bidi.h b/src/misc/lv_bidi.h index 8b2f765db..826f1c0d8 100644 --- a/src/misc/lv_bidi.h +++ b/src/misc/lv_bidi.h @@ -21,8 +21,8 @@ extern "C" { /********************* * DEFINES *********************/ -/* Special non printable strong characters. - * They can be inserted to texts to affect the run's direction*/ +/*Special non printable strong characters. + *They can be inserted to texts to affect the run's direction*/ #define LV_BIDI_LRO "\xE2\x80\xAD" /*U+202D*/ #define LV_BIDI_RLO "\xE2\x80\xAE" /*U+202E*/ @@ -113,7 +113,7 @@ void _lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t le #endif /*LV_USE_BIDI*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_BIDI_H*/ diff --git a/src/misc/lv_color.c b/src/misc/lv_color.c index 4c599693d..2c59c3d46 100644 --- a/src/misc/lv_color.c +++ b/src/misc/lv_color.c @@ -135,7 +135,7 @@ lv_color_t lv_color_darken(lv_color_t c, lv_opa_t lvl) lv_color_t lv_color_change_lightness(lv_color_t c, lv_opa_t lvl) { - /* It'd be better to convert the color to HSL, change L and convert back to RGB.*/ + /*It'd be better to convert the color to HSL, change L and convert back to RGB.*/ if(lvl == LV_OPA_50) return c; else if(lvl < LV_OPA_50) return lv_color_darken(c, (LV_OPA_50 - lvl) * 2); else return lv_color_lighten(c, (lvl - LV_OPA_50) * 2); diff --git a/src/misc/lv_color.h b/src/misc/lv_color.h index c41abc316..58b23f5c3 100644 --- a/src/misc/lv_color.h +++ b/src/misc/lv_color.h @@ -70,14 +70,15 @@ enum { #error "Invalid LV_COLOR_DEPTH in lv_conf.h! Set it to 1, 8, 16 or 32!" #endif -/* Adjust color mix functions rounding. +/** + * Adjust color mix functions rounding. * GPUs might calculate color mix (blending) differently. * Should be in range of 0..254 * 0: no adjustment, get the integer part of the result (round down) * 64: round up from x.75 * 128: round up from half * 192: round up from x.25 - * 254: round up */ + * 254: round up*/ #ifndef LV_COLOR_MIX_ROUND_OFS #if LV_COLOR_DEPTH == 32 #define LV_COLOR_MIX_ROUND_OFS 0 @@ -93,7 +94,7 @@ enum { * so we use _MSC_VER macro instead of __cplusplus */ #ifdef _MSC_VER -#if _MSC_VER >= 1900 /* Visual Studio 2015 */ +#if _MSC_VER >= 1900 /*Visual Studio 2015*/ #define _LV_COLOR_HAS_MODERN_CPP 1 #endif #else @@ -101,14 +102,14 @@ enum { #define _LV_COLOR_HAS_MODERN_CPP 1 #endif #endif -#endif /* __cplusplus */ +#endif /*__cplusplus*/ #ifndef _LV_COLOR_HAS_MODERN_CPP #define _LV_COLOR_HAS_MODERN_CPP 0 #endif #if _LV_COLOR_HAS_MODERN_CPP -/* Fix msvc compiler error C4576 inside C++ code */ +/*Fix msvc compiler error C4576 inside C++ code*/ #define _LV_COLOR_MAKE_TYPE_HELPER lv_color_t #else #define _LV_COLOR_MAKE_TYPE_HELPER (lv_color_t) @@ -207,7 +208,7 @@ enum { **********************/ typedef union { - uint8_t full; /*must be declared first to set all bits of byte via initializer list */ + uint8_t full; /*must be declared first to set all bits of byte via initializer list*/ union { uint8_t blue : 1; uint8_t green : 1; @@ -353,15 +354,15 @@ static inline uint8_t lv_color_to8(lv_color_t color) return color.full; #elif LV_COLOR_DEPTH == 16 lv_color8_t ret; - LV_COLOR_SET_R8(ret, LV_COLOR_GET_R(color) >> 2); /* 5 - 3 = 2*/ - LV_COLOR_SET_G8(ret, LV_COLOR_GET_G(color) >> 3); /* 6 - 3 = 3*/ - LV_COLOR_SET_B8(ret, LV_COLOR_GET_B(color) >> 3); /* 5 - 2 = 3*/ + LV_COLOR_SET_R8(ret, LV_COLOR_GET_R(color) >> 2); /*5 - 3 = 2*/ + LV_COLOR_SET_G8(ret, LV_COLOR_GET_G(color) >> 3); /*6 - 3 = 3*/ + LV_COLOR_SET_B8(ret, LV_COLOR_GET_B(color) >> 3); /*5 - 2 = 3*/ return ret.full; #elif LV_COLOR_DEPTH == 32 lv_color8_t ret; - LV_COLOR_SET_R8(ret, LV_COLOR_GET_R(color) >> 5); /* 8 - 3 = 5*/ - LV_COLOR_SET_G8(ret, LV_COLOR_GET_G(color) >> 5); /* 8 - 3 = 5*/ - LV_COLOR_SET_B8(ret, LV_COLOR_GET_B(color) >> 6); /* 8 - 2 = 6*/ + LV_COLOR_SET_R8(ret, LV_COLOR_GET_R(color) >> 5); /*8 - 3 = 5*/ + LV_COLOR_SET_G8(ret, LV_COLOR_GET_G(color) >> 5); /*8 - 3 = 5*/ + LV_COLOR_SET_B8(ret, LV_COLOR_GET_B(color) >> 6); /*8 - 2 = 6*/ return ret.full; #endif } @@ -383,9 +384,9 @@ static inline uint16_t lv_color_to16(lv_color_t color) return color.full; #elif LV_COLOR_DEPTH == 32 lv_color16_t ret; - LV_COLOR_SET_R16(ret, LV_COLOR_GET_R(color) >> 3); /* 8 - 5 = 3*/ - LV_COLOR_SET_G16(ret, LV_COLOR_GET_G(color) >> 2); /* 8 - 6 = 2*/ - LV_COLOR_SET_B16(ret, LV_COLOR_GET_B(color) >> 3); /* 8 - 5 = 3*/ + LV_COLOR_SET_R16(ret, LV_COLOR_GET_R(color) >> 3); /*8 - 5 = 3*/ + LV_COLOR_SET_G16(ret, LV_COLOR_GET_G(color) >> 2); /*8 - 6 = 2*/ + LV_COLOR_SET_B16(ret, LV_COLOR_GET_B(color) >> 3); /*8 - 5 = 3*/ return ret.full; #endif } @@ -534,7 +535,7 @@ LV_ATTRIBUTE_FAST_MEM static inline void lv_color_mix_with_alpha(lv_color_t bg_c lv_color_t fg_color, lv_opa_t fg_opa, lv_color_t * res_color, lv_opa_t * res_opa) { - /* Pick the foreground if it's fully opaque or the Background is fully transparent*/ + /*Pick the foreground if it's fully opaque or the Background is fully transparent*/ if(fg_opa >= LV_OPA_MAX || bg_opa <= LV_OPA_MIN) { res_color->full = fg_color.full; *res_opa = fg_opa; @@ -677,7 +678,7 @@ lv_color_t lv_color_get_palette_darken_4(lv_color_palette_t palette); /********************** * PREDEFINED COLORS **********************/ -/* Source: https://vuetifyjs.com/en/styles/colors/#material-colors */ +/*Source: https://vuetifyjs.com/en/styles/colors/#material-colors*/ static inline lv_color_t lv_color_red(void) { return lv_color_hex(0xF44336); } static inline lv_color_t lv_color_red_lighten_5(void) { return lv_color_hex(0xFFEBEE); } @@ -896,7 +897,7 @@ static inline lv_color_t lv_color_black(void) { return lv_color_hex(0 **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_COLOR_H*/ diff --git a/src/misc/lv_fs.c b/src/misc/lv_fs.c index f78b426e6..6d6444331 100644 --- a/src/misc/lv_fs.c +++ b/src/misc/lv_fs.c @@ -17,7 +17,8 @@ * DEFINES *********************/ -/* "free" is used as a function pointer (in lv_fs_drv_t). +/** + * "free" is used as a function pointer (in lv_fs_drv_t). * We must make sure "free" was not defined to a platform specific * free function, otherwise compilation would fail. */ @@ -309,7 +310,7 @@ const char * lv_fs_get_ext(const char * fn) } } - return ""; /*Empty string if no '.' in the file name. */ + return ""; /*Empty string if no '.' in the file name.*/ } char * lv_fs_up(char * path) diff --git a/src/misc/lv_fs.h b/src/misc/lv_fs.h index e520d679d..44aeb9157 100644 --- a/src/misc/lv_fs.h +++ b/src/misc/lv_fs.h @@ -34,7 +34,7 @@ extern "C" { enum { LV_FS_RES_OK = 0, LV_FS_RES_HW_ERR, /*Low level hardware error*/ - LV_FS_RES_FS_ERR, /*Error in the file system structure */ + LV_FS_RES_FS_ERR, /*Error in the file system structure*/ LV_FS_RES_NOT_EX, /*Driver, file or directory is not exists*/ LV_FS_RES_FULL, /*Disk full*/ LV_FS_RES_LOCKED, /*The file is already opened*/ @@ -84,7 +84,7 @@ typedef struct _lv_fs_drv_t { lv_fs_res_t (*dir_close_cb)(struct _lv_fs_drv_t * drv, void * rddir_p); #if LV_USE_USER_DATA - void * user_data; /**< Custom file user data */ + void * user_data; /**< Custom file user data*/ #endif } lv_fs_drv_t; @@ -247,7 +247,7 @@ const char * lv_fs_get_last(const char * path); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_FS_H*/ diff --git a/src/misc/lv_gc.c b/src/misc/lv_gc.c index 4932c716c..ca163fee0 100644 --- a/src/misc/lv_gc.c +++ b/src/misc/lv_gc.c @@ -28,7 +28,7 @@ #if(!defined(LV_ENABLE_GC)) || LV_ENABLE_GC == 0 LV_ROOTS -#endif /* LV_ENABLE_GC */ +#endif /*LV_ENABLE_GC*/ /********************** * MACROS diff --git a/src/misc/lv_gc.h b/src/misc/lv_gc.h index c0c7bf1a4..08a34357d 100644 --- a/src/misc/lv_gc.h +++ b/src/misc/lv_gc.h @@ -61,13 +61,13 @@ extern "C" { #if LV_ENABLE_GC == 1 #if LV_MEM_CUSTOM != 1 #error "GC requires CUSTOM_MEM" -#endif /* LV_MEM_CUSTOM */ +#endif /*LV_MEM_CUSTOM*/ #include LV_GC_INCLUDE -#else /* LV_ENABLE_GC */ +#else /*LV_ENABLE_GC*/ #define LV_GC_ROOT(x) x #define LV_EXTERN_ROOT(root_type, root_name) extern root_type root_name; LV_ITERATE_ROOTS(LV_EXTERN_ROOT) -#endif /* LV_ENABLE_GC */ +#endif /*LV_ENABLE_GC*/ /********************** * TYPEDEFS @@ -84,7 +84,7 @@ void _lv_gc_clear_roots(void); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_GC_H*/ diff --git a/src/misc/lv_ll.c b/src/misc/lv_ll.c index e81026a8b..30fb329a6 100644 --- a/src/misc/lv_ll.c +++ b/src/misc/lv_ll.c @@ -281,8 +281,8 @@ void * _lv_ll_get_tail(const lv_ll_t * ll_p) */ void * _lv_ll_get_next(const lv_ll_t * ll_p, const void * n_act) { - /* Pointer to the next node is stored in the end of this node. - * Go there and return the address found there */ + /*Pointer to the next node is stored in the end of this node. + *Go there and return the address found there*/ const lv_ll_node_t * n_act_d = n_act; n_act_d += LL_NEXT_P_OFFSET(ll_p); return *((lv_ll_node_t **)n_act_d); @@ -296,8 +296,8 @@ void * _lv_ll_get_next(const lv_ll_t * ll_p, const void * n_act) */ void * _lv_ll_get_prev(const lv_ll_t * ll_p, const void * n_act) { - /* Pointer to the prev. node is stored in the end of this node. - * Go there and return the address found there */ + /*Pointer to the prev. node is stored in the end of this node. + *Go there and return the address found there*/ const lv_ll_node_t * n_act_d = n_act; n_act_d += LL_PREV_P_OFFSET(ll_p); return *((lv_ll_node_t **)n_act_d); diff --git a/src/misc/lv_ll.h b/src/misc/lv_ll.h index c67f4cca8..f5ce966a6 100644 --- a/src/misc/lv_ll.h +++ b/src/misc/lv_ll.h @@ -161,7 +161,7 @@ bool _lv_ll_is_empty(lv_ll_t * ll_p); #define _LV_LL_READ_BACK(list, i) for(i = _lv_ll_get_tail(list); i != NULL; i = _lv_ll_get_prev(list, i)) #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif diff --git a/src/misc/lv_log.h b/src/misc/lv_log.h index fe46cf449..f0d7dcbc2 100644 --- a/src/misc/lv_log.h +++ b/src/misc/lv_log.h @@ -28,7 +28,7 @@ extern "C" { #define LV_LOG_LEVEL_ERROR 3 /**< Only critical issue, when the system may fail*/ #define LV_LOG_LEVEL_USER 4 /**< Custom logs from the user*/ #define LV_LOG_LEVEL_NONE 5 /**< Do not log anything*/ -#define _LV_LOG_LEVEL_NUM 6 /**< Number of log levels */ +#define _LV_LOG_LEVEL_NUM 6 /**< Number of log levels*/ LV_EXPORT_CONST_INT(LV_LOG_LEVEL_TRACE); LV_EXPORT_CONST_INT(LV_LOG_LEVEL_INFO); @@ -118,7 +118,7 @@ void _lv_log_add(lv_log_level_t level, const char * file, int line, const char * #endif /*LV_USE_LOG*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_LOG_H*/ diff --git a/src/misc/lv_math.c b/src/misc/lv_math.c index 06337c67b..071f00b30 100644 --- a/src/misc/lv_math.c +++ b/src/misc/lv_math.c @@ -241,7 +241,8 @@ int32_t lv_map(int32_t x, int32_t min_in, int32_t max_in, int32_t min_out, int32 if(x >= max_in) return max_out; if(x <= min_in) return min_out; - /* The equation should be: + /** + * The equation should be: * ((x - min_in) * delta_out) / delta in) + min_out * To avoid rounding error reorder the operations: * (x - min_in) * (delta_out / delta_min) + min_out @@ -257,7 +258,7 @@ uint32_t lv_rand(uint32_t min, uint32_t max) { static uint32_t a = 0x1234ABCD; /*Seed*/ - /* Algorithm "xor" from p. 4 of Marsaglia, "Xorshift RNGs" */ + /*Algorithm "xor" from p. 4 of Marsaglia, "Xorshift RNGs"*/ uint32_t x = a; x ^= x << 13; x ^= x >> 17; diff --git a/src/misc/lv_math.h b/src/misc/lv_math.h index dfb407399..395322484 100644 --- a/src/misc/lv_math.h +++ b/src/misc/lv_math.h @@ -22,7 +22,7 @@ extern "C" { #define LV_TRIGO_SIN_MAX 32767 #define LV_TRIGO_SHIFT 15 /**< >> LV_TRIGO_SHIFT to normalize*/ -#define LV_BEZIER_VAL_MAX 1024 /**< Max time in Bezier functions (not [0..1] to use integers) */ +#define LV_BEZIER_VAL_MAX 1024 /**< Max time in Bezier functions (not [0..1] to use integers)*/ #define LV_BEZIER_VAL_SHIFT 10 /**< log2(LV_BEZIER_VAL_MAX): used to normalize up scaled values*/ /********************** @@ -136,7 +136,7 @@ uint32_t lv_rand(uint32_t min, uint32_t max); #define LV_MAX_OF(t) ((unsigned long) (LV_IS_SIGNED(t) ? LV_SMAX_OF(t) : LV_UMAX_OF(t))) #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif diff --git a/src/misc/lv_mem.c b/src/misc/lv_mem.c index df6035cc7..ac20966ad 100644 --- a/src/misc/lv_mem.c +++ b/src/misc/lv_mem.c @@ -257,7 +257,7 @@ void * lv_mem_buf_get(uint32_t size) MEM_TRACE("begin, getting %d bytes", size); - /*Try to find a free buffer with suitable size */ + /*Try to find a free buffer with suitable size*/ int8_t i_guess = -1; for(uint8_t i = 0; i < LV_MEM_BUF_MAX_NUM; i++) { if(LV_GC_ROOT(lv_mem_buf[i]).used == 0 && LV_GC_ROOT(lv_mem_buf[i]).size >= size) { diff --git a/src/misc/lv_mem.h b/src/misc/lv_mem.h index c2706b538..bf419f8de 100644 --- a/src/misc/lv_mem.h +++ b/src/misc/lv_mem.h @@ -40,14 +40,14 @@ extern "C" { * Heap information structure. */ typedef struct { - uint32_t total_size; /**< Total heap size */ + uint32_t total_size; /**< Total heap size*/ uint32_t free_cnt; - uint32_t free_size; /**< Size of available memory */ + uint32_t free_size; /**< Size of available memory*/ uint32_t free_biggest_size; uint32_t used_cnt; - uint32_t max_used; /**< Max size of Heap memory used */ - uint8_t used_pct; /**< Percentage used */ - uint8_t frag_pct; /**< Amount of fragmentation */ + uint32_t max_used; /**< Max size of Heap memory used*/ + uint8_t used_pct; /**< Percentage used*/ + uint8_t frag_pct; /**< Amount of fragmentation*/ } lv_mem_monitor_t; typedef struct { @@ -244,7 +244,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_memset_ff(void * dst, size_t len); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_MEM_H*/ diff --git a/src/misc/lv_printf.h b/src/misc/lv_printf.h index be667c1d4..4543cffed 100644 --- a/src/misc/lv_printf.h +++ b/src/misc/lv_printf.h @@ -61,7 +61,7 @@ int lv_vsnprintf(char * buffer, size_t count, const char * format, va_list va); #endif #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif // _LV_PRINTF_H_ diff --git a/src/misc/lv_style.c b/src/misc/lv_style.c index 580585f95..6b378e984 100644 --- a/src/misc/lv_style.c +++ b/src/misc/lv_style.c @@ -105,7 +105,7 @@ bool lv_style_remove_prop(lv_style_t * style, lv_style_prop_t prop) } uint32_t j; - for(i = j = 0; j <= style->prop_cnt; j++) { /* <=: because prop_cnt already reduced but all the old props. needs to be checked. */ + for(i = j = 0; j <= style->prop_cnt; j++) { /*<=: because prop_cnt already reduced but all the old props. needs to be checked.*/ if(old_props[j] != prop) { new_values[i] = old_values[j]; new_props[i++] = old_props[j]; diff --git a/src/misc/lv_style.h b/src/misc/lv_style.h index e699199e9..16b4496f6 100644 --- a/src/misc/lv_style.h +++ b/src/misc/lv_style.h @@ -31,10 +31,10 @@ extern "C" { /** * Flags for style properties */ -#define LV_STYLE_PROP_INHERIT (1 << 10) /* Inherited*/ -#define LV_STYLE_PROP_EXT_DRAW (1 << 11) /* Requires ext. draw size update when changed */ -#define LV_STYLE_PROP_LAYOUT_REFR (1 << 12) /* Requires layout update when changed */ -#define LV_STYLE_PROP_FILTER (1 << 13) /* Apply color filter*/ +#define LV_STYLE_PROP_INHERIT (1 << 10) /*Inherited*/ +#define LV_STYLE_PROP_EXT_DRAW (1 << 11) /*Requires ext. draw size update when changed*/ +#define LV_STYLE_PROP_LAYOUT_REFR (1 << 12) /*Requires layout update when changed*/ +#define LV_STYLE_PROP_FILTER (1 << 13) /*Apply color filter*/ /** * Other constants @@ -88,9 +88,9 @@ typedef uint8_t lv_border_side_t; * The direction of the gradient. */ enum { - LV_GRAD_DIR_NONE, /**< No gradient (the `grad_color` property is ignored) */ - LV_GRAD_DIR_VER, /**< Vertical (top to bottom) gradient */ - LV_GRAD_DIR_HOR, /**< Horizontal (left to right) gradient */ + LV_GRAD_DIR_NONE, /**< No gradient (the `grad_color` property is ignored)*/ + LV_GRAD_DIR_VER, /**< Vertical (top to bottom) gradient*/ + LV_GRAD_DIR_HOR, /**< Horizontal (left to right) gradient*/ }; typedef uint8_t lv_grad_dir_t; @@ -101,7 +101,7 @@ typedef uint8_t lv_grad_dir_t; typedef union { int32_t num; /**< Number integer number (opacity, enums, booleans or "normal" numbers)*/ const void * ptr; /**< Constant pointers (font, cone text, etc)*/ - lv_color_t color; /**< Colors */ + lv_color_t color; /**< Colors*/ }lv_style_value_t; /** @@ -227,7 +227,7 @@ typedef enum { * Descriptor for style transitions */ typedef struct _lv_style_transiton_t{ - const lv_style_prop_t * props; /**< An array with the properties to animate. */ + const lv_style_prop_t * props; /**< An array with the properties to animate.*/ const lv_anim_path_t * path; /**< A path for the animation.*/ uint32_t time; /**< Duration of the transition in [ms]*/ uint32_t delay; /**< Delay before the transition in [ms]*/ @@ -248,8 +248,8 @@ typedef struct { uint32_t sentinel; #endif - /* If there is only one property store it directly. - * For more properties allocate an array */ + /*If there is only one property store it directly. + *For more properties allocate an array*/ union { lv_style_value_t value1; uint8_t * values_and_props; @@ -435,7 +435,7 @@ static inline void lv_style_set_pad_gap(lv_style_t * style, lv_coord_t value) { #endif #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_STYLE_H*/ diff --git a/src/misc/lv_templ.c b/src/misc/lv_templ.c index 45683915e..939930cf2 100644 --- a/src/misc/lv_templ.c +++ b/src/misc/lv_templ.c @@ -15,8 +15,8 @@ * TYPEDEFS **********************/ -/* This typedef exists purely to keep -Wpedantic happy when the file is empty. */ -/* It can be removed. */ +/*This typedef exists purely to keep -Wpedantic happy when the file is empty.*/ +/*It can be removed.*/ typedef int _keep_pedantic_happy; /********************** diff --git a/src/misc/lv_templ.h b/src/misc/lv_templ.h index 1f1b92d6d..f7e3c2681 100644 --- a/src/misc/lv_templ.h +++ b/src/misc/lv_templ.h @@ -31,7 +31,7 @@ extern "C" { **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_TEMPL_H*/ diff --git a/src/misc/lv_timer.c b/src/misc/lv_timer.c index f182c8bad..038a6dbf5 100644 --- a/src/misc/lv_timer.c +++ b/src/misc/lv_timer.c @@ -83,15 +83,15 @@ LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_timer_handler(void) uint32_t handler_start = lv_tick_get(); - /* Run all timer from the list*/ + /*Run all timer from the list*/ lv_timer_t * next; do { timer_deleted = false; timer_created = false; LV_GC_ROOT(_lv_timer_act) = _lv_ll_get_head(&LV_GC_ROOT(_lv_timer_ll)); while(LV_GC_ROOT(_lv_timer_act)) { - /* The timer might be deleted if it runs only once ('repeat_count = 1') - * So get next element until the current is surely valid*/ + /*The timer might be deleted if it runs only once ('repeat_count = 1') + *So get next element until the current is surely valid*/ next = _lv_ll_get_next(&LV_GC_ROOT(_lv_timer_ll), LV_GC_ROOT(_lv_timer_act)); if(lv_timer_exec(LV_GC_ROOT(_lv_timer_act))) { diff --git a/src/misc/lv_timer.h b/src/misc/lv_timer.h index 22e711dbe..3eae483a1 100644 --- a/src/misc/lv_timer.h +++ b/src/misc/lv_timer.h @@ -42,11 +42,11 @@ typedef void (*lv_timer_cb_t)(struct _lv_timer_t *); * Descriptor of a lv_timer */ typedef struct _lv_timer_t { - uint32_t period; /**< How often the timer should run */ - uint32_t last_run; /**< Last time the timer ran */ - lv_timer_cb_t timer_cb; /**< Timer function */ - void * user_data; /**< Custom user data */ - int32_t repeat_count; /**< 1: One time; -1 : infinity; n>0: residual times */ + uint32_t period; /**< How often the timer should run*/ + uint32_t last_run; /**< Last time the timer ran*/ + lv_timer_cb_t timer_cb; /**< Timer function*/ + void * user_data; /**< Custom user data*/ + int32_t repeat_count; /**< 1: One time; -1 : infinity; n>0: residual times*/ uint32_t paused :1; } lv_timer_t; @@ -158,7 +158,7 @@ lv_timer_t * lv_timer_get_next(lv_timer_t * timer); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif diff --git a/src/misc/lv_txt.c b/src/misc/lv_txt.c index 994d6fee3..825b6f14a 100644 --- a/src/misc/lv_txt.c +++ b/src/misc/lv_txt.c @@ -182,19 +182,19 @@ static uint32_t lv_txt_get_next_word(const char * txt, const lv_font_t * font, if(flag & LV_TEXT_FLAG_EXPAND) max_width = LV_COORD_MAX; - uint32_t i = 0, i_next = 0, i_next_next = 0; /* Iterating index into txt */ - uint32_t letter = 0; /* Letter at i */ - uint32_t letter_next = 0; /* Letter at i_next */ + uint32_t i = 0, i_next = 0, i_next_next = 0; /*Iterating index into txt*/ + uint32_t letter = 0; /*Letter at i*/ + uint32_t letter_next = 0; /*Letter at i_next*/ lv_coord_t letter_w; - lv_coord_t cur_w = 0; /* Pixel Width of transversed string */ - uint32_t word_len = 0; /* Number of characters in the transversed word */ - uint32_t break_index = NO_BREAK_FOUND; /* only used for "long" words */ - uint32_t break_letter_count = 0; /* Number of characters up to the long word break point */ + lv_coord_t cur_w = 0; /*Pixel Width of transversed string*/ + uint32_t word_len = 0; /*Number of characters in the transversed word*/ + uint32_t break_index = NO_BREAK_FOUND; /*only used for "long" words*/ + uint32_t break_letter_count = 0; /*Number of characters up to the long word break point*/ letter = _lv_txt_encoded_next(txt, &i_next); i_next_next = i_next; - /* Obtain the full word, regardless if it fits or not in max_width */ + /*Obtain the full word, regardless if it fits or not in max_width*/ while(txt[i] != '\0') { letter_next = _lv_txt_encoded_next(txt, &i_next_next); word_len++; @@ -216,23 +216,23 @@ static uint32_t lv_txt_get_next_word(const char * txt, const lv_font_t * font, cur_w += letter_space; } - /* Test if this character fits within max_width */ + /*Test if this character fits within max_width*/ if(break_index == NO_BREAK_FOUND && (cur_w - letter_space) > max_width) { break_index = i; break_letter_count = word_len - 1; - /* break_index is now pointing at the character that doesn't fit */ + /*break_index is now pointing at the character that doesn't fit*/ } /*Check for new line chars and breakchars*/ if(letter == '\n' || letter == '\r' || is_break_char(letter)) { - /* Update the output width on the first character if it fits. - * Must do this here in case first letter is a break character. */ + /*Update the output width on the first character if it fits. + *Must do this here in case first letter is a break character.*/ if(i == 0 && break_index == NO_BREAK_FOUND && word_w_ptr != NULL) *word_w_ptr = cur_w; word_len--; break; } - /* Update the output width */ + /*Update the output width*/ if(word_w_ptr != NULL && break_index == NO_BREAK_FOUND) *word_w_ptr = cur_w; i = i_next; @@ -240,32 +240,32 @@ static uint32_t lv_txt_get_next_word(const char * txt, const lv_font_t * font, letter = letter_next; } - /* Entire Word fits in the provided space */ + /*Entire Word fits in the provided space*/ if(break_index == NO_BREAK_FOUND) { if(word_len == 0 || (letter == '\r' && letter_next == '\n')) i = i_next; return i; } #if LV_TXT_LINE_BREAK_LONG_LEN > 0 - /* Word doesn't fit in provided space, but isn't "long" */ + /*Word doesn't fit in provided space, but isn't "long"*/ if(word_len < LV_TXT_LINE_BREAK_LONG_LEN) { if(force) return break_index; - if(word_w_ptr != NULL) *word_w_ptr = 0; /* Return no word */ + if(word_w_ptr != NULL) *word_w_ptr = 0; /*Return no word*/ return 0; } - /* Word is "long," but insufficient amounts can fit in provided space */ + /*Word is "long," but insufficient amounts can fit in provided space*/ if(break_letter_count < LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN) { if(force) return break_index; if(word_w_ptr != NULL) *word_w_ptr = 0; return 0; } - /* Word is a "long", but letters may need to be better distributed */ + /*Word is a "long", but letters may need to be better distributed*/ { i = break_index; int32_t n_move = LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN - (word_len - break_letter_count); - /* Move pointer "i" backwards */ + /*Move pointer "i" backwards*/ for(; n_move > 0; n_move--) { _lv_txt_encoded_prev(txt, &i); // TODO: it would be appropriate to update the returned word width here @@ -275,7 +275,7 @@ static uint32_t lv_txt_get_next_word(const char * txt, const lv_font_t * font, return i; #else if(force) return break_index; - if(word_w_ptr != NULL) *word_w_ptr = 0; /* Return no word */ + if(word_w_ptr != NULL) *word_w_ptr = 0; /*Return no word*/ (void) break_letter_count; return 0; #endif @@ -299,8 +299,8 @@ uint32_t _lv_txt_get_next_line(const char * txt, const lv_font_t * font, if(txt == NULL) return 0; if(font == NULL) return 0; - /* If max_width doesn't mater simply find the new line character - * without thinking about word wrapping*/ + /*If max_width doesn't mater simply find the new line character + *without thinking about word wrapping*/ if((flag & LV_TEXT_FLAG_EXPAND) || (flag & LV_TEXT_FLAG_FIT)) { uint32_t i; for(i = 0; txt[i] != '\n' && txt[i] != '\r' && txt[i] != '\0'; i++) { @@ -312,7 +312,7 @@ uint32_t _lv_txt_get_next_line(const char * txt, const lv_font_t * font, if(flag & LV_TEXT_FLAG_EXPAND) max_width = LV_COORD_MAX; lv_text_cmd_state_t cmd_state = LV_TEXT_CMD_STATE_WAIT; - uint32_t i = 0; /* Iterating index into txt */ + uint32_t i = 0; /*Iterating index into txt*/ while(txt[i] != '\0' && max_width > 0) { uint32_t word_w = 0; @@ -329,13 +329,13 @@ uint32_t _lv_txt_get_next_line(const char * txt, const lv_font_t * font, if(txt[0] == '\n' || txt[0] == '\r') break; if(txt[i] == '\n' || txt[i] == '\r') { - i++; /* Include the following newline in the current line */ + i++; /*Include the following newline in the current line*/ break; } } - /* Always step at least one to avoid infinite loops */ + /*Always step at least one to avoid infinite loops*/ if(i == 0) { _lv_txt_encoded_next(txt, &i); } @@ -383,7 +383,7 @@ lv_coord_t _lv_txt_get_width(const char * txt, uint32_t length, const lv_font_t if(width > 0) { width -= letter_space; /*Trim the last letter space. Important if the text is center - aligned */ + aligned*/ } } @@ -407,11 +407,11 @@ bool _lv_txt_is_cmd(lv_text_cmd_state_t * state, uint32_t c) *state = LV_TEXT_CMD_STATE_PAR; ret = true; } - /*Other start char in parameter is escaped cmd. char */ + /*Other start char in parameter is escaped cmd. char*/ else if(*state == LV_TEXT_CMD_STATE_PAR) { *state = LV_TEXT_CMD_STATE_WAIT; } - /*Command end */ + /*Command end*/ else if(*state == LV_TEXT_CMD_STATE_IN) { *state = LV_TEXT_CMD_STATE_WAIT; ret = true; @@ -451,7 +451,7 @@ void _lv_txt_ins(char * txt_buf, uint32_t pos, const char * ins_txt) txt_buf[i] = txt_buf[i - ins_len]; } - /* Copy the text into the new space*/ + /*Copy the text into the new space*/ lv_memcpy_small(txt_buf + pos, ins_txt, ins_len); } @@ -484,7 +484,7 @@ void _lv_txt_cut(char * txt, uint32_t pos, uint32_t len) */ char * _lv_txt_set_text_vfmt(const char * fmt, va_list ap) { - /*Allocate space for the new text by using trick from C99 standard section 7.19.6.12 */ + /*Allocate space for the new text by using trick from C99 standard section 7.19.6.12*/ va_list ap_copy; va_copy(ap_copy, ap); uint32_t len = lv_vsnprintf(NULL, 0, fmt, ap_copy); @@ -517,7 +517,7 @@ char * _lv_txt_set_text_vfmt(const char * fmt, va_list ap) if(text == NULL) { return NULL; } - text[len] = 0; /* Ensure NULL termination */ + text[len] = 0; /*Ensure NULL termination*/ lv_vsnprintf(text, len + 1, fmt, ap); #endif @@ -616,12 +616,13 @@ static uint32_t lv_txt_utf8_conv_wc(uint32_t c) */ static uint32_t lv_txt_utf8_next(const char * txt, uint32_t * i) { - /* Unicode to UTF-8 + /** + * Unicode to UTF-8 * 00000000 00000000 00000000 0xxxxxxx -> 0xxxxxxx * 00000000 00000000 00000yyy yyxxxxxx -> 110yyyyy 10xxxxxx * 00000000 00000000 zzzzyyyy yyxxxxxx -> 1110zzzz 10yyyyyy 10xxxxxx * 00000000 000wwwzz zzzzyyyy yyxxxxxx -> 11110www 10zzzzzz 10yyyyyy 10xxxxxx - * */ + */ uint32_t result = 0; @@ -822,7 +823,7 @@ static uint32_t lv_txt_iso8859_1_conv_wc(uint32_t c) */ static uint32_t lv_txt_iso8859_1_next(const char * txt, uint32_t * i) { - if(i == NULL) return txt[1]; /*Get the next char */ + if(i == NULL) return txt[1]; /*Get the next char*/ uint8_t letter = txt[*i]; (*i)++; @@ -837,7 +838,7 @@ static uint32_t lv_txt_iso8859_1_next(const char * txt, uint32_t * i) */ static uint32_t lv_txt_iso8859_1_prev(const char * txt, uint32_t * i) { - if(i == NULL) return *(txt - 1); /*Get the prev. char */ + if(i == NULL) return *(txt - 1); /*Get the prev. char*/ (*i)--; uint8_t letter = txt[*i]; diff --git a/src/misc/lv_txt.h b/src/misc/lv_txt.h index cf74438bd..cc6dfc39a 100644 --- a/src/misc/lv_txt.h +++ b/src/misc/lv_txt.h @@ -46,7 +46,7 @@ enum { typedef uint8_t lv_text_flag_t; /** - * State machine for text renderer. */ + * State machine for text renderer.*/ enum { LV_TEXT_CMD_STATE_WAIT, /**< Waiting for command*/ LV_TEXT_CMD_STATE_PAR, /**< Processing the parameter*/ @@ -56,10 +56,10 @@ typedef uint8_t lv_text_cmd_state_t; /** Label align policy*/ enum { - LV_TEXT_ALIGN_LEFT, /**< Align text to left */ - LV_TEXT_ALIGN_CENTER, /**< Align text to center */ - LV_TEXT_ALIGN_RIGHT, /**< Align text to right */ - LV_TEXT_ALIGN_AUTO, /**< */ + LV_TEXT_ALIGN_LEFT, /**< Align text to left*/ + LV_TEXT_ALIGN_CENTER, /**< Align text to center*/ + LV_TEXT_ALIGN_RIGHT, /**< Align text to right*/ + LV_TEXT_ALIGN_AUTO, /**< Align text auto*/ }; typedef uint8_t lv_text_align_t; @@ -217,7 +217,7 @@ extern uint32_t (*_lv_txt_get_encoded_length)(const char *); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*USE_TXT*/ diff --git a/src/misc/lv_txt_ap.c b/src/misc/lv_txt_ap.c index 16d5acc90..e028009f9 100644 --- a/src/misc/lv_txt_ap.c +++ b/src/misc/lv_txt_ap.c @@ -33,7 +33,7 @@ static uint32_t lv_txt_lam_alef(uint32_t ch_curr, uint32_t ch_next); **********************/ const ap_chars_map_t ap_chars_map[] = { - /* {Key Offset, End, Beginning, Middle, Isolated, {conjunction}} */ + /*{Key Offset, End, Beginning, Middle, Isolated, {conjunction}}*/ {1, 0xFE84, -1, 0, -1, {1, 0}}, // Ø£ {2, 0xFE86, -1, 0, -1, {1, 0}}, // ؤ {3, 0xFE88, -1, 0, -1, {1, 0}}, // ﺇ diff --git a/src/misc/lv_txt_ap.h b/src/misc/lv_txt_ap.h index 3bf7a4d1d..ad7265ca2 100644 --- a/src/misc/lv_txt_ap.h +++ b/src/misc/lv_txt_ap.h @@ -54,7 +54,7 @@ void _lv_txt_ap_proc(const char * txt, char * txt_out); #endif // LV_USE_ARABIC_PERSIAN_CHARS #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_TXT_AP_H*/ diff --git a/src/misc/lv_types.h b/src/misc/lv_types.h index 95663e3c3..e445b72db 100644 --- a/src/misc/lv_types.h +++ b/src/misc/lv_types.h @@ -81,7 +81,7 @@ typedef uint32_t lv_uintptr_t; #define LV_CONCAT3(x, y, z) _LV_CONCAT3(x, y, z) #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_TYPES_H*/ diff --git a/src/misc/lv_utils.h b/src/misc/lv_utils.h index 4d74029fe..313760f21 100644 --- a/src/misc/lv_utils.h +++ b/src/misc/lv_utils.h @@ -60,7 +60,7 @@ void * _lv_utils_bsearch(const void * key, const void * base, uint32_t n, uint32 **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif diff --git a/src/widgets/lv_arc.c b/src/widgets/lv_arc.c index d621ac96a..122786e24 100644 --- a/src/widgets/lv_arc.c +++ b/src/widgets/lv_arc.c @@ -359,7 +359,7 @@ void lv_arc_set_range(lv_obj_t * obj, int16_t min, int16_t max) arc->value = max; } - value_update(obj); /* value has changed relative to the new range */ + value_update(obj); /*value has changed relative to the new range*/ } /** @@ -487,7 +487,7 @@ static void lv_arc_constructor(lv_obj_t * obj, const lv_obj_t * copy) lv_arc_t * arc = (lv_arc_t *)obj; - /*Initialize the allocated 'ext' */ + /*Initialize the allocated 'ext'*/ arc->rotation = 0; arc->bg_angle_start = 135; arc->bg_angle_end = 45; @@ -595,7 +595,7 @@ static lv_res_t lv_arc_signal(lv_obj_t * obj, lv_signal_t sign, void * param) { lv_res_t res; - /* Include the ancient signal function */ + /*Include the ancient signal function*/ res = lv_obj_signal_base(MY_CLASS, obj, sign, param); if(res != LV_RES_OK) return res; @@ -654,9 +654,9 @@ static lv_res_t lv_arc_signal(lv_obj_t * obj, lv_signal_t sign, void * param) int16_t last_angle_rel =arc->last_angle -arc->bg_angle_start; int16_t delta_angle = angle - last_angle_rel; - /* Do not allow big jumps. - * It's mainly to avoid jumping to the opposite end if the "dead" range between min. an max. is crossed. - * Check which and was closer on the last valid press (arc->min_close) and prefer that end */ + /*Do not allow big jumps. + *It's mainly to avoid jumping to the opposite end if the "dead" range between min. an max. is crossed. + *Check which and was closer on the last valid press (arc->min_close) and prefer that end*/ if(LV_ABS(delta_angle) > 180) { if(arc->min_close) angle = 0; else angle = deg_range; @@ -707,7 +707,7 @@ static lv_res_t lv_arc_signal(lv_obj_t * obj, lv_signal_t sign, void * param) else if(sign == LV_SIGNAL_RELEASED || sign == LV_SIGNAL_PRESS_LOST) { arc->dragging = false; - /*Leave edit mode if released. (No need to wait for LONG_PRESS) */ + /*Leave edit mode if released. (No need to wait for LONG_PRESS)*/ lv_group_t * g = lv_obj_get_group(obj); bool editing = lv_group_get_editing(g); lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act()); diff --git a/src/widgets/lv_arc.h b/src/widgets/lv_arc.h index 2b859ecd8..1487aa2b6 100644 --- a/src/widgets/lv_arc.h +++ b/src/widgets/lv_arc.h @@ -240,7 +240,7 @@ bool lv_arc_get_adjustable(lv_obj_t * obj); #endif /*LV_USE_ARC*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_ARC_H*/ diff --git a/src/widgets/lv_bar.c b/src/widgets/lv_bar.c index ca34b65ee..d9486bbad 100644 --- a/src/widgets/lv_bar.c +++ b/src/widgets/lv_bar.c @@ -32,7 +32,7 @@ /** Bar animation end value. (Not the real value of the Bar just indicates process animation)*/ #define LV_BAR_ANIM_STATE_END 256 -/** Mark no animation is in progress */ +/** Mark no animation is in progress*/ #define LV_BAR_ANIM_STATE_INV -1 /** log2(LV_BAR_ANIM_STATE_END) used to normalize data*/ @@ -354,7 +354,7 @@ static void draw_indic(lv_obj_t * obj, const lv_area_t * clip_area) lv_bidi_dir_t base_dir = lv_obj_get_base_dir(obj); if(hor && base_dir == LV_BIDI_DIR_RTL) { - /* Swap axes */ + /*Swap axes*/ lv_coord_t * tmp; tmp = axis1; axis1 = axis2; @@ -363,7 +363,7 @@ static void draw_indic(lv_obj_t * obj, const lv_area_t * clip_area) anim_start_value_x = -anim_start_value_x; } - /* Set the indicator length */ + /*Set the indicator length*/ if(hor) { *axis2 = *axis1 + anim_cur_value_x; *axis1 += anim_start_value_x; @@ -393,7 +393,7 @@ static void draw_indic(lv_obj_t * obj, const lv_area_t * clip_area) *axis1 = zero; } if(*axis2 < *axis1) { - /* swap */ + /*swap*/ zero = *axis1; *axis1 = *axis2; *axis2 = zero; @@ -415,9 +415,9 @@ static void draw_indic(lv_obj_t * obj, const lv_area_t * clip_area) lv_area_t indic_area; lv_area_copy(&indic_area, &bar->indic_area); - /* Draw only the shadow if the indicator is long enough. - * The radius of the bg and the indicator can make a strange shape where - * it'd be very difficult to draw shadow. */ + /*Draw only the shadow if the indicator is long enough. + *The radius of the bg and the indicator can make a strange shape where + *it'd be very difficult to draw shadow.*/ if((hor && lv_area_get_width(&bar->indic_area) > bg_radius * 2) || (!hor && lv_area_get_height(&bar->indic_area) > bg_radius * 2)) { lv_opa_t bg_opa = draw_indic_dsc.bg_opa; @@ -506,7 +506,7 @@ static lv_res_t lv_bar_signal(lv_obj_t * obj, lv_signal_t sign, void * param) LV_ASSERT_OBJ(obj, MY_CLASS); lv_res_t res; - /* Include the ancient signal function */ + /*Include the ancient signal function*/ res = lv_obj_signal_base(MY_CLASS, obj, sign, param); if(res != LV_RES_OK) return res; @@ -573,7 +573,7 @@ static void lv_bar_set_value_with_anim(lv_obj_t * obj, int16_t new_value, int16_ anim_info->anim_end = new_value; } *value_ptr = new_value; - /* Stop the previous animation if it exists */ + /*Stop the previous animation if it exists*/ lv_anim_del(anim_info, NULL); lv_anim_t a; diff --git a/src/widgets/lv_bar.h b/src/widgets/lv_bar.h index b13f38239..b978832e9 100644 --- a/src/widgets/lv_bar.h +++ b/src/widgets/lv_bar.h @@ -152,7 +152,7 @@ lv_bar_type_t lv_bar_get_type(lv_obj_t * obj); #endif /*LV_USE_BAR*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_BAR_H*/ diff --git a/src/widgets/lv_btn.h b/src/widgets/lv_btn.h index a4876aad8..fd0fa9d93 100644 --- a/src/widgets/lv_btn.h +++ b/src/widgets/lv_btn.h @@ -52,7 +52,7 @@ lv_obj_t * lv_btn_create(lv_obj_t * parent, const lv_obj_t * copy); #endif /*LV_USE_BTN*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_BTN_H*/ diff --git a/src/widgets/lv_btnmatrix.c b/src/widgets/lv_btnmatrix.c index bf5f32eba..f173d3dcf 100644 --- a/src/widgets/lv_btnmatrix.c +++ b/src/widgets/lv_btnmatrix.c @@ -114,8 +114,8 @@ void lv_btnmatrix_set_map(lv_obj_t * obj, const char * map[]) /*Calculate the position of each row*/ lv_coord_t max_h_no_gap = max_h - (prow * (row_cnt - 1)); - /* Count the units and the buttons in a line - * (A button can be 1,2,3... unit wide)*/ + /*Count the units and the buttons in a line + *(A button can be 1,2,3... unit wide)*/ uint32_t txt_tot_i = 0; /*Act. index in the str map*/ uint32_t btn_tot_i = 0; /*Act. index of button areas*/ const char ** map_row = map; @@ -319,8 +319,8 @@ const char * lv_btnmatrix_get_btn_text(const lv_obj_t * obj, uint16_t btn_id) uint16_t txt_i = 0; uint16_t btn_i = 0; - /* Search the text of btnm->btn_pr the buttons text in the map - * Skip "\n"-s*/ + /*Search the text of btnm->btn_pr the buttons text in the map + *Skip "\n"-s*/ while(btn_i != btn_id) { btn_i++; txt_i++; @@ -554,7 +554,7 @@ static lv_res_t lv_btnmatrix_signal(lv_obj_t * obj, lv_signal_t sign, void * par { lv_res_t res; - /* Include the ancient signal function */ + /*Include the ancient signal function*/ res = lv_obj_signal_base(MY_CLASS, obj, sign, param); if(res != LV_RES_OK) return res; @@ -622,7 +622,7 @@ static lv_res_t lv_btnmatrix_signal(lv_obj_t * obj, lv_signal_t sign, void * par button_is_inactive(btnm->ctrl_bits[btn_pr]) == false && button_is_hidden(btnm->ctrl_bits[btn_pr]) == false) { invalidate_button_area(obj, btn_pr); - /* Send VALUE_CHANGED for the newly pressed button */ + /*Send VALUE_CHANGED for the newly pressed button*/ if(button_is_click_trig(btnm->ctrl_bits[btn_pr]) == false) { uint32_t b = btn_pr; res = lv_event_send(obj, LV_EVENT_VALUE_CHANGED, &b); @@ -949,12 +949,12 @@ static void invalidate_button_area(const lv_obj_t * obj, uint16_t btn_idx) lv_area_copy(&btn_area, &btnm->button_areas[btn_idx]); lv_obj_get_coords(obj, &obj_area); - /* The buttons might have outline and shadow so make the invalidation larger with the gaps between the buttons. - * It assumes that the outline or shadow is smaller then the gaps*/ + /*The buttons might have outline and shadow so make the invalidation larger with the gaps between the buttons. + *It assumes that the outline or shadow is smaller then the gaps*/ lv_coord_t row_gap = lv_obj_get_style_pad_row(obj, LV_PART_MAIN); lv_coord_t col_gap = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); - /* Convert relative coordinates to absolute */ + /*Convert relative coordinates to absolute*/ btn_area.x1 += obj_area.x1 - row_gap; btn_area.y1 += obj_area.y1 - col_gap; btn_area.x2 += obj_area.x1 + row_gap; diff --git a/src/widgets/lv_btnmatrix.h b/src/widgets/lv_btnmatrix.h index 867cad745..e6bd17416 100644 --- a/src/widgets/lv_btnmatrix.h +++ b/src/widgets/lv_btnmatrix.h @@ -30,19 +30,19 @@ LV_EXPORT_CONST_INT(LV_BTNMATRIX_BTN_NONE); **********************/ /** Type to store button control bits (disabled, hidden etc.) - * The first 3 bits are used to store the width */ + * The first 3 bits are used to store the width*/ enum { - _LV_BTNMATRIX_WIDTH = 0x0007, /**< Reserved to stire the size units */ - LV_BTNMATRIX_CTRL_HIDDEN = 0x0008, /**< Button hidden */ - LV_BTNMATRIX_CTRL_NO_REPEAT = 0x0010, /**< Do not repeat press this button. */ - LV_BTNMATRIX_CTRL_DISABLED = 0x0020, /**< Disable this button. */ - LV_BTNMATRIX_CTRL_CHECKABLE = 0x0040, /**< Button *can* be toggled. */ - LV_BTNMATRIX_CTRL_CHECKED = 0x0080, /**< Button is currently toggled (e.g. checked). */ + _LV_BTNMATRIX_WIDTH = 0x0007, /**< Reserved to stire the size units*/ + LV_BTNMATRIX_CTRL_HIDDEN = 0x0008, /**< Button hidden*/ + LV_BTNMATRIX_CTRL_NO_REPEAT = 0x0010, /**< Do not repeat press this button.*/ + LV_BTNMATRIX_CTRL_DISABLED = 0x0020, /**< Disable this button.*/ + LV_BTNMATRIX_CTRL_CHECKABLE = 0x0040, /**< Button *can* be toggled.*/ + LV_BTNMATRIX_CTRL_CHECKED = 0x0080, /**< Button is currently toggled (e.g. checked).*/ LV_BTNMATRIX_CTRL_CLICK_TRIG = 0x0100, /**< 1: Send LV_EVENT_VALUE_CHANGE on CLICK, 0: Send LV_EVENT_VALUE_CHANGE on PRESS*/ - LV_BTNMATRIX_CTRL_CUSTOM_1 = 0x1000, /**< Custom free to use flag */ - LV_BTNMATRIX_CTRL_CUSTOM_2 = 0x2000, /**< Custom free to use flag */ - LV_BTNMATRIX_CTRL_CUSTOM_3 = 0x4000, /**< Custom free to use flag */ - LV_BTNMATRIX_CTRL_CUSTOM_4 = 0x8000, /**< Custom free to use flag */ + LV_BTNMATRIX_CTRL_CUSTOM_1 = 0x1000, /**< Custom free to use flag*/ + LV_BTNMATRIX_CTRL_CUSTOM_2 = 0x2000, /**< Custom free to use flag*/ + LV_BTNMATRIX_CTRL_CUSTOM_3 = 0x4000, /**< Custom free to use flag*/ + LV_BTNMATRIX_CTRL_CUSTOM_4 = 0x8000, /**< Custom free to use flag*/ }; typedef uint16_t lv_btnmatrix_ctrl_t; @@ -56,7 +56,7 @@ typedef struct { lv_area_t * button_areas; /*Array of areas of buttons*/ lv_btnmatrix_ctrl_t * ctrl_bits; /*Array of control bytes*/ uint16_t btn_cnt; /*Number of button in 'map_p'(Handled by the library)*/ - uint16_t btn_id_sel; /*Index of the active button (being pressed/released etc) or LV_BTNMATRIX_BTN_NONE */ + uint16_t btn_id_sel; /*Index of the active button (being pressed/released etc) or LV_BTNMATRIX_BTN_NONE*/ uint8_t recolor : 1; /*Enable button recoloring*/ uint8_t one_check : 1; /*Single button toggled at once*/ } lv_btnmatrix_t; @@ -226,7 +226,7 @@ bool lv_btnmatrix_get_one_checked(const lv_obj_t * obj); #endif /*LV_USE_BTNMATRIX*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_BTNMATRIX_H*/ diff --git a/src/widgets/lv_canvas.c b/src/widgets/lv_canvas.c index cc82488e2..d4c1d7686 100644 --- a/src/widgets/lv_canvas.c +++ b/src/widgets/lv_canvas.c @@ -215,8 +215,8 @@ void lv_canvas_transform(lv_obj_t * obj, lv_img_dsc_t * img, int16_t angle, uint required*/ else { lv_opa_t bg_opa = lv_img_buf_get_px_alpha(&canvas->dsc, x + offset_x, y + offset_y); - /* Pick the foreground if it's fully opaque or the Background is fully - * transparent*/ + /*Pick the foreground if it's fully opaque or the Background is fully + *transparent*/ if(dsc.res.opa >= LV_OPA_MAX || bg_opa <= LV_OPA_MIN) { lv_img_buf_set_px_color(&canvas->dsc, x + offset_x, y + offset_y, dsc.res.color); lv_img_buf_set_px_alpha(&canvas->dsc, x + offset_x, y + offset_y, dsc.res.opa); @@ -564,8 +564,8 @@ void lv_canvas_draw_rect(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord return; } - /* Create a dummy display to fool the lv_draw function. - * It will think it draws to real screen. */ + /*Create a dummy display to fool the lv_draw function. + *It will think it draws to real screen.*/ lv_area_t mask; mask.x1 = 0; mask.x2 = dsc->header.w - 1; @@ -622,8 +622,8 @@ void lv_canvas_draw_text(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord return; } - /* Create a dummy display to fool the lv_draw function. - * It will think it draws to real screen. */ + /*Create a dummy display to fool the lv_draw function. + *It will think it draws to real screen.*/ lv_area_t mask; mask.x1 = 0; mask.x2 = dsc->header.w - 1; @@ -673,8 +673,8 @@ void lv_canvas_draw_img(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, const voi return; } - /* Create a dummy display to fool the lv_draw function. - * It will think it draws to real screen. */ + /*Create a dummy display to fool the lv_draw function. + *It will think it draws to real screen.*/ lv_area_t mask; mask.x1 = 0; mask.x2 = dsc->header.w - 1; @@ -730,8 +730,8 @@ void lv_canvas_draw_line(lv_obj_t * canvas, const lv_point_t points[], uint32_t LV_LOG_WARN("lv_canvas_draw_line: can't draw to LV_IMG_CF_INDEXED canvas"); return; } - /* Create a dummy display to fool the lv_draw function. - * It will think it draws to real screen. */ + /*Create a dummy display to fool the lv_draw function. + *It will think it draws to real screen.*/ lv_area_t mask; mask.x1 = 0; mask.x2 = dsc->header.w - 1; @@ -785,8 +785,8 @@ void lv_canvas_draw_polygon(lv_obj_t * canvas, const lv_point_t points[], uint32 return; } - /* Create a dummy display to fool the lv_draw function. - * It will think it draws to real screen. */ + /*Create a dummy display to fool the lv_draw function. + *It will think it draws to real screen.*/ lv_area_t mask; mask.x1 = 0; mask.x2 = dsc->header.w - 1; @@ -838,8 +838,8 @@ void lv_canvas_draw_arc(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord_ return; } - /* Create a dummy display to fool the lv_draw function. - * It will think it draws to real screen. */ + /*Create a dummy display to fool the lv_draw function. + *It will think it draws to real screen.*/ lv_area_t mask; mask.x1 = 0; mask.x2 = dsc->header.w - 1; @@ -899,7 +899,7 @@ static void lv_canvas_constructor(lv_obj_t * obj, const lv_obj_t * copy) lv_canvas_t * canvas = (lv_canvas_t *)obj; - /*Initialize the allocated 'ext' */ + /*Initialize the allocated 'ext'*/ canvas->dsc.header.always_zero = 0; canvas->dsc.header.cf = LV_IMG_CF_TRUE_COLOR; canvas->dsc.header.h = 0; diff --git a/src/widgets/lv_canvas.h b/src/widgets/lv_canvas.h index 0bb4c7fda..c0736394b 100644 --- a/src/widgets/lv_canvas.h +++ b/src/widgets/lv_canvas.h @@ -255,7 +255,7 @@ void lv_canvas_draw_arc(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord_ #endif /*LV_USE_CANVAS*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_CANVAS_H*/ diff --git a/src/widgets/lv_chart.c b/src/widgets/lv_chart.c index 97658b997..0d821bf40 100644 --- a/src/widgets/lv_chart.c +++ b/src/widgets/lv_chart.c @@ -286,7 +286,7 @@ void lv_chart_get_point_pos_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint1 } else if(chart->type & LV_CHART_TYPE_BAR) { uint32_t ser_cnt = _lv_ll_get_len(&chart->series_ll); - int32_t ser_gap = (lv_obj_get_style_pad_column(obj, LV_PART_ITEMS) * chart->zoom_x) >> 8; /*Gap between the column on the ~same X */ + int32_t ser_gap = (lv_obj_get_style_pad_column(obj, LV_PART_ITEMS) * chart->zoom_x) >> 8; /*Gap between the column on the ~same X*/ int32_t block_gap = (lv_obj_get_style_pad_column(obj, LV_PART_MAIN) * chart->zoom_x) >> 8; /*Gap between the column on ~adjacent X*/ lv_coord_t block_w = (w - ((chart->point_cnt - 1) * block_gap)) / chart->point_cnt; lv_coord_t col_w = block_w / ser_cnt; @@ -644,7 +644,7 @@ static lv_draw_res_t lv_chart_draw(lv_obj_t * obj, const lv_area_t * clip_area, static lv_res_t lv_chart_signal(lv_obj_t * obj, lv_signal_t sign, void * param) { - /* Include the ancient signal function */ + /*Include the ancient signal function*/ lv_res_t res; res = lv_obj_signal_base(MY_CLASS, obj, sign, param); @@ -915,7 +915,7 @@ static void draw_series_bar(lv_obj_t * obj, const lv_area_t * clip_area) int32_t block_gap = (lv_obj_get_style_pad_column(obj, LV_PART_MAIN) * chart->zoom_x) >> 8; /*Gap between the column on ~adjacent X*/ lv_coord_t block_w = (w - ((chart->point_cnt - 1) * block_gap)) / chart->point_cnt; lv_coord_t col_w = block_w / ser_cnt; - int32_t ser_gap = (lv_obj_get_style_pad_column(obj, LV_PART_ITEMS) * chart->zoom_x) >> 8; /*Gap between the column on the ~same X */ + int32_t ser_gap = (lv_obj_get_style_pad_column(obj, LV_PART_ITEMS) * chart->zoom_x) >> 8; /*Gap between the column on the ~same X*/ lv_coord_t x_ofs = pad_left - lv_obj_get_scroll_left(obj); lv_coord_t y_ofs = pad_top - lv_obj_get_scroll_top(obj); @@ -1094,7 +1094,7 @@ static void draw_y_ticks(lv_obj_t * obj, const lv_area_t * clip_area, lv_chart_a lv_coord_t major_len = t->major_len; lv_coord_t minor_len = t->minor_len; - /* tick lines on secondary y axis are drawn in other direction*/ + /*tick lines on secondary y axis are drawn in other direction*/ if(axis == LV_CHART_AXIS_SECONDARY_Y) { major_len *= -1; minor_len *= -1; @@ -1115,22 +1115,22 @@ static void draw_y_ticks(lv_obj_t * obj, const lv_area_t * clip_area, lv_chart_a uint32_t total_tick_num = (t->major_cnt - 1) * (t->minor_cnt); for(i = 0; i <= total_tick_num; i++) { - /* draw a line at moving y position */ + /*draw a line at moving y position*/ p2.y = p1.y = y_ofs + (int32_t)((int32_t)(h - line_dsc.width) * i) / total_tick_num; - /* first point of the tick */ + /*first point of the tick*/ p1.x = x_ofs; - /* move extra pixel out of chart boundary */ + /*move extra pixel out of chart boundary*/ if(axis == LV_CHART_AXIS_PRIMARY_Y) p1.x--; else p1.x++; - /* second point of the tick */ + /*second point of the tick*/ bool major = false; if(i % t->minor_cnt == 0) major = true; - if(major) p2.x = p1.x - major_len; /* major tick */ - else p2.x = p1.x - minor_len; /* minor tick */ + if(major) p2.x = p1.x - major_len; /*major tick*/ + else p2.x = p1.x - minor_len; /*minor tick*/ if(p1.y + line_dsc.width / 2 >= obj->coords.y1 && p2.y - line_dsc.width / 2 <= obj->coords.y2) @@ -1138,18 +1138,18 @@ static void draw_y_ticks(lv_obj_t * obj, const lv_area_t * clip_area, lv_chart_a lv_draw_line(&p1, &p2, clip_area, &line_dsc); } - /* add text only to major tick */ + /*add text only to major tick*/ if(major && t->label_en) { int32_t tick_value = chart->ymax[axis] - lv_map(i, 0, total_tick_num, chart->ymin[axis], chart->ymax[axis]); lv_snprintf(dsc.text, sizeof(dsc.text), "%d", tick_value); dsc.value = tick_value; lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc); - /* reserve appropriate area */ + /*reserve appropriate area*/ lv_point_t size; lv_txt_get_size(&size, dsc.text, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE); - /* set the area at some distance of the major tick len left of the tick */ + /*set the area at some distance of the major tick len left of the tick*/ lv_area_t a; a.y1 = p2.y - size.y / 2; a.y2 = p2.y + size.y / 2; @@ -1211,7 +1211,7 @@ static void draw_x_ticks(lv_obj_t * obj, const lv_area_t * clip_area) dsc.id = LV_CHART_AXIS_X; dsc.part = LV_PART_TICKS; - /* The columns ticks should be aligned to the center of blocks */ + /*The columns ticks should be aligned to the center of blocks*/ if(chart->type == LV_CHART_TYPE_BAR) { int32_t block_gap = (lv_obj_get_style_pad_column(obj, LV_PART_MAIN) * chart->zoom_x) >> 8; /*Gap between the columns on ~adjacent X*/ lv_coord_t block_w = (w + block_gap) / (chart->point_cnt); @@ -1221,11 +1221,11 @@ static void draw_x_ticks(lv_obj_t * obj, const lv_area_t * clip_area) p1.y = y_ofs; uint32_t total_tick_num = (t->major_cnt - 1) * t->minor_cnt; - for(i = 0; i <= total_tick_num; i++) { /* one extra loop - it may not exist in the list, empty label */ + for(i = 0; i <= total_tick_num; i++) { /*one extra loop - it may not exist in the list, empty label*/ bool major = false; if(i % t->minor_cnt == 0) major = true; - /* draw a line at moving x position */ + /*draw a line at moving x position*/ p2.x = p1.x = x_ofs + (int32_t)((int32_t)(w - line_dsc.width) * i) / total_tick_num; p2.y = p1.y + (major ? t->major_len : t->minor_len); @@ -1236,7 +1236,7 @@ static void draw_x_ticks(lv_obj_t * obj, const lv_area_t * clip_area) lv_draw_line(&p1, &p2, clip_area, &line_dsc); } - /* add text only to major tick */ + /*add text only to major tick*/ if(!major || !t->label_en) continue; int32_t tick_value = i / t->minor_cnt; @@ -1244,11 +1244,11 @@ static void draw_x_ticks(lv_obj_t * obj, const lv_area_t * clip_area) dsc.value = tick_value; lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc); - /* reserve appropriate area */ + /*reserve appropriate area*/ lv_point_t size; lv_txt_get_size(&size, dsc.text, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE); - /* set the area at some distance of the major tick len under of the tick */ + /*set the area at some distance of the major tick len under of the tick*/ lv_area_t a; a.x1 = (p2.x - size.x / 2); a.x2 = (p2.x + size.x / 2), @@ -1322,7 +1322,7 @@ static void invalidate_point(lv_obj_t * obj, uint16_t i) } else if(chart->type == LV_CHART_TYPE_BAR) { lv_area_t col_a; - lv_coord_t col_w = w / ((_lv_ll_get_len(&chart->series_ll) + 1) * chart->point_cnt); /* Suppose + 1 series as separator*/ + lv_coord_t col_w = w / ((_lv_ll_get_len(&chart->series_ll) + 1) * chart->point_cnt); /*Suppose + 1 series as separator*/ lv_coord_t x_ofs = col_w / 2; /*Shift with a half col.*/ lv_coord_t x_act; diff --git a/src/widgets/lv_chart.h b/src/widgets/lv_chart.h index 597337df8..d3d2ab750 100644 --- a/src/widgets/lv_chart.h +++ b/src/widgets/lv_chart.h @@ -102,7 +102,7 @@ typedef struct { uint16_t point_cnt; /**< Point number in a data line*/ uint16_t zoom_x; uint16_t zoom_y; - lv_chart_type_t type :2; /**< Line or column chart */ + lv_chart_type_t type :2; /**< Line or column chart*/ lv_chart_update_mode_t update_mode : 1; }lv_chart_t; @@ -382,7 +382,7 @@ uint32_t lv_chart_get_pressed_point(const lv_obj_t * obj); #endif /*LV_USE_CHART*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_CHART_H*/ diff --git a/src/widgets/lv_checkbox.c b/src/widgets/lv_checkbox.c index fd86eafe7..1f703a687 100644 --- a/src/widgets/lv_checkbox.c +++ b/src/widgets/lv_checkbox.c @@ -141,7 +141,7 @@ static void lv_checkbox_destructor(lv_obj_t * obj) static lv_draw_res_t lv_checkbox_draw(lv_obj_t * obj, const lv_area_t * clip_area, lv_draw_mode_t mode) { - /* A label never covers an area */ + /*A label never covers an area*/ if(mode == LV_DRAW_MODE_COVER_CHECK) return lv_obj_draw_base(MY_CLASS, obj, clip_area, mode); else if(mode == LV_DRAW_MODE_MAIN_DRAW) { @@ -211,7 +211,7 @@ static lv_draw_res_t lv_checkbox_draw(lv_obj_t * obj, const lv_area_t * clip_are static lv_res_t lv_checkbox_signal(lv_obj_t * obj, lv_signal_t sign, void * param) { lv_res_t res; - /* Include the ancient signal function */ + /*Include the ancient signal function*/ res = lv_obj_signal_base(MY_CLASS, obj, sign, param); if(res != LV_RES_OK) return res; diff --git a/src/widgets/lv_checkbox.h b/src/widgets/lv_checkbox.h index 3f7ca747a..05bd6ce17 100644 --- a/src/widgets/lv_checkbox.h +++ b/src/widgets/lv_checkbox.h @@ -85,7 +85,7 @@ const char * lv_checkbox_get_text(const lv_obj_t * obj); #endif /*LV_USE_CHECKBOX*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_CHECKBOX_H*/ diff --git a/src/widgets/lv_dropdown.c b/src/widgets/lv_dropdown.c index 77747c2a6..c3db17047 100644 --- a/src/widgets/lv_dropdown.c +++ b/src/widgets/lv_dropdown.c @@ -204,7 +204,7 @@ void lv_dropdown_add_option(lv_obj_t * obj, const char * option, uint32_t pos) size_t ins_len = _lv_txt_ap_calc_bytes_cnt(option) + 1; #endif - size_t new_len = ins_len + old_len + 2; /* +2 for terminating NULL and possible \n */ + size_t new_len = ins_len + old_len + 2; /*+2 for terminating NULL and possible \n*/ dropdown->options = lv_mem_realloc(dropdown->options, new_len + 1); LV_ASSERT_MALLOC(dropdown->options); if(dropdown->options == NULL) return; @@ -228,7 +228,7 @@ void lv_dropdown_add_option(lv_obj_t * obj, const char * option, uint32_t pos) _lv_txt_ins(dropdown->options, _lv_txt_encoded_get_char_id(dropdown->options, insert_pos++), "\n"); /*Insert the new option, adding \n if necessary*/ - char * ins_buf = lv_mem_buf_get(ins_len + 2); /* + 2 for terminating NULL and possible \n */ + char * ins_buf = lv_mem_buf_get(ins_len + 2); /*+ 2 for terminating NULL and possible \n*/ LV_ASSERT_MALLOC(ins_buf); if(ins_buf == NULL) return; #if LV_USE_ARABIC_PERSIAN_CHARS == 0 @@ -538,7 +538,7 @@ static void lv_dropdown_constructor(lv_obj_t * obj, const lv_obj_t * copy) lv_dropdown_t * dropdown = (lv_dropdown_t *)obj; - /*Initialize the allocated 'ext' */ + /*Initialize the allocated 'ext'*/ dropdown->list = NULL; dropdown->options = NULL; dropdown->symbol = LV_SYMBOL_DOWN; @@ -736,8 +736,8 @@ static lv_draw_res_t lv_dropdown_list_draw(lv_obj_t * list_obj, const lv_area_t /*Draw the box labels if the list is not being deleted*/ if(dropdown->list) { - /* Clip area might be too large too to shadow but - * the selected option can be drawn on only the background*/ + /*Clip area might be too large too to shadow but + *the selected option can be drawn on only the background*/ lv_area_t clip_area_core; bool has_common; has_common = _lv_area_intersect(&clip_area_core, clip_area, &dropdown->list->coords); @@ -787,7 +787,7 @@ static lv_res_t lv_dropdown_signal(lv_obj_t * obj, lv_signal_t sign, void * para { lv_res_t res; - /* Include the ancient signal function */ + /*Include the ancient signal function*/ res = lv_obj_signal_base(MY_CLASS, obj, sign, param); if(res != LV_RES_OK) return res; @@ -885,7 +885,7 @@ static lv_res_t lv_dropdown_list_signal(lv_obj_t * list, lv_signal_t sign, void { lv_res_t res; - /* Include the ancient signal function */ + /*Include the ancient signal function*/ res = lv_obj_signal_base(MY_CLASS_LIST, list, sign, param); if(res != LV_RES_OK) return res; diff --git a/src/widgets/lv_dropdown.h b/src/widgets/lv_dropdown.h index 4a4c8f0c9..8c8b1c704 100644 --- a/src/widgets/lv_dropdown.h +++ b/src/widgets/lv_dropdown.h @@ -46,7 +46,7 @@ typedef struct { 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*/ - lv_dir_t dir :4; /**< Direction in which the list should open */ + 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*/ }lv_dropdown_t; @@ -251,7 +251,7 @@ void lv_dropdown_close(lv_obj_t * obj); #endif /*LV_USE_DROPDOWN*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_DROPDOWN_H*/ diff --git a/src/widgets/lv_img.c b/src/widgets/lv_img.c index 2cae38b40..aa1b6bb39 100644 --- a/src/widgets/lv_img.c +++ b/src/widgets/lv_img.c @@ -111,12 +111,12 @@ void lv_img_set_src(lv_obj_t * obj, const void * src) img->src = src; } else if(src_type == LV_IMG_SRC_FILE || src_type == LV_IMG_SRC_SYMBOL) { - /* If the new and the old src are the same then it was only a refresh.*/ + /*If the new and the old src are the same then it was only a refresh.*/ if(img->src != src) { const void * old_src = NULL; - /* If memory was allocated because of the previous `src_type` then save its pointer and free after allocation. - * It's important to allocate first to be sure the new data will be on a new address. - * Else `img_cache` wouldn't see the change in source.*/ + /*If memory was allocated because of the previous `src_type` then save its pointer and free after allocation. + *It's important to allocate first to be sure the new data will be on a new address. + *Else `img_cache` wouldn't see the change in source.*/ if(img->src_type == LV_IMG_SRC_FILE || img->src_type == LV_IMG_SRC_SYMBOL) { old_src = img->src; } @@ -382,9 +382,9 @@ static void lv_img_constructor(lv_obj_t * obj, const lv_obj_t * copy) lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE); lv_obj_add_flag(obj, LV_OBJ_FLAG_ADV_HITTEST); - /* Enable auto size for non screens - * because image screens are wallpapers - * and must be screen sized*/ + /*Enable auto size for non screens + *because image screens are wallpapers + *and must be screen sized*/ if(obj->parent) lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT); } else { @@ -421,7 +421,7 @@ static lv_draw_res_t lv_img_draw(lv_obj_t * obj, const lv_area_t * clip_area, lv /*Non true color format might have "holes"*/ if(img->cf != LV_IMG_CF_TRUE_COLOR && img->cf != LV_IMG_CF_RAW) return LV_DRAW_RES_NOT_COVER; - /*With not LV_OPA_COVER images can't cover an area */ + /*With not LV_OPA_COVER images can't cover an area*/ if(lv_obj_get_style_img_opa(obj, LV_PART_MAIN) != LV_OPA_COVER) return LV_DRAW_RES_NOT_COVER; int32_t angle_final = lv_obj_get_style_transform_angle(obj, LV_PART_MAIN); @@ -554,7 +554,7 @@ static lv_res_t lv_img_signal(lv_obj_t * obj, lv_signal_t sign, void * param) { lv_res_t res; - /* Include the ancient signal function */ + /*Include the ancient signal function*/ res = lv_obj_signal_base(MY_CLASS, obj, sign, param); if(res != LV_RES_OK) return res; @@ -575,7 +575,7 @@ static lv_res_t lv_img_signal(lv_obj_t * obj, lv_signal_t sign, void * param) lv_coord_t transf_angle = lv_obj_get_style_transform_angle(obj, LV_PART_MAIN); transf_angle += img->angle; - /*If the image has angle provide enough room for the rotated corners */ + /*If the image has angle provide enough room for the rotated corners*/ if(transf_angle || transf_zoom != LV_IMG_ZOOM_NONE) { lv_area_t a; lv_coord_t w = lv_obj_get_width(obj); @@ -596,8 +596,8 @@ static lv_res_t lv_img_signal(lv_obj_t * obj, lv_signal_t sign, void * param) lv_coord_t angle = lv_obj_get_style_transform_angle(obj, LV_PART_MAIN); angle += img->angle; - /* If the object is exactly image sized (not cropped, not mosaic) and transformed - * perform hit test on it's transformed area */ + /*If the object is exactly image sized (not cropped, not mosaic) and transformed + *perform hit test on it's transformed area*/ if(img->w == lv_obj_get_width(obj) && img->h == lv_obj_get_height(obj) && (zoom != LV_IMG_ZOOM_NONE || angle != 0 || img->pivot.x != img->w / 2 || img->pivot.y != img->h / 2)) { diff --git a/src/widgets/lv_img.h b/src/widgets/lv_img.h index 36fd717bd..4b8a8a564 100644 --- a/src/widgets/lv_img.h +++ b/src/widgets/lv_img.h @@ -188,7 +188,7 @@ bool lv_img_get_antialias(lv_obj_t * obj); #endif /*LV_USE_IMG*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_IMG_H*/ diff --git a/src/widgets/lv_label.c b/src/widgets/lv_label.c index 331f1dedf..995dfa20f 100644 --- a/src/widgets/lv_label.c +++ b/src/widgets/lv_label.c @@ -86,7 +86,7 @@ void lv_label_set_text(lv_obj_t * obj, const char * text) lv_obj_invalidate(obj); - /*If text is NULL then just refresh with the current text */ + /*If text is NULL then just refresh with the current text*/ if(text == NULL) text = label->text; if(label->text == text && label->static_txt == 0) { @@ -149,7 +149,7 @@ void lv_label_set_text_fmt(lv_obj_t * obj, const char * fmt, ...) lv_obj_invalidate(obj); lv_label_t * label = (lv_label_t *)obj; - /*If text is NULL then refresh */ + /*If text is NULL then refresh*/ if(fmt == NULL) { lv_label_refr_text(obj); return; @@ -324,7 +324,7 @@ void lv_label_get_letter_pos(const lv_obj_t * obj, uint32_t char_id, lv_point_t uint32_t byte_id = _lv_txt_encoded_get_byte_id(txt, char_id); - /*Search the line of the index letter */; + /*Search the line of the index letter*/; while(txt[new_line_start] != '\0') { new_line_start += _lv_txt_get_next_line(&txt[line_start], font, letter_space, max_w, flag); if(byte_id < new_line_start || txt[new_line_start] == '\0') @@ -422,13 +422,13 @@ uint32_t lv_label_get_letter_on(const lv_obj_t * obj, lv_point_t * pos_in) lv_text_align_t align = lv_obj_get_style_text_align(obj, LV_PART_MAIN); - /*Search the line of the index letter */; + /*Search the line of the index letter*/; while(txt[line_start] != '\0') { new_line_start += _lv_txt_get_next_line(&txt[line_start], font, letter_space, max_w, flag); if(pos.y <= y + letter_height) { /*The line is found (stored in 'line_start')*/ - /* Include the NULL terminator in the last line */ + /*Include the NULL terminator in the last line*/ uint32_t tmp = new_line_start; uint32_t letter; letter = _lv_txt_encoded_prev(txt, &tmp); @@ -469,7 +469,7 @@ uint32_t lv_label_get_letter_on(const lv_obj_t * obj, lv_point_t * pos_in) if(new_line_start > 0) { while(i + line_start < new_line_start) { - /* Get the current letter.*/ + /*Get the current letter.*/ uint32_t letter = _lv_txt_encoded_next(bidi_txt, &i); /*Get the next letter too for kerning*/ @@ -539,7 +539,7 @@ bool lv_label_is_char_under_pos(const lv_obj_t * obj, lv_point_t * pos) if(label->expand != 0) flag |= LV_TEXT_FLAG_EXPAND; if(label->long_mode == LV_LABEL_LONG_EXPAND) flag |= LV_TEXT_FLAG_FIT; - /*Search the line of the index letter */; + /*Search the line of the index letter*/; while(txt[line_start] != '\0') { new_line_start += _lv_txt_get_next_line(&txt[line_start], font, letter_space, max_w, flag); @@ -572,8 +572,8 @@ bool lv_label_is_char_under_pos(const lv_obj_t * obj, lv_point_t * pos) if(new_line_start > 0) { while(i <= new_line_start - 1) { - /* Get the current letter - * Be careful 'i' already points to the next character */ + /*Get the current letter + *Be careful 'i' already points to the next character*/ letter = _lv_txt_encoded_next(txt, &i); /*Get the next letter for kerning*/ @@ -740,7 +740,7 @@ static void lv_label_destructor(lv_obj_t * obj) static lv_draw_res_t lv_label_draw(lv_obj_t * obj, const lv_area_t * clip_area, lv_draw_mode_t mode) { - /* A label never covers an area */ + /*A label never covers an area*/ if(mode == LV_DRAW_MODE_COVER_CHECK) return LV_DRAW_RES_NOT_COVER; else if(mode == LV_DRAW_MODE_MAIN_DRAW) { @@ -776,8 +776,8 @@ static lv_draw_res_t lv_label_draw(lv_obj_t * obj, const lv_area_t * clip_area, label_draw_dsc.sel_bg_color = lv_obj_get_style_bg_color(obj, LV_PART_SELECTED); } - /* In SROLL and SROLL_CIRC mode the CENTER and RIGHT are pointless so remove them. - * (In addition they will result misalignment is this case)*/ + /*In SROLL and SROLL_CIRC mode the CENTER and RIGHT are pointless so remove them. + *(In addition they will result misalignment is this case)*/ if((label->long_mode == LV_LABEL_LONG_SCROLL || label->long_mode == LV_LABEL_LONG_SCROLL_CIRCULAR) && (align == LV_TEXT_ALIGN_CENTER || align == LV_TEXT_ALIGN_RIGHT)) { lv_point_t size; @@ -804,7 +804,7 @@ static lv_draw_res_t lv_label_draw(lv_obj_t * obj, const lv_area_t * clip_area, lv_txt_get_size(&size, label->text, label_draw_dsc.font, label_draw_dsc.letter_space, label_draw_dsc.line_space, LV_COORD_MAX, flag); - /*Draw the text again on label to the original to make an circular effect */ + /*Draw the text again on label to the original to make an circular effect*/ if(size.x > lv_area_get_width(&txt_coords)) { label_draw_dsc.ofs_x = label->offset.x + size.x + lv_font_get_glyph_width(label_draw_dsc.font, ' ', ' ') * LV_LABEL_WAIT_CHAR_COUNT; @@ -813,7 +813,7 @@ static lv_draw_res_t lv_label_draw(lv_obj_t * obj, const lv_area_t * clip_area, lv_draw_label(&txt_coords, &txt_clip, &label_draw_dsc, label->text, hint); } - /*Draw the text again below the original to make an circular effect */ + /*Draw the text again below the original to make an circular effect*/ if(size.y > lv_area_get_height(&txt_coords)) { label_draw_dsc.ofs_x = label->offset.x; label_draw_dsc.ofs_y = label->offset.y + size.y + lv_font_get_line_height(label_draw_dsc.font); @@ -839,7 +839,7 @@ static lv_res_t lv_label_signal(lv_obj_t * obj, lv_signal_t sign, void * param) { lv_res_t res; - /* Include the ancient signal function */ + /*Include the ancient signal function*/ res = lv_obj_signal_base(MY_CLASS, obj, sign, param); if(res != LV_RES_OK) return res; @@ -1172,10 +1172,10 @@ static bool lv_label_set_dot_tmp(lv_obj_t * obj, char * data, uint32_t len) { lv_label_t * label = (lv_label_t *)obj; - lv_label_dot_tmp_free(obj); /* Deallocate any existing space */ + lv_label_dot_tmp_free(obj); /*Deallocate any existing space*/ if(len > sizeof(char *)) { - /* Memory needs to be allocated. Allocates an additional byte - * for a NULL-terminator so it can be copied. */ + /*Memory needs to be allocated. Allocates an additional byte + *for a NULL-terminator so it can be copied.*/ label->dot.tmp_ptr = lv_mem_alloc(len + 1); if(label->dot.tmp_ptr == NULL) { LV_LOG_ERROR("Failed to allocate memory for dot_tmp_ptr"); @@ -1186,7 +1186,7 @@ static bool lv_label_set_dot_tmp(lv_obj_t * obj, char * data, uint32_t len) label->dot_tmp_alloc = true; } else { - /* Characters can be directly stored in object */ + /*Characters can be directly stored in object*/ label->dot_tmp_alloc = false; lv_memcpy(label->dot.tmp, data, len); } diff --git a/src/widgets/lv_label.h b/src/widgets/lv_label.h index 0fa12390d..55fa825fd 100644 --- a/src/widgets/lv_label.h +++ b/src/widgets/lv_label.h @@ -40,7 +40,7 @@ LV_EXPORT_CONST_INT(LV_LABEL_TEXT_SEL_OFF); * TYPEDEFS **********************/ -/** Long mode behaviors. Used in 'lv_label_ext_t' */ +/** Long mode behaviors. Used in 'lv_label_ext_t'*/ enum { LV_LABEL_LONG_EXPAND, /**< Expand the object size to the text size*/ LV_LABEL_LONG_WRAP, /**< Keep the object width, wrap the too long lines and expand the object height*/ @@ -55,8 +55,8 @@ typedef struct { lv_obj_t obj; char * text; union { - char * tmp_ptr; /* Pointer to the allocated memory containing the character replaced by dots*/ - char tmp[LV_LABEL_DOT_NUM + 1]; /* Directly store the characters if <=4 characters */ + char * tmp_ptr; /*Pointer to the allocated memory containing the character replaced by dots*/ + char tmp[LV_LABEL_DOT_NUM + 1]; /*Directly store the characters if <=4 characters*/ } dot; uint32_t dot_end; /*The real text length, used in dot mode*/ @@ -73,7 +73,7 @@ typedef struct { uint8_t static_txt : 1; /*Flag to indicate the text is static*/ uint8_t recolor : 1; /*Enable in-line letter re-coloring*/ uint8_t expand : 1; /*Ignore real width (used by the library with LV_LABEL_LONG_SROLL)*/ - uint8_t dot_tmp_alloc : 1; /*1: dot_tmp has been allocated;.0: dot_tmp directly holds up to 4 bytes of characters */ + uint8_t dot_tmp_alloc : 1; /*1: dot_tmp has been allocated;.0: dot_tmp directly holds up to 4 bytes of characters*/ }lv_label_t; extern const lv_obj_class_t lv_label_class; @@ -254,7 +254,7 @@ void lv_label_cut_text(lv_obj_t * obj, uint32_t pos, uint32_t cnt); #endif /*LV_USE_LABEL*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_LABEL_H*/ diff --git a/src/widgets/lv_line.c b/src/widgets/lv_line.c index 9428c9e9a..180356ecc 100644 --- a/src/widgets/lv_line.c +++ b/src/widgets/lv_line.c @@ -181,7 +181,7 @@ static lv_res_t lv_line_signal(lv_obj_t * obj, lv_signal_t sign, void * param) { lv_res_t res; - /* Include the ancient signal function */ + /*Include the ancient signal function*/ res = lv_obj_signal_base(MY_CLASS, obj, sign, param); if(res != LV_RES_OK) return res; diff --git a/src/widgets/lv_line.h b/src/widgets/lv_line.h index ca9aa065b..9636e687d 100644 --- a/src/widgets/lv_line.h +++ b/src/widgets/lv_line.h @@ -31,7 +31,7 @@ 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' */ + uint16_t point_num; /**< Number of points in 'point_array'*/ uint8_t y_inv : 1; /**< 1: y == 0 will be on the bottom*/ } lv_line_t; @@ -87,7 +87,7 @@ bool lv_line_get_y_invert(const lv_obj_t * obj); #endif /*LV_USE_LINE*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_LINE_H*/ diff --git a/src/widgets/lv_meter.c b/src/widgets/lv_meter.c index 3aee1e23b..181e7b569 100644 --- a/src/widgets/lv_meter.c +++ b/src/widgets/lv_meter.c @@ -467,7 +467,7 @@ static void draw_ticks_and_labels(lv_obj_t * obj, const lv_area_t * clip_area, c } } - /* `* 256` for extra precision*/ + /*`* 256` for extra precision*/ int32_t angle_upscale = ((i * scale->angle_range) << 8) / (scale->tick_cnt - 1); int32_t angle_low = (angle_upscale >> 8); @@ -487,14 +487,14 @@ static void draw_ticks_and_labels(lv_obj_t * obj, const lv_area_t * clip_area, c line_dsc.color = line_color; line_dsc.width = line_width; #if LV_DRAW_COMPLEX - /* Use the interpolated angle to get the outer x and y coordinates. - * Draw a little bit longer lines to be sure the mask will clip them correctly*/ + /*Use the interpolated angle to get the outer x and y coordinates. + *Draw a little bit longer lines to be sure the mask will clip them correctly*/ lv_point_t p_outer; p_outer.x = (int32_t)(((int32_t)cos_mid * (r_out + line_width) + 127) >> (LV_TRIGO_SHIFT)) + p_center.x; p_outer.y = (int32_t)(((int32_t)sin_mid * (r_out + line_width) + 127) >> (LV_TRIGO_SHIFT)) + p_center.y; lv_draw_line(&p_outer, &p_center, clip_area, &line_dsc); #else - /* Use the interpolated angle to get the outer and inner x and y coordinates.*/ + /*Use the interpolated angle to get the outer and inner x and y coordinates.*/ lv_point_t p_outer; p_outer.x = (int32_t)(((int32_t)cos_mid * (r_out) + 127) >> (LV_TRIGO_SHIFT)) + p_center.x; p_outer.y = (int32_t)(((int32_t)sin_mid * (r_out) + 127) >> (LV_TRIGO_SHIFT)) + p_center.y; diff --git a/src/widgets/lv_meter.h b/src/widgets/lv_meter.h index 783d6ae13..a187d5174 100644 --- a/src/widgets/lv_meter.h +++ b/src/widgets/lv_meter.h @@ -241,7 +241,7 @@ void lv_meter_set_indicator_end_value(lv_obj_t * obj, lv_meter_indicator_t * ind #endif /*LV_USE_METER*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_METER_H*/ diff --git a/src/widgets/lv_objx_templ.c b/src/widgets/lv_objx_templ.c index 9bc0c0dd5..2b9875bc2 100644 --- a/src/widgets/lv_objx_templ.c +++ b/src/widgets/lv_objx_templ.c @@ -3,7 +3,8 @@ * */ -/* TODO Remove these instructions +/** + * TODO Remove these instructions * Search an replace: template -> object normal name with lower case (e.g. button, label etc.) * templ -> object short name with lower case(e.g. btn, label etc) * TEMPL -> object short name with upper case (e.g. BTN, LABEL etc.) @@ -60,7 +61,7 @@ lv_obj_t * lv_templ_create(lv_obj_t * par, const lv_obj_t * copy) LV_LOG_TRACE("template create started"); /*Create the ancestor of template*/ - /*TODO modify it to the ancestor create function */ + /*TODO modify it to the ancestor create function*/ lv_obj_t * new_templ = lv_ANCESTOR_create(par, copy); LV_ASSERT_MALLOC(new_templ); if(new_templ == NULL) return NULL; @@ -76,7 +77,7 @@ lv_obj_t * lv_templ_create(lv_obj_t * par, const lv_obj_t * copy) if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_templ); if(ancestor_draw == NULL) ancestor_draw = lv_obj_get_draw_cb(new_templ); - /*Initialize the allocated 'ext' */ + /*Initialize the allocated 'ext'*/ ext->xyz = 0; /*The signal and draw functions are not copied so set them here*/ @@ -219,7 +220,7 @@ static lv_res_t lv_templ_signal(lv_obj_t * templ, lv_signal_t sign, void * param { lv_res_t res; - /* Include the ancient signal function */ + /*Include the ancient signal function*/ res = ancestor_signal(templ, sign, param); if(res != LV_RES_OK) return res; if(sign == LV_SIGNAL_GET_TYPE) return lv_obj_handle_get_type_signal(param, MY_CLASS); @@ -231,8 +232,8 @@ static lv_res_t lv_templ_signal(lv_obj_t * templ, lv_signal_t sign, void * param return res; } -#else /* Enable this file at the top */ +#else /*Enable this file at the top*/ -/* This dummy typedef exists purely to silence -Wpedantic. */ +/*This dummy typedef exists purely to silence -Wpedantic.*/ typedef int keep_pedantic_happy; #endif diff --git a/src/widgets/lv_objx_templ.h b/src/widgets/lv_objx_templ.h index bb2623a34..a5da802b8 100644 --- a/src/widgets/lv_objx_templ.h +++ b/src/widgets/lv_objx_templ.h @@ -3,7 +3,8 @@ * */ -/* TODO Remove these instructions +/** + * TODO Remove these instructions * Search an replace: template -> object normal name with lower case (e.g. button, label etc.) * templ -> object short name with lower case(e.g. btn, label etc) * TEMPL -> object short name with upper case (e.g. BTN, LABEL etc.) @@ -36,7 +37,7 @@ extern "C" { /*Data of template*/ typedef struct { lv_ANCESTOR_ext_t ANCESTOR; /*Ext. of ancestor*/ - /*New data for this type */ + /*New data for this type*/ } lv_templ_ext_t; /*Styles*/ @@ -97,7 +98,7 @@ lv_style_t * lv_templ_get_style(const lv_obj_t * templ, lv_templ_style_t type); #endif /*LV_USE_TEMPL*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_TEMPL_H*/ diff --git a/src/widgets/lv_roller.c b/src/widgets/lv_roller.c index c58927dc4..ec19c132f 100644 --- a/src/widgets/lv_roller.c +++ b/src/widgets/lv_roller.c @@ -150,9 +150,9 @@ void lv_roller_set_selected(lv_obj_t * obj, uint16_t sel_opt, lv_anim_enable_t a { LV_ASSERT_OBJ(obj, MY_CLASS); - /* Set the value even if it's the same as the current value because - * if moving to the next option with an animation which was just deleted in the PRESS signal - * nothing will continue the animation. */ + /*Set the value even if it's the same as the current value because + *if moving to the next option with an animation which was just deleted in the PRESS signal + *nothing will continue the animation.*/ lv_roller_t * roller = (lv_roller_t*)obj; @@ -161,9 +161,9 @@ void lv_roller_set_selected(lv_obj_t * obj, uint16_t sel_opt, lv_anim_enable_t a int32_t sel_opt_signed = sel_opt; uint16_t page = roller->sel_opt_id / LV_ROLLER_INF_PAGES; - /* `sel_opt` should be less than the number of options set by the user. - * If it's more then probably it's a reference from not the first page - * so normalize `sel_opt` */ + /*`sel_opt` should be less than the number of options set by the user. + *If it's more then probably it's a reference from not the first page + *so normalize `sel_opt`*/ if(page != 0) { sel_opt_signed -= page * LV_ROLLER_INF_PAGES; } @@ -410,8 +410,8 @@ static lv_draw_res_t lv_roller_label_draw(lv_obj_t * label_obj, const lv_area_t } /*Draw the object*/ else if(mode == LV_DRAW_MODE_MAIN_DRAW) { - /* Split the drawing of the label into an upper (above the selected area) - * and a lower (below the selected area)*/ + /*Split the drawing of the label into an upper (above the selected area) + *and a lower (below the selected area)*/ lv_obj_t * roller = lv_obj_get_parent(label_obj); const lv_font_t * font = lv_obj_get_style_text_font(roller, LV_PART_MAIN); lv_coord_t line_space = lv_obj_get_style_text_line_space(roller, LV_PART_MAIN); @@ -452,7 +452,7 @@ static lv_res_t lv_roller_signal(lv_obj_t * obj, lv_signal_t sign, void * param) { lv_res_t res; - /* Include the ancient signal function */ + /*Include the ancient signal function*/ res = lv_obj_signal_base(MY_CLASS, obj, sign, param); if(res != LV_RES_OK) return res; @@ -557,7 +557,7 @@ static lv_res_t lv_roller_label_signal(lv_obj_t * label, lv_signal_t sign, void { lv_res_t res; - /* Include the ancient signal function */ + /*Include the ancient signal function*/ res = lv_obj_signal_base(MY_CLASS_LABEL, label, sign, param); if(res != LV_RES_OK) return res; @@ -604,8 +604,8 @@ static void refr_position(lv_obj_t * obj, lv_anim_enable_t anim_en) lv_coord_t h = lv_obj_get_height_fit(obj); uint16_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 do it manually*/ + /*Normally the animation's `end_cb` sets correct position of the roller if infinite. + *But without animations do it manually*/ if(anim_en == LV_ANIM_OFF || anim_time == 0) { inf_normalize(obj); } diff --git a/src/widgets/lv_roller.h b/src/widgets/lv_roller.h index 031d211cf..5c303d289 100644 --- a/src/widgets/lv_roller.h +++ b/src/widgets/lv_roller.h @@ -28,10 +28,10 @@ extern "C" { * TYPEDEFS **********************/ -/** Roller mode. */ +/** Roller mode.*/ enum { - LV_ROLLER_MODE_NORMAL, /**< Normal mode (roller ends at the end of the options). */ - LV_ROLLER_MODE_INFINITE, /**< Infinite mode (roller can be scrolled forever). */ + LV_ROLLER_MODE_NORMAL, /**< Normal mode (roller ends at the end of the options).*/ + LV_ROLLER_MODE_INFINITE, /**< Infinite mode (roller can be scrolled forever).*/ }; typedef uint8_t lv_roller_mode_t; @@ -129,7 +129,7 @@ uint16_t lv_roller_get_option_cnt(const lv_obj_t * obj); #endif /*LV_USE_ROLLER*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_ROLLER_H*/ diff --git a/src/widgets/lv_slider.c b/src/widgets/lv_slider.c index ad1b04609..d1cccbfbd 100644 --- a/src/widgets/lv_slider.c +++ b/src/widgets/lv_slider.c @@ -79,7 +79,7 @@ static void lv_slider_constructor(lv_obj_t * obj, const lv_obj_t * copy) { lv_slider_t * slider = (lv_slider_t *)obj; - /*Initialize the allocated 'slider' */ + /*Initialize the allocated 'slider'*/ slider->value_to_set = NULL; slider->dragging = 0; slider->left_knob_focus = 0; @@ -106,8 +106,8 @@ static lv_draw_res_t lv_slider_draw(lv_obj_t * obj, const lv_area_t * clip_area, } /*Draw the object*/ else if(mode == LV_DRAW_MODE_MAIN_DRAW) { - /* The ancestor draw function will draw the background and the indicator. - * It also sets slider->bar.indic_area*/ + /*The ancestor draw function will draw the background and the indicator. + *It also sets slider->bar.indic_area*/ lv_obj_draw_base(MY_CLASS, obj, clip_area, mode); draw_knob(obj, clip_area); @@ -125,21 +125,21 @@ static lv_res_t lv_slider_signal(lv_obj_t * obj, lv_signal_t sign, void * param) { lv_res_t res; - /* Include the ancient signal function */ + /*Include the ancient signal function*/ res = lv_obj_signal_base(MY_CLASS, obj, sign, param); if(res != LV_RES_OK) return res; lv_slider_t * slider = (lv_slider_t *)obj; lv_slider_type_t type = lv_slider_get_type(obj); - /* Advanced hit testing: react only on dragging the knob(s) */ + /*Advanced hit testing: react only on dragging the knob(s)*/ if(sign == LV_SIGNAL_HIT_TEST) { lv_hit_test_info_t * info = param; - /* Ordinary slider: was the knob area hit? */ + /*Ordinary slider: was the knob area hit?*/ info->result = _lv_area_is_point_on(&slider->right_knob_area, info->point, 0); - /* There's still a change we have a hit, if we have another knob */ + /*There's still a change we have a hit, if we have another knob*/ if((info->result == false) && (type == LV_SLIDER_TYPE_RANGE)) { info->result = _lv_area_is_point_on(&slider->left_knob_area, info->point, 0); } @@ -166,11 +166,11 @@ static lv_res_t lv_slider_signal(lv_obj_t * obj, lv_signal_t sign, void * param) slider->value_to_set = &slider->bar.start_value; } else { - /* Calculate the distance from each knob */ + /*Calculate the distance from each knob*/ dist_left = LV_ABS((slider->left_knob_area.x1 + (slider->left_knob_area.x2 - slider->left_knob_area.x1) / 2) - p.x); dist_right = LV_ABS((slider->right_knob_area.x1 + (slider->right_knob_area.x2 - slider->right_knob_area.x1) / 2) - p.x); - /* Use whichever one is closer */ + /*Use whichever one is closer*/ if(dist_right < dist_left) { slider->value_to_set = &slider->bar.cur_value; slider->left_knob_focus = 0; @@ -189,11 +189,11 @@ static lv_res_t lv_slider_signal(lv_obj_t * obj, lv_signal_t sign, void * param) slider->value_to_set = &slider->bar.start_value; } else { - /* Calculate the distance from each knob */ + /*Calculate the distance from each knob*/ dist_left = LV_ABS((slider->left_knob_area.y1 + (slider->left_knob_area.y2 - slider->left_knob_area.y1) / 2) - p.y); dist_right = LV_ABS((slider->right_knob_area.y1 + (slider->right_knob_area.y2 - slider->right_knob_area.y1) / 2) - p.y); - /* Use whichever one is closer */ + /*Use whichever one is closer*/ if(dist_right < dist_left) { slider->value_to_set = &slider->bar.cur_value; slider->left_knob_focus = 0; @@ -245,7 +245,7 @@ static lv_res_t lv_slider_signal(lv_obj_t * obj, lv_signal_t sign, void * param) } - /* Figure out the min. and max. for this mode */ + /*Figure out the min. and max. for this mode*/ if(slider->value_to_set == &slider->bar.start_value) { real_max_value = slider->bar.cur_value; } @@ -267,7 +267,7 @@ static lv_res_t lv_slider_signal(lv_obj_t * obj, lv_signal_t sign, void * param) slider->dragging = false; slider->value_to_set = NULL; - /*Leave edit mode if released. (No need to wait for LONG_PRESS) */ + /*Leave edit mode if released. (No need to wait for LONG_PRESS)*/ lv_group_t * g = lv_obj_get_group(obj); bool editing = lv_group_get_editing(g); lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act()); @@ -294,8 +294,8 @@ static lv_res_t lv_slider_signal(lv_obj_t * obj, lv_signal_t sign, void * param) } } else if(sign == LV_SIGNAL_COORD_CHG) { - /* The knob size depends on slider size. - * During the drawing method the obj. size is used by the knob so refresh the obj. size.*/ + /*The knob size depends on slider size. + *During the drawing method the obj. size is used by the knob so refresh the obj. size.*/ if(lv_obj_get_width(obj) != lv_area_get_width(param) || lv_obj_get_height(obj) != lv_area_get_height(param)) { lv_obj_refresh_ext_draw_size(obj); @@ -307,7 +307,7 @@ static lv_res_t lv_slider_signal(lv_obj_t * obj, lv_signal_t sign, void * param) lv_coord_t knob_top = lv_obj_get_style_pad_top(obj, LV_PART_KNOB); lv_coord_t knob_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_KNOB); - /* The smaller size is the knob diameter*/ + /*The smaller size is the knob diameter*/ lv_coord_t trans_w = lv_obj_get_style_transform_width(obj, LV_PART_MAIN); lv_coord_t trans_h = lv_obj_get_style_transform_height(obj, LV_PART_MAIN); lv_coord_t knob_size = LV_MIN(lv_obj_get_width(obj) + 2 * trans_w, lv_obj_get_height(obj) + 2 * trans_h) >> 1; @@ -413,7 +413,7 @@ static void draw_knob(lv_obj_t * obj, const lv_area_t * clip_area) lv_draw_rect(&slider->right_knob_area, clip_area, &knob_rect_dsc); lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc); - /* Draw a second knob for the start_value side */ + /*Draw a second knob for the start_value side*/ if(hor) { knob_area.x1 = LV_SLIDER_KNOB_COORD(hor, base_dir != LV_BIDI_DIR_RTL, slider->bar.indic_area); } diff --git a/src/widgets/lv_slider.h b/src/widgets/lv_slider.h index dc9d45974..1eec5599d 100644 --- a/src/widgets/lv_slider.h +++ b/src/widgets/lv_slider.h @@ -44,7 +44,7 @@ typedef struct { lv_bar_t bar; /*Add the ancestor's type first*/ lv_area_t left_knob_area; lv_area_t right_knob_area; - int16_t * value_to_set; /* Which bar value to set */ + int16_t * value_to_set; /*Which bar value to set*/ uint8_t dragging : 1; /*1: the slider is being dragged*/ uint8_t left_knob_focus : 1; /*1: with encoder now the right knob can be adjusted*/ }lv_slider_t; @@ -182,7 +182,7 @@ static inline lv_slider_type_t lv_slider_get_type(lv_obj_t * slider) #endif /*LV_USE_SLIDER*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_SLIDER_H*/ diff --git a/src/widgets/lv_switch.c b/src/widgets/lv_switch.c index 76075fb2e..fcc16180d 100644 --- a/src/widgets/lv_switch.c +++ b/src/widgets/lv_switch.c @@ -170,7 +170,7 @@ static lv_res_t lv_switch_signal(lv_obj_t * obj, lv_signal_t sign, void * param) { lv_res_t res; - /* Include the ancient signal function */ + /*Include the ancient signal function*/ res = lv_obj_signal_base(MY_CLASS, obj, sign, param); if(res != LV_RES_OK) return res; @@ -181,7 +181,7 @@ static lv_res_t lv_switch_signal(lv_obj_t * obj, lv_signal_t sign, void * param) lv_coord_t knob_top = lv_obj_get_style_pad_top(obj, LV_PART_KNOB); lv_coord_t knob_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_KNOB); - /* The smaller size is the knob diameter*/ + /*The smaller size is the knob diameter*/ lv_coord_t knob_size = LV_MIN(lv_obj_get_width(obj), lv_obj_get_height(obj)) >> 1; knob_size += LV_MAX(LV_MAX(knob_left, knob_right), LV_MAX(knob_bottom, knob_top)); knob_size += 2; /*For rounding error*/ diff --git a/src/widgets/lv_switch.h b/src/widgets/lv_switch.h index 52fb8f325..c226a13ca 100644 --- a/src/widgets/lv_switch.h +++ b/src/widgets/lv_switch.h @@ -59,7 +59,7 @@ lv_obj_t * lv_switch_create(lv_obj_t * parent, const lv_obj_t * copy); #endif /*LV_USE_SWITCH*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_SWITCH_H*/ diff --git a/src/widgets/lv_table.c b/src/widgets/lv_table.c index be147d762..ace8c6390 100644 --- a/src/widgets/lv_table.c +++ b/src/widgets/lv_table.c @@ -130,7 +130,7 @@ void lv_table_set_cell_value_fmt(lv_obj_t * obj, uint16_t row, uint16_t col, con va_start(ap, fmt); va_copy(ap2, ap); - /*Allocate space for the new text by using trick from C99 standard section 7.19.6.12 */ + /*Allocate space for the new text by using trick from C99 standard section 7.19.6.12*/ uint32_t len = lv_vsnprintf(NULL, 0, fmt, ap); va_end(ap); @@ -164,7 +164,7 @@ void lv_table_set_cell_value_fmt(lv_obj_t * obj, uint16_t row, uint16_t col, con return; } - table->cell_data[cell][len + 1] = 0; /* Ensure NULL termination */ + table->cell_data[cell][len + 1] = 0; /*Ensure NULL termination*/ lv_vsnprintf(&table->cell_data[cell][1], len + 1, fmt, ap2); #endif @@ -401,7 +401,7 @@ static void lv_table_constructor(lv_obj_t * obj, const lv_obj_t * copy) lv_table_t * table = (lv_table_t *)obj; - /*Initialize the allocated 'ext' */ + /*Initialize the allocated 'ext'*/ table->cell_data = NULL; table->col_cnt = 0; table->row_cnt = 0; @@ -648,7 +648,7 @@ static lv_res_t lv_table_signal(lv_obj_t * obj, lv_signal_t sign, void * param) { lv_res_t res; - /* Include the ancient signal function */ + /*Include the ancient signal function*/ res = lv_obj_signal_base(MY_CLASS, obj, sign, param); if(res != LV_RES_OK) return res; diff --git a/src/widgets/lv_table.h b/src/widgets/lv_table.h index e5f2c097f..cc11f89e8 100644 --- a/src/widgets/lv_table.h +++ b/src/widgets/lv_table.h @@ -197,7 +197,7 @@ void lv_table_get_selected_cell(lv_obj_t * obj, uint16_t * row, uint16_t * col); #endif /*LV_USE_TABLE*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_TABLE_H*/ diff --git a/src/widgets/lv_textarea.c b/src/widgets/lv_textarea.c index dc62bd55e..3f1953ede 100644 --- a/src/widgets/lv_textarea.c +++ b/src/widgets/lv_textarea.c @@ -150,7 +150,7 @@ void lv_textarea_add_char(lv_obj_t * obj, uint32_t c) lv_textarea_clear_selection(obj); /*Clear selection*/ if(ta->pwd_mode != 0) { - ta->pwd_tmp = lv_mem_realloc(ta->pwd_tmp, strlen(ta->pwd_tmp) + strlen(letter_buf) + 1); /*+2: the new char + \0 */ + ta->pwd_tmp = lv_mem_realloc(ta->pwd_tmp, strlen(ta->pwd_tmp) + strlen(letter_buf) + 1); /*+2: the new char + \0*/ LV_ASSERT_MALLOC(ta->pwd_tmp); if(ta->pwd_tmp == NULL) return; @@ -906,7 +906,7 @@ void lv_textarea_cursor_down(lv_obj_t * obj) /*Get the letter index on the new cursor position and set it*/ uint32_t new_cur_pos = lv_label_get_letter_on(ta->label, &pos); - lv_coord_t cur_valid_x_tmp = ta->cursor.valid_x; /*Cursor position set overwrites the valid position */ + lv_coord_t cur_valid_x_tmp = ta->cursor.valid_x; /*Cursor position set overwrites the valid position*/ lv_textarea_set_cursor_pos(obj, new_cur_pos); ta->cursor.valid_x = cur_valid_x_tmp; } @@ -935,7 +935,7 @@ void lv_textarea_cursor_up(lv_obj_t * obj) /*Get the letter index on the new cursor position and set it*/ uint32_t new_cur_pos = lv_label_get_letter_on(ta->label, &pos); - lv_coord_t cur_valid_x_tmp = ta->cursor.valid_x; /*Cursor position set overwrites the valid position */ + lv_coord_t cur_valid_x_tmp = ta->cursor.valid_x; /*Cursor position set overwrites the valid position*/ lv_textarea_set_cursor_pos(obj, new_cur_pos); ta->cursor.valid_x = cur_valid_x_tmp; } @@ -1051,7 +1051,7 @@ static lv_draw_res_t lv_textarea_draw(lv_obj_t * obj, const lv_area_t * clip_are static lv_res_t lv_textarea_signal(lv_obj_t * obj, lv_signal_t sign, void * param) { lv_res_t res; - /* Include the ancient signal function */ + /*Include the ancient signal function*/ res = lv_obj_signal_base(MY_CLASS, obj, sign, param); if(res != LV_RES_OK) return res; @@ -1402,7 +1402,7 @@ static void update_cursor_position_on_click(lv_obj_t * obj, lv_signal_t sign, lv lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN); } else if(ta->text_sel_in_prog && sign == LV_SIGNAL_PRESSING) { - /*Input device may be moving. Store the end position */ + /*Input device may be moving. Store the end position*/ ta->sel_end = char_id_at_click; } else if(ta->text_sel_in_prog && (sign == LV_SIGNAL_PRESS_LOST || sign == LV_SIGNAL_RELEASED)) { @@ -1438,7 +1438,7 @@ static void update_cursor_position_on_click(lv_obj_t * obj, lv_signal_t sign, lv lv_obj_invalidate(obj); } } - /*Finish selection if necessary */ + /*Finish selection if necessary*/ if(sign == LV_SIGNAL_PRESS_LOST || sign == LV_SIGNAL_RELEASED) { ta->text_sel_in_prog = 0; } diff --git a/src/widgets/lv_textarea.h b/src/widgets/lv_textarea.h index 390a8443f..39f56c1c1 100644 --- a/src/widgets/lv_textarea.h +++ b/src/widgets/lv_textarea.h @@ -44,24 +44,24 @@ typedef struct { char * pwd_tmp; /*Used to store the original text 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 '*' */ + uint16_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)*/ - uint32_t pos; /* The current cursor position - * (0: before 1st letter; 1: before 2nd letter ...)*/ - lv_area_t area; /* Cursor area relative to the Text Area*/ - uint32_t txt_byte_pos; /* Byte index of the letter after (on) the cursor*/ - uint8_t show : 1; /*Cursor is visible now or not (Handled by the library)*/ + lv_coord_t valid_x; /*Used when stepping up/down to a shorter line. + *(Used by the library)*/ + uint32_t pos; /*The current cursor position + *(0: before 1st letter; 1: before 2nd letter ...)*/ + lv_area_t area; /*Cursor area relative to the Text Area*/ + uint32_t txt_byte_pos; /*Byte index of the letter after (on) the cursor*/ + uint8_t show : 1; /*Cursor is visible now or not (Handled by the library)*/ uint8_t click_pos : 1; /*1: Enable positioning the cursor by clicking the text area*/ } cursor; #if LV_LABEL_TEXT_SEL uint32_t sel_start; /*Temporary values for text selection*/ uint32_t sel_end; - uint8_t text_sel_in_prog : 1; /*User is in process of selecting */ + uint8_t text_sel_in_prog : 1; /*User is in process of selecting*/ uint8_t text_sel_en : 1; /*Text can be selected on this text area*/ #endif - uint8_t pwd_mode : 1; /*Replace characters with '*' */ + uint8_t pwd_mode : 1; /*Replace characters with '*'*/ uint8_t one_line : 1; /*One line mode (ignore line breaks)*/ } lv_textarea_t; @@ -343,7 +343,7 @@ void lv_textarea_cursor_up(lv_obj_t * ta); #endif /*LV_USE_TEXTAREA_H*/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_TEXTAREA_H*/ diff --git a/tests/lv_test_assert.c b/tests/lv_test_assert.c index b8b2eef15..4098c355c 100644 --- a/tests/lv_test_assert.c +++ b/tests/lv_test_assert.c @@ -247,7 +247,7 @@ static void read_png_file(png_img_t * p, const char* file_name) { char header[8]; // 8 is the maximum size that can be checked - /* open file and test for it being a png */ + /*open file and test for it being a png*/ FILE *fp = fopen(file_name, "rb"); if (!fp) lv_test_exit("[read_png_file] File %s could not be opened for reading", file_name); @@ -255,7 +255,7 @@ static void read_png_file(png_img_t * p, const char* file_name) if (rcnt != 8 || png_sig_cmp((png_const_bytep)header, 0, 8)) lv_test_exit("[read_png_file] File %s is not recognized as a PNG file", file_name); - /* initialize stuff */ + /*initialize stuff*/ p->png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if (!p->png_ptr) @@ -281,7 +281,7 @@ static void read_png_file(png_img_t * p, const char* file_name) p->number_of_passes = png_set_interlace_handling(p->png_ptr); png_read_update_info(p->png_ptr, p->info_ptr); - /* read file */ + /*read file*/ if (setjmp(png_jmpbuf(p->png_ptr))) lv_test_exit("[read_png_file] Error during read_image"); @@ -299,13 +299,13 @@ static void read_png_file(png_img_t * p, const char* file_name) // //static void write_png_file(png_img_t * p, const char* file_name) //{ -// /* create file */ +// /*create file*/ // FILE *fp = fopen(file_name, "wb"); // if (!fp) // lv_test_exit("[write_png_file] File %s could not be opened for writing", file_name); // // -// /* initialize stuff */ +// /*initialize stuff*/ // p->png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); // // if (!p->png_ptr) @@ -321,7 +321,7 @@ static void read_png_file(png_img_t * p, const char* file_name) // png_init_io(p->png_ptr, fp); // // -// /* write header */ +// /*write header*/ // if (setjmp(png_jmpbuf(p->png_ptr))) // lv_test_exit("[write_png_file] Error during writing header"); // @@ -332,14 +332,14 @@ static void read_png_file(png_img_t * p, const char* file_name) // png_write_info(p->png_ptr, p->info_ptr); // // -// /* write bytes */ +// /*write bytes*/ // if (setjmp(png_jmpbuf(p->png_ptr))) // lv_test_exit("[write_png_file] Error during writing bytes"); // // png_write_image(p->png_ptr, p->row_pointers); // // -// /* end write */ +// /*end write*/ // if (setjmp(png_jmpbuf(p->png_ptr))) // lv_test_exit("[write_png_file] Error during end of write"); // @@ -374,7 +374,7 @@ static void png_release(png_img_t * p) // printf("Pixel at position [ %d - %d ] has RGBA values: %d - %d - %d - %d\n", // x, y, ptr[0], ptr[1], ptr[2], ptr[3]); // -// /* set red value to 0 and green value to the blue one */ +// /*set red value to 0 and green value to the blue one*/ // ptr[0] = 0; // ptr[1] = ptr[2]; // } diff --git a/tests/lv_test_assert.h b/tests/lv_test_assert.h index 8d006ecf4..044856dad 100644 --- a/tests/lv_test_assert.h +++ b/tests/lv_test_assert.h @@ -47,7 +47,7 @@ void lv_test_assert_array_eq(const uint8_t *p_ref, const uint8_t *p_act, int32_t **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_TEST_ASSERT_H*/ diff --git a/tests/lv_test_conf.h b/tests/lv_test_conf.h index 9f8263691..a1e855705 100644 --- a/tests/lv_test_conf.h +++ b/tests/lv_test_conf.h @@ -36,7 +36,7 @@ typedef void * lv_user_data_t; **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_TEST_CONF_H*/ diff --git a/tests/lv_test_core/lv_test_core.h b/tests/lv_test_core/lv_test_core.h index 239b018e8..84a5d5c8a 100644 --- a/tests/lv_test_core/lv_test_core.h +++ b/tests/lv_test_core/lv_test_core.h @@ -32,7 +32,7 @@ void lv_test_core(void); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_TEST_CORE_H*/ diff --git a/tests/lv_test_core/lv_test_font_loader.h b/tests/lv_test_core/lv_test_font_loader.h index 25aebc06e..e683eaf56 100644 --- a/tests/lv_test_core/lv_test_font_loader.h +++ b/tests/lv_test_core/lv_test_font_loader.h @@ -32,7 +32,7 @@ void lv_test_font_loader(void); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_TEST_FONT_LOADER_H*/ diff --git a/tests/lv_test_core/lv_test_obj.h b/tests/lv_test_core/lv_test_obj.h index 60c229767..3e3430c19 100644 --- a/tests/lv_test_core/lv_test_obj.h +++ b/tests/lv_test_core/lv_test_obj.h @@ -32,7 +32,7 @@ void lv_test_obj(void); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_TEST_OBJ_H*/ diff --git a/tests/lv_test_core/lv_test_style.h b/tests/lv_test_core/lv_test_style.h index 401124661..44d4a8948 100644 --- a/tests/lv_test_core/lv_test_style.h +++ b/tests/lv_test_core/lv_test_style.h @@ -32,7 +32,7 @@ void lv_test_style(void); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_TEST_STYLE_H*/ diff --git a/tests/lv_test_main.c b/tests/lv_test_main.c index 79d1dc3b5..cfe5f4478 100644 --- a/tests/lv_test_main.c +++ b/tests/lv_test_main.c @@ -107,12 +107,12 @@ static void hal_init(void) static lv_fs_drv_t drv; lv_fs_drv_init(&drv); /*Basic initialization*/ - drv.letter = 'F'; /*An uppercase letter to identify the drive */ - drv.open_cb = open_cb; /*Callback to open a file */ - drv.close_cb = close_cb; /*Callback to close a file */ - drv.read_cb = read_cb; /*Callback to read a file */ - drv.seek_cb = seek_cb; /*Callback to seek in a file (Move cursor) */ - drv.tell_cb = tell_cb; /*Callback to tell the cursor position */ + drv.letter = 'F'; /*An uppercase letter to identify the drive*/ + drv.open_cb = open_cb; /*Callback to open a file*/ + drv.close_cb = close_cb; /*Callback to close a file*/ + drv.read_cb = read_cb; /*Callback to read a file*/ + drv.seek_cb = seek_cb; /*Callback to seek in a file (Move cursor)*/ + drv.tell_cb = tell_cb; /*Callback to tell the cursor position*/ lv_fs_drv_register(&drv); /*Finally register the drive*/ } diff --git a/tests/lv_test_widgets/lv_test_label.h b/tests/lv_test_widgets/lv_test_label.h index 36aac4e5e..a20ff7ad1 100644 --- a/tests/lv_test_widgets/lv_test_label.h +++ b/tests/lv_test_widgets/lv_test_label.h @@ -32,7 +32,7 @@ void lv_test_label(void); **********************/ #ifdef __cplusplus -} /* extern "C" */ +} /*extern "C"*/ #endif #endif /*LV_TEST_CONT_H*/