summaryrefslogtreecommitdiff
path: root/nuttx/arch
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-04-24 16:46:38 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-04-24 16:46:38 -0600
commit2b0558a4003a031a7e6dc0c95670473e018d8b98 (patch)
tree2c0a2c31f3b62533b88d995ad899ae21a0a8e0e7 /nuttx/arch
parent3abdc6aa5c3dca639e5d73d23bf93fe8d9259937 (diff)
downloadpx4-nuttx-2b0558a4003a031a7e6dc0c95670473e018d8b98.tar.gz
px4-nuttx-2b0558a4003a031a7e6dc0c95670473e018d8b98.tar.bz2
px4-nuttx-2b0558a4003a031a7e6dc0c95670473e018d8b98.zip
Minor Freedom-KL25Z updates
Diffstat (limited to 'nuttx/arch')
-rw-r--r--nuttx/arch/arm/src/kl/kl_irq.c2
-rw-r--r--nuttx/arch/arm/src/kl/kl_lowputc.c28
-rw-r--r--nuttx/arch/arm/src/kl/kl_serial.c5
3 files changed, 28 insertions, 7 deletions
diff --git a/nuttx/arch/arm/src/kl/kl_irq.c b/nuttx/arch/arm/src/kl/kl_irq.c
index a400c2cae..783fc42a4 100644
--- a/nuttx/arch/arm/src/kl/kl_irq.c
+++ b/nuttx/arch/arm/src/kl/kl_irq.c
@@ -359,7 +359,7 @@ int up_prioritize_irq(int irq, int priority)
irq == KL_IRQ_PENDSV ||
irq == KL_IRQ_SYSTICK ||
(irq >= KL_IRQ_EXTINT && irq < NR_IRQS));
- DEBUGASSERT(priority >= NVIC_SYSH_DISABLE_PRIORITY &&
+ DEBUGASSERT(priority >= NVIC_SYSH_PRIORITY_MAX &&
priority <= NVIC_SYSH_PRIORITY_MIN);
/* Check for external interrupt */
diff --git a/nuttx/arch/arm/src/kl/kl_lowputc.c b/nuttx/arch/arm/src/kl/kl_lowputc.c
index 33aab79e0..208bf2c0f 100644
--- a/nuttx/arch/arm/src/kl/kl_lowputc.c
+++ b/nuttx/arch/arm/src/kl/kl_lowputc.c
@@ -56,18 +56,35 @@
#include "chip/kl_uart.h"
#include "chip/kl_pinmux.h"
-
/**************************************************************************
* Private Definitions
**************************************************************************/
-
+
+#warning "Revisit"
+#undef BOARD_CORECLK_FREQ
+#define BOARD_CORECLK_FREQ 48000000
+
/* Select UART parameters for the selected console */
+#if defined(CONFIG_UART0_SERIAL_CONSOLE)
# define CONSOLE_BASE KL_UART0_BASE
# define CONSOLE_FREQ 48000000
# define CONSOLE_BAUD CONFIG_UART0_BAUD
# define CONSOLE_BITS CONFIG_UART0_BITS
# define CONSOLE_PARITY CONFIG_UART0_PARITY
+#elif defined(CONFIG_UART1_SERIAL_CONSOLE)
+# define CONSOLE_BASE KL_UART1_BASE
+# define CONSOLE_FREQ 48000000
+# define CONSOLE_BAUD CONFIG_UART1_BAUD
+# define CONSOLE_BITS CONFIG_UART1_BITS
+# define CONSOLE_PARITY CONFIG_UART1_PARITY
+#elif defined(CONFIG_UART2_SERIAL_CONSOLE)
+# define CONSOLE_BASE KL_UART2_BASE
+# define CONSOLE_FREQ 48000000
+# define CONSOLE_BAUD CONFIG_UART2_BAUD
+# define CONSOLE_BITS CONFIG_UART2_BITS
+# define CONSOLE_PARITY CONFIG_UART2_PARITY
+#endif
/**************************************************************************
* Private Types
@@ -215,7 +232,7 @@ void kl_lowsetup(void)
//#if defined(HAVE_SERIAL_CONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG)
// kl_uartconfigure(CONSOLE_BASE, CONSOLE_BAUD, CONSOLE_FREQ,
-// CONSOLE_PARITY, CONSOLE_BITS);
+// CONSOLE_PARITY, CONSOLE_BITS);
//#endif
}
@@ -249,9 +266,8 @@ void kl_uartreset(uintptr_t uart_base)
******************************************************************************/
#ifdef HAVE_UART_DEVICE
-void kl_uartconfigure(uintptr_t uart_base, uint32_t baud,
- uint32_t clock, unsigned int parity,
- unsigned int nbits)
+void kl_uartconfigure(uintptr_t uart_base, uint32_t baud, uint32_t clock,
+ unsigned int parity, unsigned int nbits)
{
uint32_t sbr;
uint32_t brfa;
diff --git a/nuttx/arch/arm/src/kl/kl_serial.c b/nuttx/arch/arm/src/kl/kl_serial.c
index caaa2c8af..6e4477c0b 100644
--- a/nuttx/arch/arm/src/kl/kl_serial.c
+++ b/nuttx/arch/arm/src/kl/kl_serial.c
@@ -69,6 +69,11 @@
* Pre-processor Definitions
****************************************************************************/
/* Some sanity checks *******************************************************/
+
+#warning "Revisit"
+#undef BOARD_CORECLK_FREQ
+#define BOARD_CORECLK_FREQ 48000000
+
/* Is there at least one UART enabled and configured as a RS-232 device? */
#ifndef HAVE_UART_DEVICE