mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-25 20:26:41 +00:00
Prevent creation of multiple antiburn tasks #134
This commit is contained in:
parent
886a394421
commit
3587e8be8c
@ -182,12 +182,12 @@ void hasp_set_antiburn(int32_t repeat_count, uint32_t period)
|
|||||||
if(!layer) return;
|
if(!layer) return;
|
||||||
|
|
||||||
if(repeat_count != 0) {
|
if(repeat_count != 0) {
|
||||||
antiburn_task = lv_task_create(hasp_antiburn_cb, period, LV_TASK_PRIO_LOWEST, NULL);
|
if(!antiburn_task) antiburn_task = lv_task_create(hasp_antiburn_cb, period, LV_TASK_PRIO_LOWEST, NULL);
|
||||||
if(antiburn_task) {
|
if(antiburn_task) {
|
||||||
// hasp_set_wakeup_touch(true);
|
|
||||||
lv_obj_set_event_cb(layer, first_touch_event_handler);
|
lv_obj_set_event_cb(layer, first_touch_event_handler);
|
||||||
lv_obj_set_click(layer, true);
|
lv_obj_set_click(layer, true);
|
||||||
lv_task_set_repeat_count(antiburn_task, repeat_count);
|
lv_task_set_repeat_count(antiburn_task, repeat_count);
|
||||||
|
lv_task_set_period(antiburn_task, period);
|
||||||
dispatch_state_antiburn(HASP_EVENT_ON);
|
dispatch_state_antiburn(HASP_EVENT_ON);
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO(TAG_HASP, F("Antiburn %s"), D_INFO_FAILED);
|
LOG_INFO(TAG_HASP, F("Antiburn %s"), D_INFO_FAILED);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user