mbed RPC

Dependents:   RPC_Serial_OVFZ RPCHTTPServer SerialRPC_rtos_example RPC_HTTP ... more

Fork of mbed-rpc by mbed official

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Tue Mar 08 09:15:16 2016 +0000
Parent:
11:325e3da833e1
Child:
13:a6fe8e713f64
Commit message:
Synchronized with git revision dafb5c3a69082689a3299eee2229a36f557bd1b7

Full URL: https://github.com/mbedmicro/mbed/commit/dafb5c3a69082689a3299eee2229a36f557bd1b7/

Adding additional 'defined' statements to line 62 of parse_pins.cpp should in theory enable the rpc libraries for all other Nucleo boards, since all stm32 parts use the same pin labeling scheme i.e. P(port)_pinNumber e.g. PA_3,
PC_15 e.t.c.

Changed in this revision

parse_pins.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/parse_pins.cpp	Thu Aug 13 10:45:15 2015 +0100
+++ b/parse_pins.cpp	Tue Mar 08 09:15:16 2016 +0000
@@ -58,8 +58,22 @@
             pin = pin * 10 + pin2;
         }
         return port_pin((PortName)port, pin);
+
+#elif defined(TARGET_NUCLEO_F072RB) || defined(TARGET_NUCLEO_F411RE)
+    if (str[0] == 'P') {   // PX_XX e.g.PA_2 PC_15
+        uint32_t port = str[1] - 'A';
+        uint32_t pin  = str[3] - '0';       
+        uint32_t pin2 = str[4] - '0';       
+
+        if (pin2 <= 9) {
+            pin = pin * 10 + pin2;
+        }
+        return port_pin((PortName)port, pin);
+
 #endif
 
+
+
 #if defined(TARGET_LPC1768) || defined(TARGET_LPC11U24) || defined(TARGET_LPC2368)
     } else if (str[0] == 'p') {       // pn
         uint32_t pin  = str[1] - '0'; // pn
@@ -83,7 +97,6 @@
         }
         return pin_names[pin - 1];
 #endif
-
     } else if (str[0] == 'L') {  // LEDn
         switch (str[3]) {
             case '1' : return LED1;
@@ -101,5 +114,6 @@
 
     return NC;
 }
+}
 
-}
+