From c260749d5a938a099d9450d848d3122bf0002d96 Mon Sep 17 00:00:00 2001 From: Nathael Pajani Date: Tue, 27 Sep 2016 23:35:28 +0200 Subject: [PATCH] Updated Comments Updated according to new header files Updated use of uprintf and UART* instead of snprintf + serial_write(0, ...) --- gpio_intr/main.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/gpio_intr/main.c b/gpio_intr/main.c index f404271..766a67f 100644 --- a/gpio_intr/main.c +++ b/gpio_intr/main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/gpio_intr/main.c + * apps/dev/gpio_intr/main.c * * GPIO interrupt example * @@ -23,12 +23,9 @@ /* ISP button release disables the chenillard for 5 seconds */ -#include -#include "core/lpc_regs_12xx.h" -#include "core/lpc_core_cm0.h" -#include "core/pio.h" #include "core/system.h" #include "core/systick.h" +#include "core/pio.h" #include "lib/stdio.h" #include "drivers/serial.h" #include "drivers/gpio.h" @@ -65,10 +62,7 @@ void system_init() { /* Stop the watchdog */ startup_watchdog_disable(); /* Do it right now, before it gets a chance to break in */ - - /* Note: Brown-Out detection must be powered to operate the ADC. adc_on() will power - * it back on if called after system_init() */ - system_brown_out_detection_config(0); + system_brown_out_detection_config(0); /* No ADC used */ system_set_default_power_state(); clock_config(SELECTED_FREQ); set_pins(common_pins); @@ -87,10 +81,7 @@ void system_init() */ void fault_info(const char* name, uint32_t len) { - serial_write(0, name, len); - /* Wait for end of Tx */ - serial_flush(0); - /* FIXME : Perform soft reset of the micro-controller ! */ + uprintf(UART0, name); while (1); } @@ -102,9 +93,10 @@ void activate_chenillard(uint32_t gpio) { /***************************************************************************** */ -int main(void) { +int main(void) +{ system_init(); - uart_on(0, 115200, NULL); + uart_on(UART0, 115200, NULL); /* Activate the chenillard on Rising edge (button release) */ set_gpio_callback(activate_chenillard, &button, EDGE_RISING); -- 2.43.0