X-Git-Url: http://git.scottworley.com/tattlekey/blobdiff_plain/d1521eda56a4768dbf481aa6cf9e75c5a5a7e7f1..f68e05b24686490605df455a66704909c84ea606:/client/button.c?ds=sidebyside diff --git a/client/button.c b/client/button.c index 4df8d66..1f111a1 100644 --- a/client/button.c +++ b/client/button.c @@ -8,7 +8,7 @@ static callback_t button_callback = NULL; static void respond_to_gpio_interrupt(uint gpio, uint32_t event_mask) { - if (gpio == button_pin && event_mask & GPIO_IRQ_EDGE_FALL && + if (gpio == config_button_pin && event_mask & GPIO_IRQ_EDGE_FALL && button_callback) { button_callback(); } @@ -17,7 +17,7 @@ static void respond_to_gpio_interrupt(uint gpio, uint32_t event_mask) { void begin_listening_for_button_press(callback_t callback) { button_callback = callback; - gpio_set_pulls(button_pin, 1, 0); + gpio_set_pulls(config_button_pin, 1, 0); /* Allow some time for the pull-up to take effect. * I'm not sure if this is necessary. @@ -25,6 +25,6 @@ void begin_listening_for_button_press(callback_t callback) { * the internal GPIO pull-up resistors are 50k. */ sleep_ms(100); - gpio_set_irq_enabled_with_callback(button_pin, GPIO_IRQ_EDGE_FALL, 1, + gpio_set_irq_enabled_with_callback(config_button_pin, GPIO_IRQ_EDGE_FALL, 1, respond_to_gpio_interrupt); }