示例#1
0
/* plugin entry point */
enum plugin_status plugin_start(const void* parameter)
{
#ifndef SIMULATOR
    char str[32];
    int cpu_freq;
#endif

    /* standard stuff */
    PLUGIN_IRAM_INIT(rb)
    (void)parameter;
    
    log_init();
#ifndef SIMULATOR
    cpu_freq = *rb->cpu_frequency; /* remember CPU frequency */
#endif
    backlight_force_on(); /* backlight control in lib/helper.c */

    log_text("Main LCD Update");
    time_main_update();
#if defined(HAVE_LCD_COLOR) && (MEMORYSIZE > 2)
    log_text("Main LCD YUV");
    time_main_yuv();
#endif
#if LCD_DEPTH < 4
    log_text("Greyscale library");
    time_greyscale();
#endif
#ifdef HAVE_REMOTE_LCD
    log_text("Remote LCD Update");
    time_remote_update();
#endif

#ifndef SIMULATOR
    if (*rb->cpu_frequency != cpu_freq)
        rb->snprintf(str, sizeof(str), "CPU clock changed!");
    else
        rb->snprintf(str, sizeof(str), "CPU: %d MHz",
                     (cpu_freq + 500000) / 1000000);
    log_text(str);
#endif
    backlight_use_settings(); /* backlight control in lib/helper.c */

    /* wait until user closes plugin */
    while (rb->button_get(true) != FPS_QUIT);

    return PLUGIN_OK;
}
示例#2
0
文件: test_fps.c 项目: 4nykey/rockbox
/* plugin entry point */
enum plugin_status plugin_start(const void* parameter)
{
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
    char str[32];
    int cpu_freq;
#endif

    /* standard stuff */
    (void)parameter;
    
#ifdef HAVE_TOUCHSCREEN
    rb->touchscreen_set_mode(rb->global_settings->touch_mode);
#endif

    log_init();
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
    cpu_freq = *rb->cpu_frequency; /* remember CPU frequency */
#endif
    backlight_ignore_timeout();

    time_main_update();
    rb->sleep(HZ);
#if defined(HAVE_LCD_COLOR) && (MEMORYSIZE > 2)
    time_main_yuv();
#endif
#if LCD_DEPTH < 4
    time_greyscale();
#endif
#ifdef HAVE_REMOTE_LCD
    time_remote_update();
#endif

#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
    if (*rb->cpu_frequency != cpu_freq)
        rb->snprintf(str, sizeof(str), "CPU clock changed!");
    else
        rb->snprintf(str, sizeof(str), "CPU: %d MHz",
                     (cpu_freq + 500000) / 1000000);
    log_text(str);
#endif
    backlight_use_settings();

    /* wait until user closes plugin */
    plugin_quit();

    return PLUGIN_OK;
}