fork from va009039/USBLocalFileSystem
Dependents: 11u35_usbLocalFilesystem
Fork of USBLocalFileSystem by
Diff: USBLocalFileSystem.cpp
- Revision:
- 4:8f6857784854
- Parent:
- 2:97c314eae8b8
diff -r 09b562c87f89 -r 8f6857784854 USBLocalFileSystem.cpp --- a/USBLocalFileSystem.cpp Tue May 06 16:05:57 2014 +0900 +++ b/USBLocalFileSystem.cpp Thu May 08 23:43:46 2014 +0900 @@ -1,6 +1,7 @@ #include "USBLocalFileSystem.h" #include "RamDisk.h" #include "SDStorage.h" +#include "USB_CDC.h" USBLocalFileSystem::USBLocalFileSystem(const char* name) { @@ -36,6 +37,15 @@ _local = new LocalStorage(_storage); } +int USBLocalFileSystem::lock(bool f) +{ + return _usb->block(f); +} + +bool USBLocalFileSystem::find(char* name, size_t size, const char* pat) +{ + return LocalStorage::find(name, size, _name, pat); +} int USBLocalFileSystem::readable() { @@ -52,9 +62,32 @@ return _usb->getc(); } -void USBLocalFileSystem::putc(int c) +int USBLocalFileSystem::putc(int c) { _usb->putc(c); + return c; +} + +int USBLocalFileSystem::puts(const char* str) +{ + while(*str) { + putc(*str++); + } + return 0; } +void USBLocalFileSystem::attachSendBreak(void (*fptr)(uint16_t duration)) +{ + getUsb()->getCDC()->attachSendBreak(fptr); +} +void USBLocalFileSystem::attachControlLineState(void (*fptr)(int dts, int dtr)) +{ + getUsb()->getCDC()->attachControlLineStateChanged(fptr); +} + +void USBLocalFileSystem::attachSettingChanged(void (*fptr)(int baud, int bits, int parity, int stop)) +{ + getUsb()->getCDC()->attach(fptr); +} +