diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-11-21 20:33:44 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-11-21 20:44:18 -0500 |
commit | 4bbd6310864b231f26c3c069052a610a2178a456 (patch) | |
tree | d21b5fe6c94ce1241c4464e7bb3c85136bd9b2e8 /src/lpc176x/serial.c | |
parent | 9ba94ded9e9c48c81ddd10e9712619882e046fa1 (diff) | |
download | kutter-4bbd6310864b231f26c3c069052a610a2178a456.tar.gz kutter-4bbd6310864b231f26c3c069052a610a2178a456.tar.xz kutter-4bbd6310864b231f26c3c069052a610a2178a456.zip |
lpc176x: Add an enable_peripheral_clock() helper function
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/lpc176x/serial.c')
-rw-r--r-- | src/lpc176x/serial.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lpc176x/serial.c b/src/lpc176x/serial.c index 7f2a0db9..1594a2ad 100644 --- a/src/lpc176x/serial.c +++ b/src/lpc176x/serial.c @@ -16,7 +16,7 @@ serial_init(void) { // Setup baud LPC_UART0->LCR = (1<<7); // set DLAB bit - LPC_SC->PCLKSEL0 = (LPC_SC->PCLKSEL0 & ~(0x3<<6)) | (0x1<<6); + enable_peripheral_clock(PCLK_UART0); uint32_t pclk = SystemCoreClock; uint32_t div = pclk / (CONFIG_SERIAL_BAUD * 16); LPC_UART0->DLL = div & 0xff; |