Emulation of LocalFileSystem with virtual COM.
Dependents: KL46Z-lpc81isp lpcterm2
#include "USBLocalFileSystem.h" int main() { USBLocalFileSystem* usb_local = new USBLocalFileSystem(); // RamDisk(64KB) while(1) { usb_local->lock(true); usb_local->remount(); char filename[32]; if (usb_local->find(filename, sizeof(filename), "*.TXT")) { FILE* fp = fopen(filename, "r"); if (fp) { int c; while((c = fgetc(fp)) != EOF) { usb_local->putc(c); } fclose(fp); } } usb_local->lock(false); wait_ms(1000*5); } }
Sample application:
Import programKL46Z-lpc81isp
ISP example program.
Import programlpcterm2
semihost server example program
Files at revision 6:528036abfb02
Name | Size | Actions |
---|---|---|
[up] | ||
DiskInterface.h | 1110 | Revisions Annotate |
SerialInterface.h | 312 | Revisions Annotate |
USBMSD2.cpp | 13922 | Revisions Annotate |
USBMSD2.h | 6387 | Revisions Annotate |
USB_CDC.cpp | 6124 | Revisions Annotate |
USB_CDC.h | 4268 | Revisions Annotate |
USB_HID.cpp | 5483 | Revisions Annotate |
USB_HID.h | 3093 | Revisions Annotate |
USB_MSD.cpp | 16200 | Revisions Annotate |
USB_MSD.h | 5429 | Revisions Annotate |