From 533f86a76a578975007757c3b0d209ddce44101c Mon Sep 17 00:00:00 2001 From: David Brooke Date: Tue, 7 Jul 2015 22:38:30 +0100 Subject: [PATCH 1/2] fix conditional include of uart.h --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 3444838..fabee15 100644 --- a/src/main.c +++ b/src/main.c @@ -43,7 +43,7 @@ #include "spi.h" #include "rfm69.h" -#ifdef defined(GATEWAY) || defined(DEBUG) || defined(GPS) +#if defined(GATEWAY) || defined(DEBUG) || defined(GPS) #include "uart.h" #endif From 08c2faa017f91aca124221522725f32354508900 Mon Sep 17 00:00:00 2001 From: David Brooke Date: Tue, 7 Jul 2015 22:41:12 +0100 Subject: [PATCH 2/2] leave UART fully enabled if not using ADC --- src/main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main.c b/src/main.c index fabee15..d8bf43a 100644 --- a/src/main.c +++ b/src/main.c @@ -77,8 +77,14 @@ void configurePins() { LPC_SYSCON->SYSAHBCLKCTRL |= (1<<7); /* Pin Assign 8 bit Configuration */ +#ifdef ADC /* U0_TXD */ LPC_SWM->PINASSIGN0 = 0xffffff00UL; +#else + /* U0_TXD */ + /* U0_RXD */ + LPC_SWM->PINASSIGN0 = 0xffff0001UL; +#endif /* SPI0_SCK */ LPC_SWM->PINASSIGN3 = 0x02ffffffUL; /* SPI0_MOSI */ @@ -86,9 +92,13 @@ void configurePins() { /* SPI0_SSEL */ LPC_SWM->PINASSIGN4 = 0xff050304UL; +#ifdef ADC /* Pin Assign 1 bit Configuration */ /* ACMP_I2 */ LPC_SWM->PINENABLE0 = 0xfffffffdUL; +#else + LPC_SWM->PINENABLE0 = 0xffffffffUL; +#endif }