mirror of
https://github.com/apache/nuttx.git
synced 2026-06-08 01:42:58 +08:00
A few NuTiny-SDK-NUC120 fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5667 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -127,7 +127,7 @@ void nuc_clockconfig(void)
|
||||
|
||||
/* Enable External 4~24 mhz high speed crystal */
|
||||
|
||||
regval = getreg32(NUC_CLK_PWRCON);
|
||||
regval = getreg32(NUC_CLK_PWRCON);
|
||||
regval |= CLK_PWRCON_XTL12M_EN;
|
||||
putreg32(regval, NUC_CLK_PWRCON);
|
||||
|
||||
|
||||
@@ -276,7 +276,7 @@ void nuc_lowputc(uint32_t ch)
|
||||
#ifdef HAVE_SERIAL_CONSOLE
|
||||
/* Wait for the TX FIFO to be empty (excessive!) */
|
||||
|
||||
while ((getreg32(NUC_CONSOLE_BASE + NUC_UART_FSR_OFFSET) & UART_FSR_TX_EMPTY) != 0);
|
||||
while ((getreg32(NUC_CONSOLE_BASE + NUC_UART_FSR_OFFSET) & UART_FSR_TX_EMPTY) == 0);
|
||||
|
||||
/* Then write the character to to the TX FIFO */
|
||||
|
||||
@@ -331,15 +331,15 @@ void nuc_setbaud(uintptr_t base, uint32_t baud)
|
||||
|
||||
/* Check if the divxider exceeds the range */
|
||||
|
||||
if (clksperbit > 0xffff)
|
||||
if (brd > 0xffff)
|
||||
{
|
||||
/* Try to Set Divider X up 10 (MODE#1) */
|
||||
|
||||
regval &= ~UART_BAUD_DIV_X_ONE;
|
||||
|
||||
for (divx = 8; divx <16; divx++)
|
||||
for (divx = 8; divx < 16; divx++)
|
||||
{
|
||||
brd = (clksperbit % (divx+1));
|
||||
brd = (clksperbit % (divx + 1));
|
||||
if (brd < 3)
|
||||
{
|
||||
regval &= ~UART_BAUD_DIVIDER_X_MASK;
|
||||
@@ -357,4 +357,4 @@ void nuc_setbaud(uintptr_t base, uint32_t baud)
|
||||
putreg32(regval, base + NUC_UART_BAUD_OFFSET);
|
||||
|
||||
}
|
||||
#endif /* HAVE_UART */
|
||||
#endif /* HAVE_UART */
|
||||
|
||||
Reference in New Issue
Block a user