/* This function enables and puts the MCU in sleep mode.  */
static fsp_err_t lpm_mode_enter(uint8_t lpm_mode, lpm_instance_ctrl_t *const p_current_ctrl)
/* This function enables and puts the MCU in sleep mode.  */
static fsp_err_t lpm_mode_enter(uint8_t lpm_mode, lpm_instance_ctrl_t *const p_current_ctrl)
{
    fsp_err_t err = FSP_SUCCESS;
    switch (lpm_mode)
    {
    case SW_STANDBY_STATE:
        err = R_LPM_LowPowerModeEnter(p_current_ctrl);
        break;
    case SLEEP_STATE:
        err = R_LPM_LowPowerModeEnter(p_current_ctrl);
        break;
    case SW_STANDBY_SNOOZE_STATE:
        err = R_LPM_LowPowerModeEnter(p_current_ctrl);
        break;
    default:
        err = FSP_ERR_INVALID_MODE;
        break;
    }
    return err;
}