Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of libMiMic by
Diff: mbed/jsonrpc/Target_LPC176x.cpp
- Revision:
- 78:8cdb8fc7eda8
- Parent:
- 77:8651d3c19a55
--- a/mbed/jsonrpc/Target_LPC176x.cpp Fri Jun 20 15:38:30 2014 +0000
+++ b/mbed/jsonrpc/Target_LPC176x.cpp Mon Jun 23 04:45:57 2014 +0000
@@ -12,8 +12,8 @@
#define NS_LPC_PIN_1 (NS_LPC_PIN_0+32)
#define NS_LPC_PIN_2 (NS_LPC_PIN_1+32)
#define NS_LPC_PIN_3 (NS_LPC_PIN_2+32)
-#define NS_LPC_PIN_4 (NS_LPC_PIN_2+32)
-#define NS_LPC_PIN_5 (NS_LPC_PIN_2+32)
+#define NS_LPC_PIN_4 (NS_LPC_PIN_3+32)
+#define NS_LPC_PIN_5 (NS_LPC_PIN_4+32)
const static struct TPinNameMapItem pin_table[]={
{P0_0 ,NS_LPC_PIN_0+0}, {P0_1 ,NS_LPC_PIN_0+1}, {P0_2 ,NS_LPC_PIN_0+2}, {P0_3 ,NS_LPC_PIN_0+3},
@@ -94,6 +94,7 @@
{NC,PINID_NC}
};
+#define NUMBER_OF_PINMODE 5
const static struct TPinModeMapItem pinmode_table[]=
{
{PullUp ,PINMODEID+0},
@@ -102,6 +103,7 @@
{OpenDrain ,PINMODEID+3},
{PullDefault,PINMODEID+4}
};
+#define NUMBER_OF_PORT_NAME 5
const static struct TPortNameMapItem portname_table[]=
{
{Port0 ,PORTID+0},
@@ -123,7 +125,7 @@
PinMode RpcHandlerBase::pinmodeId2PinMode(unsigned int i_id)
{
- for(int i=0;pinmode_table[i].mode!=PullDefault;i++){
+ for(int i=0;i<NUMBER_OF_PINMODE;i++){
if(i_id==pinmode_table[i].id){
return pinmode_table[i].mode;
}
@@ -132,7 +134,7 @@
}
PortName RpcHandlerBase::portId2PortName(unsigned int i_id)
{
- for(int i=0;portname_table[i].port!=Port4;i++){
+ for(int i=0;i<NUMBER_OF_PORT_NAME;i++){
if(i_id==portname_table[i].id){
return portname_table[i].port;
}
