Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/button.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 5 additions & 1 deletion src/button.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}