From 53f5807ceed1162590b7d8a9e9dd15e5cd122e70 Mon Sep 17 00:00:00 2001 From: Bogdan Marinescu Date: Wed, 15 Aug 2012 21:55:13 +0300 Subject: [PATCH] LM3S platform fixes 1. fixed "uart_setup" function 2. enabled UART buffering 3. changed invalid keys in lm3s.pio --- src/platform/lm3s/lm3s_pio.c | 8 ++++---- src/platform/lm3s/platform.c | 2 ++ src/platform/lm3s/platform_conf.h | 11 ++++++++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/platform/lm3s/lm3s_pio.c b/src/platform/lm3s/lm3s_pio.c index 931464f3..40be26db 100644 --- a/src/platform/lm3s/lm3s_pio.c +++ b/src/platform/lm3s/lm3s_pio.c @@ -489,10 +489,10 @@ const LUA_REG_TYPE lm3s_pio_map[] = { LSTRKEY( "set_function" ), LFUNCVAL( lm3s_pio_set_function ) }, #endif // #ifdef LM3S_HAS_ALTERNATE_PIO { LSTRKEY( "set_strength" ), LFUNCVAL( lm3s_pio_set_strength ) }, - { LSTRKEY( "2MA" ), LNUMVAL( GPIO_STRENGTH_2MA ) }, - { LSTRKEY( "4MA" ), LNUMVAL( GPIO_STRENGTH_4MA ) }, - { LSTRKEY( "8MA" ), LNUMVAL( GPIO_STRENGTH_8MA ) }, - { LSTRKEY( "8MA_SC" ), LNUMVAL( GPIO_STRENGTH_8MA_SC ) }, + { LSTRKEY( "MA_2" ), LNUMVAL( GPIO_STRENGTH_2MA ) }, + { LSTRKEY( "MA_4" ), LNUMVAL( GPIO_STRENGTH_4MA ) }, + { LSTRKEY( "MA_8" ), LNUMVAL( GPIO_STRENGTH_8MA ) }, + { LSTRKEY( "MA_8SC" ), LNUMVAL( GPIO_STRENGTH_8MA_SC ) }, { LSTRKEY( "set_direction" ), LFUNCVAL( lm3s_pio_set_direction ) }, { LSTRKEY( "GPIO_IN" ), LNUMVAL( GPIO_DIR_MODE_IN ) }, { LSTRKEY( "GPIO_OUT" ), LNUMVAL( GPIO_DIR_MODE_OUT ) }, diff --git a/src/platform/lm3s/platform.c b/src/platform/lm3s/platform.c index 15786e3a..d73c1b88 100644 --- a/src/platform/lm3s/platform.c +++ b/src/platform/lm3s/platform.c @@ -490,6 +490,8 @@ u32 platform_uart_setup( unsigned id, u32 baud, int databits, int parity, int st MAP_UARTConfigSetExpClk( uart_base[ id ], MAP_SysCtlClockGet(), baud, config ); MAP_UARTConfigGetExpClk( uart_base[ id ], MAP_SysCtlClockGet(), &baud, &config ); + + MAP_UARTEnable( uart_base[ id ] ); } return baud; } diff --git a/src/platform/lm3s/platform_conf.h b/src/platform/lm3s/platform_conf.h index cdce1aba..3272a1fe 100644 --- a/src/platform/lm3s/platform_conf.h +++ b/src/platform/lm3s/platform_conf.h @@ -33,7 +33,9 @@ #define BUILD_UIP #define BUILD_DHCPC #define BUILD_DNS -#endif +#endif + +#define BUILD_LINENOISE #define BUILD_ADC #define BUILD_RPC @@ -57,6 +59,9 @@ #define ENABLE_LM3S_GPIO +#define LINENOISE_HISTORY_SIZE_LUA 30 +#define LINENOISE_HISTORY_SIZE_SHELL 10 + // ***************************************************************************** // UART/Timer IDs configuration data (used in main.c) @@ -215,8 +220,8 @@ #define NUM_CAN 1 // Enable RX buffering on UART -//#define BUF_ENABLE_UART -//#define CON_BUF_SIZE BUF_SIZE_128 +#define BUF_ENABLE_UART +#define CON_BUF_SIZE BUF_SIZE_128 // ADC Configuration Params #define ADC_BIT_RESOLUTION 10