/* 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,
};
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;
/***************************************************************************** */
}
-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;
}
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) {
status_led(none);
msleep(5000);
chenillard_activation_request = 0;
+ gpio_clear(out);
}
}
return 0;