Added support for RPC arguments of type *char
Fork of mbed-rpc by
Diff: parse_pins.cpp
- Revision:
- 8:fece2d5e8d96
- Parent:
- 7:2a26fd6a2b36
- Child:
- 11:325e3da833e1
--- a/parse_pins.cpp Tue May 27 08:30:27 2014 +0100 +++ b/parse_pins.cpp Mon Feb 09 09:15:22 2015 +0000 @@ -27,13 +27,18 @@ , 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 + static const PinName pin_names[] = {NC, NC, NC, NC, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14 , p15, p16, p17, p18, p19, p20, NC, NC, p23 , p24, p25, p26, p27, p28, p29, p30, p31, p32 - , p33, p34, NC, NC, p37, p38, p39}; + , p33, p34, NC, NC, p37, p38, p39, NC, NC, NC, NC, NC, NC, NC}; +#elif defined(TARGET_LPC4088_DM) + static const PinName pin_names[] = {p1, p2, p3, p4, NC, NC, p7, p8, p9, p10, p11, p12, p13, p14 + , p15, p16, p17, p18, p19, p20, p21, p22, p23 + , p24, p25, p26, NC, NC, p29, p30, NC, NC + , NC, NC, NC, NC, NC, NC, NC, NC, p41, p42, p43, p44, p45, p46}; #endif -#if defined(TARGET_LPC1768) || defined(TARGET_LPC11U24) || defined(TARGET_LPC2368) || defined(TARGET_LPC812) || defined(TARGET_LPC4088)|| defined(TARGET_LPC1114) +#if defined(TARGET_LPC1768) || defined(TARGET_LPC11U24) || defined(TARGET_LPC2368) || defined(TARGET_LPC812) || defined(TARGET_LPC4088) || defined(TARGET_LPC4088_DM) || defined(TARGET_LPC1114) if (str[0] == 'P') { // Pn_n uint32_t port = str[1] - '0'; uint32_t pin = str[3] - '0'; // Pn_n @@ -66,17 +71,17 @@ return NC; } return pin_names[pin - 5]; -#elif defined(TARGET_LPC4088) +#elif defined(TARGET_LPC4088) || defined(TARGET_LPC4088_DM) } else if (str[0] == 'p') { // pn uint32_t pin = str[1] - '0'; // pn uint32_t pin2 = str[2] - '0'; // pnn if (pin2 <= 9) { pin = pin * 10 + pin2; } - if (pin < 5 || pin > 39) { + if (pin < 1 || pin > 46) { return NC; } - return pin_names[pin - 5]; + return pin_names[pin - 1]; #endif } else if (str[0] == 'L') { // LEDn