Skip to content

Commit

Permalink
Enable rpc library usage on the Nucleo_F072 & Nucleo_F411RE boards
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
0xc0170 committed Mar 8, 2016
1 parent 4db2961 commit dafb5c3
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions libraries/rpc/parse_pins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,22 @@ PinName parse_pins(const char *str) {
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
Expand All @@ -83,7 +97,6 @@ PinName parse_pins(const char *str) {
}
return pin_names[pin - 1];
#endif

} else if (str[0] == 'L') { // LEDn
switch (str[3]) {
case '1' : return LED1;
Expand All @@ -101,5 +114,6 @@ PinName parse_pins(const char *str) {

return NC;
}

}


0 comments on commit dafb5c3

Please sign in to comment.