Esempio n. 1
0
bool loadSplash(void)
{
    const char *topSplashFile = "splash.bin",
               *bottomSplashFile = "splashbottom.bin";

    bool isTopSplashValid = getFileSize(topSplashFile) == SCREEN_TOP_FBSIZE,
         isBottomSplashValid = getFileSize(bottomSplashFile) == SCREEN_BOTTOM_FBSIZE,
         ret;

    //Don't delay boot nor init the screens if no splash images or invalid splash images are on the SD
    if(!isTopSplashValid && !isBottomSplashValid) ret = false;
    else
    {
        initScreens();
        clearScreens(true, true, true);

        if(isTopSplashValid) isTopSplashValid = fileRead(fbs[1].top_left, topSplashFile, SCREEN_TOP_FBSIZE) == SCREEN_TOP_FBSIZE;
        if(isBottomSplashValid) isBottomSplashValid = fileRead(fbs[1].bottom, bottomSplashFile, SCREEN_BOTTOM_FBSIZE) == SCREEN_BOTTOM_FBSIZE;

        if(!isTopSplashValid && !isBottomSplashValid) ret = false;
        else
        {
            swapFramebuffers(true);

            chrono(3);

            ret = true;
        }
    }

    return ret;
}
Esempio n. 2
0
void initScreens(void)
{
    static bool needToSetup = true;

    if(needToSetup)
    {
        memcpy((void *)ARM11_PARAMETERS_ADDRESS, fbs, sizeof(fbs));
        invokeArm11Function(SETUP_FRAMEBUFFERS);

        if(!ARESCREENSINITIALIZED)
        {
            *(vu32 *)ARM11_PARAMETERS_ADDRESS = brightness[MULTICONFIG(BRIGHTNESS)];
            invokeArm11Function(INIT_SCREENS);

            //Turn on backlight
            i2cWriteRegister(I2C_DEV_MCU, 0x22, 0x2A);
        }
        else updateBrightness(MULTICONFIG(BRIGHTNESS));

        clearScreens(true);
        needToSetup = false;
    }

    clearScreens(false);
    swapFramebuffers(false);
}