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] | ||
RamDisk.cpp | 3094 | Revisions Annotate |
RamDisk.h | 509 | Revisions Annotate |
RamDiskFormat.cpp | 5019 | Revisions Annotate |
SDStorage.cpp | 15190 | Revisions Annotate |
SDStorage.h | 872 | Revisions Annotate |
Storage.cpp | 2252 | Revisions Annotate |
Storage.h | 3375 | Revisions Annotate |
StorageInterface.h | 584 | Revisions Annotate |
mymap.h | 1544 | Revisions Annotate |
mystring.h | 1695 | Revisions Annotate |