2021-04-06 03:46 AM
Hello! I try to make powersaving mode for my device. So i should power off all chips on my board. I use TouchGFX with external RAM and QSPI and CMSIS OS v2. How could I reinit TouchGFX? I posted my code below. All is working, when powerups, but after calling function EnterSleepMode()->WakeUp() display enables, but there is no image. What's wrong with it?
void WakeUp()
{
power_state = power_ON;
TouchGFXTaskHandle = osThreadNew(StartTouchGFXTask, NULL, &TouchGFXTask_attributes);
}
void EnterSleepMode()
{
power_state = power_SLEEP;
POWER_TIM->Instance->CR1 &= ~TIM_CR1_CEN;
PWMLCD_BLEN_STOP();
LTDC_LCD_POWEROFF;
osThreadTerminate(TouchGFXTaskHandle);
HAL_LTDC_DeInit(&hltdc);
HAL_SDRAM_DeInit(&hsdram1);
HAL_QSPI_DeInit(&hqspi);
HAL_DMA2D_DeInit(&hdma2d);
SleepGPIOConfig();
PS_POWER_3V3_1_OFF;
PS_POWER_3V3_2_OFF;
}
void StartTouchGFXTask(void *argument)
{
/* USER CODE BEGIN StartTouchGFXTask */
PS_POWER_3V3_1_ON;
PS_POWER_3V3_2_ON;
MX_GPIO_Init();
MX_FMC_Init();
MX_LTDC_Init();
MX_QUADSPI_Init();
MX_DMA2D_Init();
MX_TouchGFX_Init();
SCREEN_INIT();
ms_for_LCD_EN = HAL_GetTick();
MX_TouchGFX_Process();
/* Infinite loop */
for(;;)
{
osDelay(1);
}
}