enable light-sleep functionality

This commit is contained in:
microDev 2020-12-31 02:22:20 +05:30
parent 28ce5e8988
commit b83bdc540d
No known key found for this signature in database
GPG Key ID: 2C0867BE60967730
1 changed files with 2 additions and 6 deletions

View File

@ -84,12 +84,8 @@ void alarm_touch_touchalarm_set_alarm(const bool deep_sleep, const size_t n_alar
for (size_t i = 0; i < n_alarms; i++) {
if (MP_OBJ_IS_TYPE(alarms[i], &alarm_touch_touchalarm_type)) {
if (!touch_alarm_set) {
if (deep_sleep) {
touch_alarm = MP_OBJ_TO_PTR(alarms[i]);
touch_alarm_set = true;
} else {
mp_raise_NotImplementedError(translate("TouchAlarm not available in light sleep"));
}
touch_alarm = MP_OBJ_TO_PTR(alarms[i]);
touch_alarm_set = true;
} else {
mp_raise_ValueError(translate("Only one alarm.touch alarm can be set."));
}