~aleteoryx/muditaos

a61fb7a0e2a3cc4be290bed0727f6d4f10681800 — Lukasz Mastalerz 2 years ago 1fdf5dc
[MOS-1014] Screen remains black after turning off the phone with dark mode enabled

Regression fixed by adjusting wipeout function.
M module-bsp/board/rt1051/bsp/eink/ED028TC1.cpp => module-bsp/board/rt1051/bsp/eink/ED028TC1.cpp +2 -4
@@ 960,10 960,8 @@ EinkStatus_e EinkFillScreenWithColor(EinkDisplayColorFilling_e colorFill)

    BSP_EinkWriteCS(BSP_Eink_CS_Set);

    EinkRefreshImage(EinkFrame_t{0, 0, BOARD_EINK_DISPLAY_RES_X, BOARD_EINK_DISPLAY_RES_Y},
                     EinkDisplayTimingsDeepCleanMode);

    return EinkOK;
    return EinkRefreshImage(EinkFrame_t{0, 0, BOARD_EINK_DISPLAY_RES_X, BOARD_EINK_DISPLAY_RES_Y},
                            EinkDisplayTimingsDeepCleanMode);
}

EinkStatus_e EinkRefreshImage(EinkFrame_t frame, EinkDisplayTimingsMode_e refreshTimingsMode)

M module-bsp/board/rt1051/bsp/eink/EinkDisplay.cpp => module-bsp/board/rt1051/bsp/eink/EinkDisplay.cpp +2 -1
@@ 273,7 273,8 @@ namespace hal::eink

    EinkStatus EinkDisplay::wipeOut()
    {
        if (const auto status = reinitAndPowerOn(); status != EinkStatus::EinkOK) {
        if (const auto status = prepareDisplay(EinkRefreshMode::REFRESH_DEEP, WaveformTemperature::KEEP_CURRENT);
            status != EinkStatus::EinkOK) {
            return status;
        }
        return translateStatus(EinkFillScreenWithColor(EinkDisplayColorFilling_e::EinkDisplayColorWhite));

M module-services/service-eink/ServiceEink.cpp => module-services/service-eink/ServiceEink.cpp +3 -4
@@ 117,14 117,13 @@ namespace service::eink

    sys::ReturnCodes ServiceEink::DeinitHandler()
    {
        // Eink must be turned on before wiping out the display
        display->reinitAndPowerOn();

        if ((exitAction == ExitAction::WipeOut) ||
            ((display->getMode() == hal::eink::EinkDisplayColorMode::EinkDisplayColorModeInverted) &&
             (systemCloseReason != sys::CloseReason::FactoryReset))) {
            LOG_INFO("Performing low-level display wipeout");
            display->wipeOut();
            if (const auto status = display->wipeOut(); status != hal::eink::EinkStatus::EinkOK) {
                LOG_ERROR("Low-level display wipeout failed");
            }
        }

        display->shutdown();