1
0
mirror of https://github.com/elua/elua.git synced 2025-01-25 01:02:54 +08:00

LM3S - startup_gcc - use console UART, rather than assuming UART0

This commit is contained in:
ecdr 2014-03-12 18:37:34 -08:00
parent cb849d0d46
commit 307de046e2

View File

@ -70,6 +70,8 @@ extern void tmr3_handler();
extern void USB0DeviceIntHandler(void); extern void USB0DeviceIntHandler(void);
#endif #endif
// From platform.c
extern const u32 uart_base[];
//***************************************************************************** //*****************************************************************************
// //
@ -261,9 +263,7 @@ ResetISR(void)
#include "sysctl.h" #include "sysctl.h"
#include "uart.h" #include "uart.h"
// FIXME: Use console UART for error indicators // FIXME: Assumes console is UART, will not be right for USB_CDC
// Instead of UART0_BASE, should use uart_base[CON_UART_ID]
// Still would not be right for USB_CDC
//***************************************************************************** //*****************************************************************************
// //
@ -275,15 +275,15 @@ ResetISR(void)
static void static void
NmiSR(void) NmiSR(void)
{ {
MAP_UARTCharPut( UART0_BASE, 'N' ); MAP_UARTCharPut( uart_base[CON_UART_ID], 'N' );
MAP_UARTCharPut( UART0_BASE, 'M' ); MAP_UARTCharPut( uart_base[CON_UART_ID], 'M' );
MAP_UARTCharPut( UART0_BASE, 'I' ); MAP_UARTCharPut( uart_base[CON_UART_ID], 'I' );
// //
// Enter an infinite loop. // Enter an infinite loop.
// //
while(1) while(1)
{ {
MAP_UARTCharPut( UART0_BASE, '!' ); MAP_UARTCharPut( uart_base[CON_UART_ID], '!' );
} }
} }
@ -300,11 +300,11 @@ FaultISR(void)
// //
// Enter an infinite loop. // Enter an infinite loop.
// //
MAP_UARTCharPut( UART0_BASE, 'F' ); MAP_UARTCharPut( uart_base[CON_UART_ID], 'F' );
MAP_UARTCharPut( UART0_BASE, 'a' ); MAP_UARTCharPut( uart_base[CON_UART_ID], 'a' );
MAP_UARTCharPut( UART0_BASE, 'u' ); MAP_UARTCharPut( uart_base[CON_UART_ID], 'u' );
MAP_UARTCharPut( UART0_BASE, 'l' ); MAP_UARTCharPut( uart_base[CON_UART_ID], 'l' );
MAP_UARTCharPut( UART0_BASE, 't' ); MAP_UARTCharPut( uart_base[CON_UART_ID], 't' );
while(1) while(1)
{ {
} }
@ -320,14 +320,14 @@ FaultISR(void)
static void static void
IntDefaultHandler(void) IntDefaultHandler(void)
{ {
MAP_UARTCharPut( UART0_BASE, 'I' ); MAP_UARTCharPut( uart_base[CON_UART_ID], 'I' );
MAP_UARTCharPut( UART0_BASE, 'n' ); MAP_UARTCharPut( uart_base[CON_UART_ID], 'n' );
MAP_UARTCharPut( UART0_BASE, 't' ); MAP_UARTCharPut( uart_base[CON_UART_ID], 't' );
// //
// Go into an infinite loop. // Go into an infinite loop.
// //
while(1) while(1)
{ {
MAP_UARTCharPut( UART0_BASE, '*' ); MAP_UARTCharPut( uart_base[CON_UART_ID], '*' );
} }
} }