[PATCH 15/34] lm32 BSP shared and lm32_evr: Fix BSPs

Joel Sherrill joel.sherrill at oarcorp.com
Mon Oct 20 20:34:17 UTC 2014


---
 c/src/lib/libbsp/lm32/lm32_evr/include/bsp.h   | 7 +++++++
 c/src/lib/libbsp/lm32/shared/console/console.c | 6 ------
 c/src/lib/libbsp/lm32/shared/console/uart.c    | 9 ++++++---
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/c/src/lib/libbsp/lm32/lm32_evr/include/bsp.h b/c/src/lib/libbsp/lm32/lm32_evr/include/bsp.h
index e63e9fe..facfc2d 100644
--- a/c/src/lib/libbsp/lm32/lm32_evr/include/bsp.h
+++ b/c/src/lib/libbsp/lm32/lm32_evr/include/bsp.h
@@ -76,6 +76,13 @@ rtems_isr_entry set_vector(                     /* returns old vector */
   int                 type                      /* RTEMS or RAW intr  */
 );
 
+/*
+ * Prototypes for BSP methods that cross file boundaries
+ */
+void BSP_uart_polled_write(char ch);
+int BSP_uart_polled_read( void );
+char BSP_uart_is_character_ready(char *ch);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/c/src/lib/libbsp/lm32/shared/console/console.c b/c/src/lib/libbsp/lm32/shared/console/console.c
index 233555c..e2741fc 100644
--- a/c/src/lib/libbsp/lm32/shared/console/console.c
+++ b/c/src/lib/libbsp/lm32/shared/console/console.c
@@ -16,14 +16,9 @@
 
 #define NO_BSP_INIT
 
-#include <rtems.h>
 #include <bsp.h>
 #include <rtems/libio.h>
 
-void BSP_uart_polled_write(char ch);
-int BSP_uart_polled_read( void );
-char BSP_uart_is_character_ready(char *ch);
-
 /*  console_initialize
  *
  *  This routine initializes the console IO driver.
@@ -59,7 +54,6 @@ static int inbyte( void )
   /*
    *  If polling, wait until a character is available.
    */
-
   return BSP_uart_polled_read();
 }
 
diff --git a/c/src/lib/libbsp/lm32/shared/console/uart.c b/c/src/lib/libbsp/lm32/shared/console/uart.c
index 1ce5c87..9adbd40 100644
--- a/c/src/lib/libbsp/lm32/shared/console/uart.c
+++ b/c/src/lib/libbsp/lm32/shared/console/uart.c
@@ -1,6 +1,8 @@
 /*
  *  Uart driver for Lattice Mico32 (lm32) UART
- *
+ */
+
+/*
  *  COPYRIGHT (c) 1989-1999.
  *  On-Line Applications Research Corporation (OAR).
  *
@@ -14,6 +16,7 @@
 
 #include "../include/system_conf.h"
 #include "uart.h"
+#include <bsp.h>
 #include <rtems/libio.h>
 
 static inline int uartread(unsigned int reg)
@@ -51,11 +54,11 @@ void BSP_uart_polled_write(char ch)
   uartwrite(LM32_UART_RBR, ch);
 }
 
-char BSP_uart_polled_read( void )
+int BSP_uart_polled_read( void )
 {
   /* Wait until there is a byte in RBR */
   while (!(uartread(LM32_UART_LSR) & LM32_UART_LSR_DR));
-  return (char) uartread(LM32_UART_RBR);
+  return (int) uartread(LM32_UART_RBR);
 }
 
 char BSP_uart_is_character_ready(char *ch)
-- 
1.9.3




More information about the devel mailing list