USBLocalFileSystem.lib testing program for LPC11U35
Dependencies: BaseDAP SWD USBDAP USBLocalFileSystem mbed DA14580 SWSPI W25X40BV
USB memory + Writer for DA14580 BLE chip + CMSIS-DAP debugger + USB-UART functions in one chip
One button input loads your application into DA14580 or DA14580 included BLE modules
Quote:
Current compatible hardware description can be found at https://github.com/K4zuki/da14580/releases/tag/MurataBLEr04
Diff: main.cpp
- Revision:
- 7:5b78247c45c2
- Parent:
- 6:cb6984367a7a
- Child:
- 9:e279dee6e41c
--- a/main.cpp Fri Mar 04 10:34:25 2016 +0000 +++ b/main.cpp Sat Mar 05 01:20:16 2016 +0000 @@ -6,6 +6,7 @@ #include "DA14580.h" #include "W25X40BV.h" #include "loader.h" +#include "mystorage.h" /** - UART - TX = P0_19 @@ -70,7 +71,7 @@ volatile bool isISP = false; void BL_int(); -W25X40BV memory(P0_15, P0_13, P0_14, P0_16); // mosi, miso, sclk, cs +//W25X40BV memory(P0_15, P0_13, P0_14, P0_16); // mosi, miso, sclk, cs uint8_t Headerbuffer[8]={0x70,0x50,0x00,0x00,0x00,0x00,0x00,0x00}; /* header[0] | 0x70 | 'p' @@ -106,11 +107,12 @@ }; */ -MyStorage flash(P0_15, P0_13, P0_14, P0_16); +MyStorage flash(P0_8, P0_10, P0_9, P0_7); +USBLocalFileSystem usb_local(&flash, "local"); //PinName mosi, PinName miso, PinName sclk, PinName cs, const char* name int main() { // USBLocalFileSystem* usb_local = new USBLocalFileSystem(P0_8, P0_10, P0_9, P0_7, "local"); //PinName mosi, PinName miso, PinName sclk, PinName cs, const char* name - USBLocalFileSystem* usb_local = new USBLocalFileSystem(&flash, "local"); //PinName mosi, PinName miso, PinName sclk, PinName cs, const char* name +// USBLocalFileSystem* usb_local = new USBLocalFileSystem(&flash, "local"); //PinName mosi, PinName miso, PinName sclk, PinName cs, const char* name running.write(1); BL.mode(PullUp); char hex[]="0123456789ABCDEF"; //DEBUG @@ -152,7 +154,14 @@ */ bool _hidresult; - + usb_local.lock(false); + while(1) { + running.write(1); + wait_ms(1000); + running.write(0); + wait_ms(1000); + } +/* while(1) { usb_local->lock(true); usb_local->remount(); @@ -177,6 +186,7 @@ usb_local->putc('.'); } } +*/ /* usb_local->puts("loadersize: "); read= 0x0f& (loadersize>>12); @@ -222,10 +232,12 @@ usb_local->puts("F\n\r"); } */ +/* usb_local->lock(false); connected = 0; wait_ms(1000); } +*/ } int file_size( FILE *fp )