Emulation of LocalFileSystem with virtual COM.

Dependencies:   USBDevice

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 this revision

API Documentation at this revision

Comitter:
va009039
Date:
Sat Jun 21 22:39:59 2014 +0000
Parent:
5:7e478063c6ee
Commit message:
add LPC11U68

Changed in this revision

USBMSD2/USB_CDC.h Show annotated file Show diff for this revision Revisions of this file
--- a/USBMSD2/USB_CDC.h	Sat Jun 21 20:05:43 2014 +0900
+++ b/USBMSD2/USB_CDC.h	Sat Jun 21 22:39:59 2014 +0000
@@ -25,7 +25,7 @@
 #define CDC_EPINT_IN   EP1IN
 #define CDC_EPBULK_IN  EP5IN 
 #define CDC_EPBULK_OUT EP5OUT
-#elif defined(TARGET_LPC1347)||defined(TARGET_LPC11U24)||defined(TARGET_LPC11U35_401)||defined(TARGET_LPC1549)
+#elif defined(TARGET_LPC1347)||defined(TARGET_LPC11U24)||defined(TARGET_LPC11U35_401)||defined(TARGET_LPC11U35_501)||defined(TARGET_LPC1549)||defined(TARGET_LPC11U68)
 #define CDC_EPINT_IN   EP1IN
 #define CDC_EPBULK_IN  EP3IN 
 #define CDC_EPBULK_OUT EP3OUT