Skip to content

Commit 9771050

Browse files
committed
chore(format) add formatting for examples & demos, merge test config
1 parent ba38a4b commit 9771050

File tree

85 files changed

+2454
-2404
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+2454
-2404
lines changed

demos/benchmark/lv_demo_benchmark.c

+135-127
Large diffs are not rendered by default.

demos/keypad_encoder/lv_demo_keypad_encoder.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static void ta_event_cb(lv_event_t * e);
3131
/**********************
3232
* STATIC VARIABLES
3333
**********************/
34-
static lv_group_t* g;
34+
static lv_group_t * g;
3535
static lv_obj_t * tv;
3636
static lv_obj_t * t1;
3737
static lv_obj_t * t2;
@@ -49,18 +49,18 @@ void lv_demo_keypad_encoder(void)
4949
g = lv_group_create();
5050
lv_group_set_default(g);
5151

52-
lv_indev_t* cur_drv = NULL;
53-
for (;;) {
52+
lv_indev_t * cur_drv = NULL;
53+
for(;;) {
5454
cur_drv = lv_indev_get_next(cur_drv);
55-
if (!cur_drv) {
55+
if(!cur_drv) {
5656
break;
5757
}
5858

59-
if (cur_drv->driver->type == LV_INDEV_TYPE_KEYPAD) {
59+
if(cur_drv->driver->type == LV_INDEV_TYPE_KEYPAD) {
6060
lv_indev_set_group(cur_drv, g);
6161
}
6262

63-
if (cur_drv->driver->type == LV_INDEV_TYPE_ENCODER) {
63+
if(cur_drv->driver->type == LV_INDEV_TYPE_ENCODER) {
6464
lv_indev_set_group(cur_drv, g);
6565
}
6666
}
@@ -152,7 +152,7 @@ static void text_input_create(lv_obj_t * parent)
152152
lv_textarea_set_one_line(ta2, true);
153153
lv_textarea_set_placeholder_text(ta2, "Type something");
154154

155-
lv_obj_t *kb = lv_keyboard_create(lv_scr_act());
155+
lv_obj_t * kb = lv_keyboard_create(lv_scr_act());
156156
lv_obj_add_flag(kb, LV_OBJ_FLAG_HIDDEN);
157157

158158
lv_obj_add_event_cb(ta1, ta_event_cb, LV_EVENT_ALL, kb);

demos/lv_demos.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ extern "C" {
1616
#include "../lvgl.h"
1717

1818
#if LV_USE_DEMO_WIDGETS
19-
#include "widgets/lv_demo_widgets.h"
19+
#include "widgets/lv_demo_widgets.h"
2020
#endif
2121

2222
#if LV_USE_DEMO_BENCHMARK
23-
#include "benchmark/lv_demo_benchmark.h"
23+
#include "benchmark/lv_demo_benchmark.h"
2424
#endif
2525

2626
#if LV_USE_DEMO_STRESS
27-
#include "stress/lv_demo_stress.h"
27+
#include "stress/lv_demo_stress.h"
2828
#endif
2929

3030
#if LV_USE_DEMO_KEYPAD_AND_ENCODER
31-
#include "keypad_encoder/lv_demo_keypad_encoder.h"
31+
#include "keypad_encoder/lv_demo_keypad_encoder.h"
3232
#endif
3333

3434
#if LV_USE_DEMO_MUSIC
35-
#include "music/lv_demo_music.h"
35+
#include "music/lv_demo_music.h"
3636
#endif
3737

3838
/*********************

demos/music/lv_demo_music.c

+82-82
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* STATIC PROTOTYPES
2626
**********************/
2727
#if LV_DEMO_MUSIC_AUTO_PLAY
28-
static void auto_step_cb(lv_timer_t * timer);
28+
static void auto_step_cb(lv_timer_t * timer);
2929
#endif
3030

3131
/**********************
@@ -87,20 +87,20 @@ static const char * genre_list[] = {
8787
};
8888

8989
static const uint32_t time_list[] = {
90-
1*60 + 14,
91-
2*60 + 26,
92-
1*60 + 54,
93-
2*60 + 24,
94-
2*60 + 37,
95-
3*60 + 33,
96-
1*60 + 56,
97-
3*60 + 31,
98-
2*60 + 20,
99-
2*60 + 19,
100-
2*60 + 20,
101-
2*60 + 19,
102-
2*60 + 20,
103-
2*60 + 19,
90+
1 * 60 + 14,
91+
2 * 60 + 26,
92+
1 * 60 + 54,
93+
2 * 60 + 24,
94+
2 * 60 + 37,
95+
3 * 60 + 33,
96+
1 * 60 + 56,
97+
3 * 60 + 31,
98+
2 * 60 + 20,
99+
2 * 60 + 19,
100+
2 * 60 + 20,
101+
2 * 60 + 19,
102+
2 * 60 + 20,
103+
2 * 60 + 19,
104104
};
105105

106106
/**********************
@@ -166,84 +166,84 @@ static void auto_step_cb(lv_timer_t * t)
166166
#endif
167167

168168
switch(state) {
169-
case 5:
170-
_lv_demo_music_album_next(true);
171-
break;
172-
173-
case 6:
174-
_lv_demo_music_album_next(true);
175-
break;
176-
case 7:
177-
_lv_demo_music_album_next(true);
178-
break;
179-
case 8:
180-
_lv_demo_music_play(0);
181-
break;
169+
case 5:
170+
_lv_demo_music_album_next(true);
171+
break;
172+
173+
case 6:
174+
_lv_demo_music_album_next(true);
175+
break;
176+
case 7:
177+
_lv_demo_music_album_next(true);
178+
break;
179+
case 8:
180+
_lv_demo_music_play(0);
181+
break;
182182
#if LV_DEMO_MUSIC_SQUARE || LV_DEMO_MUSIC_ROUND
183-
case 11:
184-
lv_obj_scroll_by(ctrl, 0, -LV_VER_RES, LV_ANIM_ON);
185-
break;
186-
case 13:
187-
lv_obj_scroll_by(ctrl, 0, -LV_VER_RES, LV_ANIM_ON);
188-
break;
183+
case 11:
184+
lv_obj_scroll_by(ctrl, 0, -LV_VER_RES, LV_ANIM_ON);
185+
break;
186+
case 13:
187+
lv_obj_scroll_by(ctrl, 0, -LV_VER_RES, LV_ANIM_ON);
188+
break;
189189
#else
190-
case 12:
191-
lv_obj_scroll_by(ctrl, 0, -LV_VER_RES, LV_ANIM_ON);
192-
break;
190+
case 12:
191+
lv_obj_scroll_by(ctrl, 0, -LV_VER_RES, LV_ANIM_ON);
192+
break;
193193
#endif
194-
case 15:
195-
lv_obj_scroll_by(list, 0, -300, LV_ANIM_ON);
196-
break;
197-
case 16:
198-
lv_obj_scroll_by(list, 0, 300, LV_ANIM_ON);
199-
break;
200-
case 18:
201-
_lv_demo_music_play(1);
202-
break;
203-
case 19:
204-
lv_obj_scroll_by(ctrl, 0, LV_VER_RES, LV_ANIM_ON);
205-
break;
194+
case 15:
195+
lv_obj_scroll_by(list, 0, -300, LV_ANIM_ON);
196+
break;
197+
case 16:
198+
lv_obj_scroll_by(list, 0, 300, LV_ANIM_ON);
199+
break;
200+
case 18:
201+
_lv_demo_music_play(1);
202+
break;
203+
case 19:
204+
lv_obj_scroll_by(ctrl, 0, LV_VER_RES, LV_ANIM_ON);
205+
break;
206206
#if LV_DEMO_MUSIC_SQUARE || LV_DEMO_MUSIC_ROUND
207-
case 20:
208-
lv_obj_scroll_by(ctrl, 0, LV_VER_RES, LV_ANIM_ON);
209-
break;
207+
case 20:
208+
lv_obj_scroll_by(ctrl, 0, LV_VER_RES, LV_ANIM_ON);
209+
break;
210210
#endif
211-
case 30:
212-
_lv_demo_music_play(2);
213-
break;
214-
case 40: {
215-
lv_obj_t * bg = lv_layer_top();
216-
lv_obj_set_style_bg_color(bg, lv_color_hex(0x6f8af6), 0);
217-
lv_obj_set_style_text_color(bg, lv_color_white(), 0);
218-
lv_obj_set_style_bg_opa(bg, LV_OPA_COVER, 0);
219-
lv_obj_fade_in(bg, 400, 0);
220-
lv_obj_t * dsc = lv_label_create(bg);
221-
lv_obj_set_style_text_font(dsc, font_small, 0);
222-
lv_label_set_text(dsc, "The average FPS is");
223-
lv_obj_align(dsc, LV_ALIGN_TOP_MID, 0, 90);
224-
225-
lv_obj_t * num = lv_label_create(bg);
226-
lv_obj_set_style_text_font(num, font_large, 0);
211+
case 30:
212+
_lv_demo_music_play(2);
213+
break;
214+
case 40: {
215+
lv_obj_t * bg = lv_layer_top();
216+
lv_obj_set_style_bg_color(bg, lv_color_hex(0x6f8af6), 0);
217+
lv_obj_set_style_text_color(bg, lv_color_white(), 0);
218+
lv_obj_set_style_bg_opa(bg, LV_OPA_COVER, 0);
219+
lv_obj_fade_in(bg, 400, 0);
220+
lv_obj_t * dsc = lv_label_create(bg);
221+
lv_obj_set_style_text_font(dsc, font_small, 0);
222+
lv_label_set_text(dsc, "The average FPS is");
223+
lv_obj_align(dsc, LV_ALIGN_TOP_MID, 0, 90);
224+
225+
lv_obj_t * num = lv_label_create(bg);
226+
lv_obj_set_style_text_font(num, font_large, 0);
227227
#if LV_USE_PERF_MONITOR
228-
lv_label_set_text_fmt(num, "%d", lv_refr_get_fps_avg());
228+
lv_label_set_text_fmt(num, "%d", lv_refr_get_fps_avg());
229229
#endif
230-
lv_obj_align(num, LV_ALIGN_TOP_MID, 0, 120);
230+
lv_obj_align(num, LV_ALIGN_TOP_MID, 0, 120);
231231

232-
lv_obj_t * attr = lv_label_create(bg);
233-
lv_obj_set_style_text_align(attr, LV_TEXT_ALIGN_CENTER, 0);
234-
lv_obj_set_style_text_font(attr, font_small, 0);
232+
lv_obj_t * attr = lv_label_create(bg);
233+
lv_obj_set_style_text_align(attr, LV_TEXT_ALIGN_CENTER, 0);
234+
lv_obj_set_style_text_font(attr, font_small, 0);
235235
#if LV_DEMO_MUSIC_SQUARE || LV_DEMO_MUSIC_ROUND
236-
lv_label_set_text(attr, "Copyright 2020 LVGL Kft.\nwww.lvgl.io | [email protected]");
236+
lv_label_set_text(attr, "Copyright 2020 LVGL Kft.\nwww.lvgl.io | [email protected]");
237237
#else
238-
lv_label_set_text(attr, "Copyright 2020 LVGL Kft. | www.lvgl.io | [email protected]");
238+
lv_label_set_text(attr, "Copyright 2020 LVGL Kft. | www.lvgl.io | [email protected]");
239239
#endif
240-
lv_obj_align(attr, LV_ALIGN_BOTTOM_MID, 0, -10);
241-
break;
242-
}
243-
case 41:
244-
lv_scr_load(lv_obj_create(NULL));
245-
_lv_demo_music_pause();
246-
break;
240+
lv_obj_align(attr, LV_ALIGN_BOTTOM_MID, 0, -10);
241+
break;
242+
}
243+
case 41:
244+
lv_scr_load(lv_obj_create(NULL));
245+
_lv_demo_music_pause();
246+
break;
247247
}
248248
state++;
249249
}

demos/music/lv_demo_music_list.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ lv_obj_t * _lv_demo_music_list_create(lv_obj_t * parent)
102102

103103
lv_style_init(&style_artist);
104104
lv_style_set_text_font(&style_artist, font_small);
105-
lv_style_set_text_color(&style_artist,lv_color_hex(0xb1b0be));
105+
lv_style_set_text_color(&style_artist, lv_color_hex(0xb1b0be));
106106

107107
lv_style_init(&style_time);
108108
lv_style_set_text_font(&style_time, font_medium);

0 commit comments

Comments
 (0)