From: Nathael Pajani Date: Thu, 19 Nov 2020 18:49:49 +0000 (+0100) Subject: Update GPIO interrupt test application X-Git-Url: http://git.techno-innov.fr/?a=commitdiff_plain;h=9a2ed5ea6ffb280a35acdc3f12c9749f8fb4622b;p=soft%2Flpc122x%2Fexamples Update GPIO interrupt test application --- diff --git a/gpio_intr/main.c b/gpio_intr/main.c index e7e5e26..2407250 100644 --- a/gpio_intr/main.c +++ b/gpio_intr/main.c @@ -48,6 +48,7 @@ const struct pio_config common_pins[] = { /* UART 0 */ { LPC_UART0_RX_PIO_0_1, LPC_IO_DIGITAL }, { LPC_UART0_TX_PIO_0_2, LPC_IO_DIGITAL }, + { LPC_GPIO_0_6, LPC_IO_DIGITAL }, ARRAY_LAST_PIO, }; @@ -55,6 +56,7 @@ const struct pio status_led_green = LPC_GPIO_1_4; const struct pio status_led_red = LPC_GPIO_1_5; const struct pio button = LPC_GPIO_0_12; /* ISP button */ +const struct pio out = LPC_GPIO_0_6; /***************************************************************************** */ @@ -86,8 +88,9 @@ void fault_info(const char* name, uint32_t len) } -uint8_t chenillard_activation_request = 0; +volatile uint8_t chenillard_activation_request = 0; void activate_chenillard(uint32_t gpio) { + gpio_set(out); chenillard_activation_request = 1; } @@ -99,6 +102,7 @@ int main(void) uart_on(UART0, 115200, NULL); /* Activate the chenillard on Rising edge (button release) */ + config_gpio(&out, 0, GPIO_DIR_OUT, 0); set_gpio_callback(activate_chenillard, &button, EDGE_RISING); while (1) { @@ -107,6 +111,7 @@ int main(void) status_led(none); msleep(5000); chenillard_activation_request = 0; + gpio_clear(out); } } return 0;