esp-iot-solution icon indicating copy to clipboard operation
esp-iot-solution copied to clipboard

Button supports two instances in one app? (AEGHB-802)

Open mike-2020 opened this issue 1 year ago • 2 comments

Answers checklist.

  • [X] I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • [X] I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • [X] I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

Many internal variables of "button" are defined as static global variables. So, want to confirm if I can create two button instances in my app? one is for GPIO button, one is for ADC button.

mike-2020 avatar Sep 06 '24 09:09 mike-2020

you can create any number of button for any types

lijunru-hub avatar Sep 06 '24 12:09 lijunru-hub

In such case, multiple "button" instances share the same timer, right?

mike-2020 avatar Sep 06 '24 12:09 mike-2020

the polling of multiple buttons is handled through a single timer.

lijunru-hub avatar Oct 16 '24 03:10 lijunru-hub