a writer program for "DA14580" BLE chip. use LocalFileSystem, so only for mbed-LPC1768/mbed-LPC11U24
Revision 3:39b85cd7e4e0, committed 2015-09-06
- Comitter:
- k4zuki
- Date:
- Sun Sep 06 23:49:20 2015 +0000
- Parent:
- 2:743581e516f8
- Commit message:
- pinout; use TARGET_FILE macro; remove nunecessary comments
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.lib | Show annotated file Show diff for this revision Revisions of this file |
diff -r 743581e516f8 -r 39b85cd7e4e0 main.cpp --- a/main.cpp Thu Apr 09 09:37:41 2015 +0000 +++ b/main.cpp Sun Sep 06 23:49:20 2015 +0000 @@ -3,11 +3,11 @@ DigitalOut myled(LED1); Serial pc(USBTX,USBRX); -Serial ble(p28,p27); +Serial ble(p9,p10); LocalFileSystem local( "local" ); -#define SOURCE_FILE "/local/_bin" +#define TARGET_FILE "/local/_bin" int file_size( FILE *fp ); enum XMODEM_CONST{ @@ -28,11 +28,9 @@ FILE* fp; ble.baud(57600); int crc=0x00; - - if ( NULL == (fp = fopen( SOURCE_FILE, "rb" )) ) { - exit(1); -// return ( ERROR_AT_FILE_OPEN ); - }else{ + + fp = fopen( TARGET_FILE, "rb" ); + if ( fp) { filesize=file_size(fp); pc.printf("0x%04X\n\r",filesize); }
diff -r 743581e516f8 -r 39b85cd7e4e0 mbed.lib --- a/mbed.lib Thu Apr 09 09:37:41 2015 +0000 +++ b/mbed.lib Sun Sep 06 23:49:20 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/#487b796308b0 +http://mbed.org/users/mbed_official/code/mbed/#8ab26030e058