Skip to content

Commit 2c08b63

Browse files
committed
vfx: lcd: update flush_period & peak_delay
1 parent a0967d6 commit 2c08b63

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

main/src/user/vfx.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static void vfx_task(void *pvParameter)
127127
uint16_t color_l = vfx.lightness;
128128
fft_config_t *fft = NULL;
129129
uint16_t fft_out[64] = {0};
130-
const uint16_t flush_period = 20;
130+
const uint16_t flush_period = 16;
131131

132132
xEventGroupClearBits(user_event_group, VFX_FFT_IDLE_BIT);
133133

@@ -226,7 +226,7 @@ static void vfx_task(void *pvParameter)
226226
fft_config_t *fft = NULL;
227227
uint16_t fft_out[64] = {0};
228228
uint16_t center_y = vfx_disp_height % 2 ? vfx_disp_height / 2 : vfx_disp_height / 2 - 1;
229-
const uint16_t flush_period = 20;
229+
const uint16_t flush_period = 16;
230230

231231
xEventGroupClearBits(user_event_group, VFX_FFT_IDLE_BIT);
232232

@@ -346,9 +346,9 @@ static void vfx_task(void *pvParameter)
346346
static uint8_t vu_peak_value[24] = {0};
347347
static uint8_t vu_peak_delay[24] = {0};
348348
static uint8_t vu_drop_delay[24] = {0};
349-
const uint8_t vu_peak_delay_init = 18;
350-
const uint8_t vu_drop_delay_init = 2;
351-
const uint16_t flush_period = 20;
349+
const uint16_t vu_peak_delay_cnt = 20;
350+
const uint16_t vu_drop_delay_cnt = 2;
351+
const uint16_t flush_period = 16;
352352

353353
xEventGroupClearBits(user_event_group, VFX_FFT_IDLE_BIT);
354354

@@ -357,8 +357,8 @@ static void vfx_task(void *pvParameter)
357357

358358
gdispGSetBacklight(vfx_gdisp, vfx.backlight);
359359

360-
memset(vu_peak_delay, vu_peak_delay_init - 1, sizeof(vu_peak_delay));
361-
memset(vu_drop_delay, vu_drop_delay_init - 1, sizeof(vu_drop_delay));
360+
memset(vu_peak_delay, vu_peak_delay_cnt - 1, sizeof(vu_peak_delay));
361+
memset(vu_drop_delay, vu_drop_delay_cnt - 1, sizeof(vu_drop_delay));
362362

363363
memset(vfx_fft_input, 0x00, sizeof(vfx_fft_input));
364364
fft = fft_init(FFT_N, FFT_REAL, FFT_FORWARD, vfx_fft_input, vfx_fft_output);
@@ -396,20 +396,20 @@ static void vfx_task(void *pvParameter)
396396
if (vu_peak_delay[i]-- == 0) {
397397
vu_peak_delay[i] = 0;
398398
if (vu_drop_delay[i]-- == 0) {
399-
vu_drop_delay[i] = vu_drop_delay_init - 1;
399+
vu_drop_delay[i] = vu_drop_delay_cnt - 1;
400400
vu_peak_value[i]--;
401401
}
402402
}
403403
if (vu_peak_value[i] <= vu_val_out) {
404404
vu_peak_value[i] = vu_val_out;
405-
vu_peak_delay[i] = vu_peak_delay_init - 1 + vu_peak_delay[i] % vu_drop_delay_init;
405+
vu_peak_delay[i] = vu_peak_delay_cnt - 1 + vu_peak_delay[i] % vu_drop_delay_cnt;
406406
}
407407
if (vu_peak_value[i] != vu_val_out) {
408-
gdispGFillArea(vfx_gdisp, i*vu_width+1, (vu_val_max-vu_peak_value[i])*vu_height+1, vu_width-2, vu_height-2, Black);
408+
gdispGFillArea(vfx_gdisp, i * vu_width + 1, (vu_val_max - vu_peak_value[i]) * vu_height + 1, vu_width - 2, vu_height - 2, Black);
409409
}
410410

411411
uint32_t peak_color = hsl2rgb(432 / 511.0, 1.0, color_l / 511.0);
412-
gdispGFillArea(vfx_gdisp, i*vu_width+1, (vu_val_max-vu_peak_value[i])*vu_height+1, vu_width-2, vu_height-2, peak_color);
412+
gdispGFillArea(vfx_gdisp, i * vu_width + 1, (vu_val_max - vu_peak_value[i]) * vu_height + 1, vu_width - 2, vu_height - 2, peak_color);
413413

414414
color_h = 0;
415415
for (int8_t j = vu_val_max; j >= vu_val_min; j--) {
@@ -421,10 +421,10 @@ static void vfx_task(void *pvParameter)
421421

422422
if (j > vu_val_out || ((j == 0) && (vu_val_out == 0))) {
423423
// upside
424-
gdispGFillArea(vfx_gdisp, i*vu_width+1, (vu_val_max-j)*vu_height+1, vu_width-2, vu_height-2, Black);
424+
gdispGFillArea(vfx_gdisp, i * vu_width + 1, (vu_val_max - j) * vu_height + 1, vu_width - 2, vu_height - 2, Black);
425425
} else {
426426
// underside
427-
gdispGFillArea(vfx_gdisp, i*vu_width+1, (vu_val_max-j)*vu_height+1, vu_width-2, vu_height-2, pixel_color);
427+
gdispGFillArea(vfx_gdisp, i * vu_width + 1, (vu_val_max - j) * vu_height + 1, vu_width - 2, vu_height - 2, pixel_color);
428428
}
429429

430430
color_h += vu_step;

0 commit comments

Comments
 (0)