USB composite device example program, drag-and-drop flash writer.
Dependencies: SWD USBDevice mbed BaseDAP
test2_USBMSD_Drop.cpp
00001 // test2_USBMSD_Drop.cpp 2013/9/26 00002 #if 0 00003 #include "mbed.h" 00004 #include "USBMSD_Drop.h" 00005 00006 Serial pc(USBTX, USBRX); 00007 USBMSD_Drop* host; 00008 00009 void callback(const uint8_t* data, int len, int offset, int total) 00010 { 00011 for(int i = 0; i < len && (offset+i) < total; i++) { 00012 pc.putc(data[i]); 00013 } 00014 } 00015 00016 int main() 00017 { 00018 pc.baud(921600); 00019 //pc.baud(9600); 00020 pc.printf("%s\n", __FILE__); 00021 00022 host = new USBMSD_Drop(); 00023 host->attach(callback); 00024 while(1); // forever 00025 } 00026 #endif
Generated on Wed Jul 13 2022 08:08:25 by 1.7.2