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.
Diff: LPC824/main.cpp
- Revision:
- 15:98ec6b372a2b
- Parent:
- 14:5319d562834e
- Child:
- 16:ba11339fd9c6
--- a/LPC824/main.cpp Mon Dec 08 02:03:16 2014 +0900 +++ b/LPC824/main.cpp Mon Dec 08 18:56:36 2014 +0900 @@ -222,7 +222,7 @@ */ if( (address&0x01)) {//read dev->read(address, send, length, false); //added - s=false; //added +// s=false; //added /* hidden for(int j=0; j<length; j++) { send[j] = dev->read(1); @@ -231,7 +231,7 @@ i+=(5); } else {//write for(int j=0; j < (length * 2); j+=2) { - ack = dev->write( 0xff&(recieve[5+j] << 4 | (recieve[6+j] & 0x0F)) ); + ack = 0xff&((recieve[5+j] << 4) | (recieve[6+j] & 0x0F)); *(send+(j/2)) = ack; //added } dev->write(address, send, length, true); //added @@ -300,24 +300,24 @@ }else{ for(int j=0; j<length; j+=3){ address = recieve[i+1+j]; - data = 0xff & (recieve[i+1+j] << 4 | (recieve[i+2+j] & 0x0F)); + data = 0xff & (recieve[i+2+j] << 4 | (recieve[i+3+j] & 0x0F)); switch(address){ case CHIP_ID: { //READ ONLY: do nothing - *(send+j) = registers[CHIP_ID]; + *(send+j) = registers[CHIP_ID-'0']; break; } case GPIO_STAT: { //READ ONLY from this command: do nothing - *(send+j) = registers[GPIO_STAT]; + *(send+j) = registers[GPIO_STAT-'0']; break; } case GPIO_CONF: { - registers[GPIO_CONF] = data; - *(send+j) = registers[GPIO_CONF]; + registers[GPIO_CONF-'0'] = data; + *(send+j) = registers[GPIO_CONF-'0']; break; } default: @@ -328,7 +328,7 @@ } } i += length+1; - pc.printf("command W is not implemented, "); +// pc.printf("command W is not implemented, "); break; } case CMD_I: