Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(demo): minor fix for benchmark #3114

Merged
merged 1 commit into from Feb 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions demos/benchmark/lv_demo_benchmark.c
Expand Up @@ -602,7 +602,7 @@ static lv_obj_t * subtitle;
static uint32_t rnd_act;


static uint32_t rnd_map[] = {
static const uint32_t rnd_map[] = {
0xbd13204f, 0x67d8167f, 0x20211c99, 0xb0a7cc05,
0x06d5c703, 0xeafb01a7, 0xd0473b5c, 0xc999aaa2,
0x86f9d5d9, 0x294bdb29, 0x12a3c207, 0x78914d14,
Expand Down Expand Up @@ -631,7 +631,7 @@ static uint32_t rnd_map[] = {

static void benchmark_init(void)
{
lv_disp_t * disp = lv_disp_get_next(NULL);
lv_disp_t * disp = lv_disp_get_default();
disp->driver->monitor_cb = monitor_cb;

lv_obj_t * scr = lv_scr_act();
Expand Down Expand Up @@ -763,7 +763,7 @@ static void generate_report(void)

row++;
char buf[256];
for(i = 0; i < sizeof(scenes) / sizeof(scene_dsc_t) - 1; i++) {
for(i = 0; scenes[i].create_cb; i++) {

if(scenes[i].fps_normal < 20 && scenes[i].weight >= 10) {
lv_table_set_cell_value(table, row, 0, scenes[i].name);
Expand Down Expand Up @@ -808,7 +808,7 @@ static void generate_report(void)
// lv_table_set_cell_type(table, row, 0, 4);
row++;

for(i = 0; i < sizeof(scenes) / sizeof(scene_dsc_t) - 1; i++) {
for(i = 0; scenes[i].create_cb; i++) {
lv_table_set_cell_value(table, row, 0, scenes[i].name);

lv_snprintf(buf, sizeof(buf), "%"LV_PRIu32, scenes[i].fps_normal);
Expand Down Expand Up @@ -862,7 +862,7 @@ static void report_cb(lv_timer_t * timer)
if(scenes[scene_act].create_cb) scene_act++; /*If still there are scenes go to the next*/
}
else {
scene_act ++;
scene_act++;
}
opa_mode = false;
}
Expand Down Expand Up @@ -936,7 +936,7 @@ static void scene_next_task_cb(lv_timer_t * timer)
if(scenes[scene_act].create_cb) scene_act++; /*If still there are scenes go to the next*/
}
else {
scene_act ++;
scene_act++;
}
opa_mode = false;
}
Expand All @@ -948,7 +948,7 @@ static void scene_next_task_cb(lv_timer_t * timer)

if(scenes[scene_act].create_cb) {
lv_label_set_text_fmt(title, "%"LV_PRId32"/%d: %s%s", scene_act * 2 + (opa_mode ? 1 : 0),
(sizeof(scenes) / sizeof(scene_dsc_t) * 2) - 2, scenes[scene_act].name, opa_mode ? " + opa" : "");
(dimof(scenes) * 2) - 2, scenes[scene_act].name, opa_mode ? " + opa" : "");
kisvegabor marked this conversation as resolved.
Show resolved Hide resolved
if(opa_mode) {
lv_label_set_text_fmt(subtitle, "Result of \"%s\": %"LV_PRId32" FPS", scenes[scene_act].name,
scenes[scene_act].fps_normal);
Expand Down Expand Up @@ -1040,7 +1040,7 @@ static void line_create(lv_style_t * style)
uint32_t j;
for(j = 1; j < LINE_POINT_NUM; j++) {
points[i][j].x = points[i][j - 1].x + rnd_next(LINE_POINT_DIFF_MIN, LINE_POINT_DIFF_MAX);
points[i][j].y = rnd_next(LINE_POINT_DIFF_MIN, LINE_POINT_DIFF_MAX) ;
points[i][j].y = rnd_next(LINE_POINT_DIFF_MIN, LINE_POINT_DIFF_MAX);
}


Expand Down