diff --git a/include/button.h b/include/button.h index 257489a..6762ee9 100644 --- a/include/button.h +++ b/include/button.h @@ -37,6 +37,7 @@ typedef struct { QueueHandle_t button_init(unsigned long long pin_select); QueueHandle_t pulled_button_init(unsigned long long pin_select, gpio_pull_mode_t pull_mode); +QueueHandle_t button_get_queue(void); #ifdef __cplusplus } diff --git a/src/button.c b/src/button.c index ad7a9eb..f1735c1 100644 --- a/src/button.c +++ b/src/button.c @@ -23,7 +23,7 @@ typedef struct { int pin_count = -1; debounce_t * debounce; -QueueHandle_t queue; +QueueHandle_t queue = NULL; static void update_button(debounce_t *d) { d->history = (d->history << 1) | gpio_get_level(d->pin); @@ -140,3 +140,7 @@ QueueHandle_t pulled_button_init(unsigned long long pin_select, gpio_pull_mode_t return queue; } + +QueueHandle_t button_get_queue(void) { + return queue; +}