From e9ddca37e23330ab82be4b15dffcfb919d56a0f3 Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Sat, 14 May 2011 21:14:43 -0400 Subject: [PATCH] set UART function without clobbering the entire func_sel register. --- src/default_lowlevel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/default_lowlevel.c b/src/default_lowlevel.c index 452771085..35750314a 100644 --- a/src/default_lowlevel.c +++ b/src/default_lowlevel.c @@ -65,7 +65,10 @@ void uart1_init(uint16_t inc, uint16_t mod, uint8_t samp) { *UART1_UCON = (1 << 0) | (1 << 1); /* enable receive, transmit */ if(samp == UCON_SAMP_16X) set_bit(*UART1_UCON,UCON_SAMP); - *GPIO_FUNC_SEL0 = ( (0x01 << (14*2)) | (0x01 << (15*2)) ); /* set GPIO15-14 to UART (UART1 TX and RX)*/ + + /* set GPIO15-14 to UART (UART1 TX and RX)*/ + GPIO->FUNC_SEL.GPIO_14 = 1; + GPIO->FUNC_SEL.GPIO_15 = 1; /* interrupt when there are this number or more bytes free in the TX buffer*/ *UART1_UTXCON = 16;