return
if suspended:
return
- if type == 1 and code != 330:
+ if typ == 1 and code != 330:
# EV_KEY but not BTN_TOUCH
alert.stopall()
display.on()
wake_all(down_cnt, moment, typ, code, value)
def wake_toggle(down_cnt, moment, typ, code, value):
- global state, last_set, enable_suspend, suspended
+ global state, last_set, enable_suspend, suspended, alert
if suspended:
return
# ignore down, just get up
if typ != 1 or value:
return
+ alert.stopall()
if ( state == "full" or state == "disable" ) and get_ticks() - last_set > 0.5:
enable_suspend = True
last_set = 0