/* Change Logs: Date Author Notes  tanek first version This function will put STM32F4xx into sleep mode. */
static void sleep(struct rt_pm *pm, uint8_t mode)
/* Change Logs: Date Author Notes  tanek first version This function will put STM32F4xx into sleep mode. */
static void sleep(struct rt_pm *pm, uint8_t mode)
{
    switch (mode)
    {
    case PM_SLEEP_MODE_NONE:
        break;
    case PM_SLEEP_MODE_IDLE:
        break;
    case PM_SLEEP_MODE_LIGHT:
        HAL_SuspendTick();
        HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI);
        break;
    case PM_SLEEP_MODE_DEEP:
        HAL_SuspendTick();
        HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
        break;
    case PM_SLEEP_MODE_STANDBY:
        break;
    case PM_SLEEP_MODE_SHUTDOWN:
        break;
    default:
        RT_ASSERT(0);
        break;
    }
}