mauriciobarroso / button Goto Github PK
View Code? Open in Web Editor NEWESP-IDF component to drive multiple instances of tactile switches buttons
License: MIT License
ESP-IDF component to drive multiple instances of tactile switches buttons
License: MIT License
Thank you for sharing this component. Do you happen to have any example usage code? If not, I can help create some for quicker usage.
Hello, I am trying to use your component and am encountering strange behavior.
When I use "button_init" more than once, I get the error E(343) gpio: gpio_install_isr_service(498): GPIO isr service is already installed
.
The callback is triggered only by the last initialized button.
What's wrong?
I (313) button: Initializing button component...
I (323) gpio: GPIO[9]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:2
I (333) button: Initializing button component...
I (333) gpio: GPIO[8]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:2
E (343) gpio: gpio_install_isr_service(498): GPIO isr service already installed
I (353) button: Initializing button component...
I (363) gpio: GPIO[7]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:2
E (373) gpio: gpio_install_isr_service(498): GPIO isr service already installed
I (373) button: Adding callback for button...
I (383) button: Adding callback for button...
I (383) button: Adding callback for button...
I button: button 7 pressed for 190 ms
I (18243) button: BUTTON_SHORT_PRESS_BIT set
Button 3 single click
I button: button 9 pressed for 420 ms
I button: button 9 pressed for 200 ms
I button: button 8 pressed for 170 ms
I button: button 8 pressed for 160 ms
I button: button 7 pressed for 220 ms
I (55083) button: BUTTON_SHORT_PRESS_BIT set
Button 3 single click
I button: button 7 pressed for 210 ms
I (56813) button: BUTTON_SHORT_PRESS_BIT set
Button 3 single click
The code snippet is attached below:
button_t button1;
button_t button2;
button_t button3;
ESP_ERROR_CHECK(button_init(&button1,
BUTTON_DEC_PIN,
BUTTON_EDGE_FALLING,
tskIDLE_PRIORITY + 11,
configMINIMAL_STACK_SIZE * 4));
ESP_ERROR_CHECK(button_init(&button2,
BUTTON_INC_PIN,
BUTTON_EDGE_FALLING,
tskIDLE_PRIORITY + 11,
configMINIMAL_STACK_SIZE * 4));
ESP_ERROR_CHECK(button_init(&button3,
BUTTON_PREV_PIN,
BUTTON_EDGE_FALLING,
tskIDLE_PRIORITY + 11,
configMINIMAL_STACK_SIZE * 4));
button_add_cb(&button1, BUTTON_CLICK_SINGLE, button1_cb, "Button 1 single click");
button_add_cb(&button2, BUTTON_CLICK_SINGLE, button1_cb, "Button 2 single click");
button_add_cb(&button3, BUTTON_CLICK_SINGLE, button1_cb, "Button 3 single click");
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.