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

History

add LPC11U68 default tip

2014-06-21, by va009039 [Sat, 21 Jun 2014 22:39:59 +0000] rev 6

add LPC11U68


update USBDevice.

2014-06-21, by va009039 [Sat, 21 Jun 2014 20:05:43 +0900] rev 5

update USBDevice.


remove disk access callback. add virtual com sendBreak callback.

2014-05-08, by va009039 [Thu, 08 May 2014 23:43:46 +0900] rev 4

remove disk access callback. add virtual com sendBreak callback.


merge

2014-05-06, by va009039 [Tue, 06 May 2014 16:05:57 +0900] rev 3

merge


add USB MSD block operation. branch

2014-05-06, by va009039 [Tue, 06 May 2014 15:42:30 +0900] rev 2

add USB MSD block operation.


add virtual com interface.

2014-05-04, by va009039 [Sun, 04 May 2014 00:23:05 +0000] rev 1

add virtual com interface.


first commit

2014-05-03, by va009039 [Sat, 03 May 2014 11:21:37 +0000] rev 0

first commit