Skip to content

Commit 19e72db

Browse files
committed
Merge branch 'contrib/github_pr_558' into 'master'
refactor: simplify the callback handling of multi-click (GitHub PR) Closes AEGHB-1174 See merge request ae_group/esp-iot-solution!1349
2 parents 761e635 + 80af98a commit 19e72db

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

components/button/iot_button.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,7 @@ static void button_handler(button_dev_t *btn)
191191
/** Calling the callbacks for MULTIPLE BUTTON CLICKS */
192192
for (int i = 0; i < btn->size[btn->event]; i++) {
193193
if (btn->repeat == btn->cb_info[btn->event][i].event_args.multiple_clicks.clicks) {
194-
do {
195-
btn->cb_info[btn->event][i].cb(btn, btn->cb_info[btn->event][i].usr_data);
196-
i++;
197-
if (i >= btn->size[btn->event]) {
198-
break;
199-
}
200-
} while (btn->cb_info[btn->event][i].event_args.multiple_clicks.clicks == btn->repeat);
194+
btn->cb_info[btn->event][i].cb(btn, btn->cb_info[btn->event][i].usr_data);
201195
}
202196
}
203197

0 commit comments

Comments
 (0)