plugins: HAVE_BACKLIGHT in the test plugins

Change-Id: I97d17805ac7d37f10da6a29684102db97448e653
This commit is contained in:
Solomon Peachy 2020-07-24 19:42:32 -04:00
parent 9be5bc4cf0
commit e49c1af570
5 changed files with 22 additions and 8 deletions

View file

@ -274,8 +274,9 @@ static int fill_buffer(int new_offset){
{
log_text("Read failed.",true);
DEBUGF("read fail: got %d bytes, expected %d\n", (int)n, (int)audiobufsize);
#ifdef HAVE_BACKLIGHT
rb->backlight_on();
#endif
if (fd >= 0)
{
rb->close(fd);
@ -723,7 +724,9 @@ static enum plugin_status test_track(const char* filename)
/* Be sure it is done */
rb->codec_thread_do_callback(NULL, NULL);
#ifdef HAVE_BACKLIGHT
rb->backlight_on();
#endif
log_text(str,true);
if (codec_action == CODEC_ACTION_HALT)
@ -771,8 +774,9 @@ static enum plugin_status test_track(const char* filename)
res = PLUGIN_OK;
exit:
#ifdef HAVE_BACKLIGHT
rb->backlight_on();
#endif
if (fd >= 0)
{
rb->close(fd);

View file

@ -467,8 +467,10 @@ enum plugin_status plugin_start(const void* parameter)
rb->srand(*rb->current_tick);
#ifdef HAVE_BACKLIGHT
/* Turn off backlight timeout */
backlight_ignore_timeout();
#endif
while(!quit)
{
@ -487,8 +489,9 @@ enum plugin_status plugin_start(const void* parameter)
}
/* Turn on backlight timeout (revert to settings) */
#ifdef HAVE_BACKLIGHT
backlight_use_settings();
#endif
rb->rmdir(testbasedir);
return PLUGIN_OK;

View file

@ -401,8 +401,9 @@ enum plugin_status plugin_start(const void* parameter)
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
cpu_freq = *rb->cpu_frequency; /* remember CPU frequency */
#endif
#ifdef HAVE_BACKLIGHT
backlight_ignore_timeout();
#endif
time_main_update();
rb->sleep(HZ);
#if defined(HAVE_LCD_COLOR) && (MEMORYSIZE > 2)
@ -423,8 +424,9 @@ enum plugin_status plugin_start(const void* parameter)
(cpu_freq + 500000) / 1000000);
log_text(str);
#endif
#ifdef HAVE_BACKLIGHT
backlight_use_settings();
#endif
/* wait until user closes plugin */
plugin_quit();

View file

@ -495,8 +495,9 @@ enum plugin_status plugin_start(const void* parameter)
rb->lcd_set_backdrop(NULL);
rb->lcd_clear_display();
#endif
#ifdef HAVE_BACKLIGHT
backlight_ignore_timeout();
#endif
rb->splashf(0, "LCD driver performance test, please wait %d sec",
7*4*DURATION/HZ);
init_rand_table();
@ -521,7 +522,9 @@ enum plugin_status plugin_start(const void* parameter)
(cpu_freq + 500000) / 1000000);
#endif
rb->close(log_fd);
#ifdef HAVE_BACKLIGHT
backlight_use_settings();
#endif
#ifdef TEST_GREYLIB
grey_release();
#endif

View file

@ -123,9 +123,9 @@ enum plugin_status plugin_start(const void* parameter)
}
for (i = 0; i <= STEPS; i++)
input_levels[i] = lcd_levels[i] = (255 * i + (STEPS/2)) / STEPS;
#ifdef HAVE_BACKLIGHT
backlight_ignore_timeout();
#endif
grey_set_background(0); /* set background to black */
grey_clear_display();
grey_show(true);
@ -221,6 +221,8 @@ enum plugin_status plugin_start(const void* parameter)
}
grey_release();
#ifdef HAVE_BACKLIGHT
backlight_use_settings();
#endif
return PLUGIN_OK;
}