From 1d1c8c639171f44720183cd28faa2a13da532217 Mon Sep 17 00:00:00 2001 From: Toyomasa Watarai Date: Fri, 16 Aug 2013 00:17:52 +0900 Subject: [PATCH 1/2] Removed SWCLK and SWDIO pins from pinmap --- .../targets/hal/TARGET_NXP/TARGET_LPC11XX/PinNames.h | 10 ---------- .../hal/TARGET_NXP/TARGET_LPC11XX/analogin_api.c | 1 - .../targets/hal/TARGET_NXP/TARGET_LPC11XX/gpio_api.c | 4 +--- .../targets/hal/TARGET_NXP/TARGET_LPC11XX/pwmout_api.c | 6 +----- .../targets/hal/TARGET_NXP/TARGET_LPC11XX/spi_api.c | 1 - 5 files changed, 2 insertions(+), 20 deletions(-) diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/PinNames.h b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/PinNames.h index acbc937a229..b0e61f75471 100644 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/PinNames.h +++ b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/PinNames.h @@ -43,13 +43,11 @@ typedef enum { P0_7 = (0 << PORT_SHIFT) | (7 << PIN_SHIFT) | 0x50, P0_8 = (0 << PORT_SHIFT) | (8 << PIN_SHIFT) | 0x60, P0_9 = (0 << PORT_SHIFT) | (9 << PIN_SHIFT) | 0x64, - P0_10 = (0 << PORT_SHIFT) | (10 << PIN_SHIFT) | 0x68, P0_11 = (0 << PORT_SHIFT) | (11 << PIN_SHIFT) | 0x74, P1_0 = (1 << PORT_SHIFT) | (0 << PIN_SHIFT) | 0x78, P1_1 = (1 << PORT_SHIFT) | (1 << PIN_SHIFT) | 0x7c, P1_2 = (1 << PORT_SHIFT) | (2 << PIN_SHIFT) | 0x80, - P1_3 = (1 << PORT_SHIFT) | (3 << PIN_SHIFT) | 0x90, P1_4 = (1 << PORT_SHIFT) | (4 << PIN_SHIFT) | 0x94, P1_5 = (1 << PORT_SHIFT) | (5 << PIN_SHIFT) | 0xa0, P1_6 = (1 << PORT_SHIFT) | (6 << PIN_SHIFT) | 0xa4, @@ -95,9 +93,7 @@ typedef enum { p16 = P1_0, p17 = P1_1, p18 = P1_2, - p19 = P1_3, p20 = P1_4, - p21 = P0_10, p22 = P0_2, p23 = P0_11, p24 = P0_2, @@ -133,12 +129,10 @@ typedef enum { xp16 = P1_0, xp17 = P1_1, xp18 = P1_2, - xp19 = P1_3, xp20 = P1_4, xp21 = P1_5, xp22 = P1_8, xp23 = P0_6, - xp24 = P0_10, xp25 = P3_0, xp26 = P3_1, xp27 = P3_2, @@ -167,14 +161,12 @@ typedef enum { dp1 = P0_8, dp2 = P0_9, - dp3 = P0_10, dp4 = P0_11, dp5 = P0_5, dp6 = P0_6, dp9 = P1_0, dp10 = P1_1, dp11 = P1_2, - dp12 = P1_3, dp13 = P1_4, dp14 = P1_5, dp15 = P1_6, @@ -190,14 +182,12 @@ typedef enum { dip1 = P0_8, dip2 = P0_9, - dip3 = P0_10, dip4 = P0_11, dip5 = P0_5, dip6 = P0_6, dip9 = P1_0, dip10 = P1_1, dip11 = P1_2, - dip12 = P1_3, dip13 = P1_4, dip14 = P1_5, dip15 = P1_6, diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/analogin_api.c b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/analogin_api.c index 2309224f68e..9539e86d574 100644 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/analogin_api.c +++ b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/analogin_api.c @@ -32,7 +32,6 @@ static const PinMap PinMap_ADC[] = { {P1_0 , ADC0_1, 2}, {P1_1 , ADC0_2, 2}, {P1_2 , ADC0_3, 2}, - {P1_3 , ADC0_4, 2}, {P1_4 , ADC0_5, 1}, {P1_10, ADC0_6, 1}, {P1_11, ADC0_7, 1}, diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/gpio_api.c b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/gpio_api.c index 4efcc46283e..b6f097a67c0 100644 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/gpio_api.c +++ b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/gpio_api.c @@ -19,12 +19,10 @@ uint32_t gpio_set(PinName pin) { // PIO default value of following ports are not same as others int f = ((pin == P0_0 ) || // RESET - (pin == P0_10) || // SWCLK (pin == P0_11) || // R (pin == P1_0 ) || // R (pin == P1_1 ) || // R - (pin == P1_2 ) || // R - (pin == P1_3 )) ? // + (pin == P1_2 )) ? // R (1) : (0); pin_function(pin, f); diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/pwmout_api.c b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/pwmout_api.c index 5cb2f8e54ac..51be887745b 100644 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/pwmout_api.c +++ b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/pwmout_api.c @@ -30,7 +30,6 @@ static const PinMap PinMap_PWM[] = { /* CT16B0 */ {P0_8 , PWM_1, 0x02}, /* MR0 */ {P0_9 , PWM_2, 0x02}, /* MR1 */ - {P0_10, PWM_3, 0x03}, /* MR2 */ /* CT16B1 */ {P1_9 , PWM_4, 0x01}, /* MR0 */ @@ -44,7 +43,6 @@ static const PinMap PinMap_PWM[] = { /* CT32B1 */ {P1_1 , PWM_9 ,0x03}, /* MR0 */ {P1_2 , PWM_10,0x03}, /* MR1 */ - {P1_3 , PWM_11,0x03}, /* MR2 */ {NC , NC ,0x00} }; @@ -54,10 +52,9 @@ typedef struct { uint8_t mr; } timer_mr; -static timer_mr pwm_timer_map[11] = { +static timer_mr pwm_timer_map[9] = { {0, 0}, /* CT16B0, MR0 */ {0, 1}, /* CT16B0, MR1 */ - {0, 2}, /* CT16B0, MR2 */ {1, 0}, /* CT16B1, MR0 */ {1, 1}, /* CT16B1, MR1 */ @@ -68,7 +65,6 @@ static timer_mr pwm_timer_map[11] = { {3, 0}, /* CT32B1, MR0 */ {3, 1}, /* CT32B1, MR1 */ - {3, 2} /* CT32B1, MR2 */ }; static LPC_TMR_TypeDef *Timers[4] = { diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/spi_api.c b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/spi_api.c index a35895682c1..f41f008f846 100644 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/spi_api.c +++ b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX/spi_api.c @@ -21,7 +21,6 @@ static const PinMap PinMap_SPI_SCLK[] = { {P0_6 , SPI_0, 0x02}, - {P0_10, SPI_0, 0x02}, {P2_11, SPI_0, 0x01}, {P2_1 , SPI_1, 0x02}, {NC , NC , 0} From 268a2973ea98a578fa066a5d0d5ac5190e3915fb Mon Sep 17 00:00:00 2001 From: Toyomasa Watarai Date: Fri, 16 Aug 2013 00:24:09 +0900 Subject: [PATCH 2/2] Added LPC1114 and target for some test cases --- libraries/rpc/parse_pins.cpp | 6 +++++- libraries/tests/mbed/heap_and_stack/main.cpp | 2 ++ libraries/tests/mbed/interrupt_chaining/ticker/main.cpp | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/libraries/rpc/parse_pins.cpp b/libraries/rpc/parse_pins.cpp index 30796803a16..7af49b42f3b 100644 --- a/libraries/rpc/parse_pins.cpp +++ b/libraries/rpc/parse_pins.cpp @@ -22,6 +22,10 @@ PinName parse_pins(const char *str) { static const PinName pin_names[] = {p5, p6, p7, p8, p9, p10, p11, p12, p13, p14 , p15, p16, p17, p18, p19, p20, p21, p22, p23 , p24, p25, p26, p27, p28, p29, p30}; +#elif defined(TARGET_LPC1114) + static const PinName pin_names[] = {dp1, dp2, dp4, dp5, dp6, dp9, dp10, dp11 + , dp13, dp14, dp15, dp16, dp17, dp18, dp23 + , dp24, dp25, dp26, dp27, dp28}; #elif defined(TARGET_LPC4088) static const PinName pin_names[] = {p5, p6, p7, p8, p9, p10, p11, p12, p13, p14 , p15, p16, p17, p18, p19, p20, NC, NC, p23 @@ -29,7 +33,7 @@ PinName parse_pins(const char *str) { , p33, p34, NC, NC, p37, p38, p39}; #endif -#if defined(TARGET_LPC1768) || defined(TARGET_LPC11U24) || defined(TARGET_LPC2368) || defined(TARGET_LPC812) || defined(TARGET_LPC4088) +#if defined(TARGET_LPC1768) || defined(TARGET_LPC11U24) || defined(TARGET_LPC2368) || defined(TARGET_LPC812) || defined(TARGET_LPC4088)|| defined(TARGET_LPC1114) if (str[0] == 'P') { // Pn_n uint32_t port = str[1] - '0'; uint32_t pin = str[3] - '0'; // Pn_n diff --git a/libraries/tests/mbed/heap_and_stack/main.cpp b/libraries/tests/mbed/heap_and_stack/main.cpp index 14e587bc03f..4bd61dbf1c9 100644 --- a/libraries/tests/mbed/heap_and_stack/main.cpp +++ b/libraries/tests/mbed/heap_and_stack/main.cpp @@ -14,8 +14,10 @@ void report_iterations(void) { printf("%.2f\n", ((float)(tot)/(float)(initial_stack_p - initial_heap_p))*100.); #endif #ifdef TOOLCHAIN_ARM +#ifndef __MICROLIB __heapvalid((__heapprt) fprintf, stdout, 1); #endif +#endif } void stack_test(char *latest_heap_pointer) { diff --git a/libraries/tests/mbed/interrupt_chaining/ticker/main.cpp b/libraries/tests/mbed/interrupt_chaining/ticker/main.cpp index b8613002a2b..3068aed5848 100644 --- a/libraries/tests/mbed/interrupt_chaining/ticker/main.cpp +++ b/libraries/tests/mbed/interrupt_chaining/ticker/main.cpp @@ -5,7 +5,7 @@ #if defined(TARGET_LPC1768) || defined(TARGET_LPC4088) #define TIMER_IRQ TIMER3_IRQn -#elif defined(TARGET_LPC11U24) +#elif defined(TARGET_LPC11U24) || defined(TARGET_LPC1114) #define TIMER_IRQ TIMER_32_1_IRQn #elif defined(TARGET_KL25Z) #define TIMER_IRQ LPTimer_IRQn @@ -40,7 +40,7 @@ Ticker flipper_2; Sender s1(pc, '1'); Sender s2(pc, '2'); -#if defined(TARGET_LPC1768) || defined(TARGET_LPC11U24) || defined(TARGET_LPC4088) || defined(TARGET_LPC2368) +#if defined(TARGET_LPC1768) || defined(TARGET_LPC11U24) || defined(TARGET_LPC4088) || defined(TARGET_LPC2368) || defined(TARGET_LPC1114) # define LED_NAME LED2 #elif defined(TARGET_KL05Z) # define LED_NAME LED2