fix for mbed lib issue 3 (i2c problem) see also https://mbed.org/users/mbed_official/code/mbed/issues/3 affected implementations: LPC812, LPC11U24, LPC1768, LPC2368, LPC4088
Fork of mbed-src by
Diff: cpp/stdio.cpp
- Revision:
- 1:62685faffa05
- Parent:
- 0:fd0d7bdfcdc2
- Child:
- 2:143cac498751
--- a/cpp/stdio.cpp Tue Nov 20 17:24:08 2012 +0000 +++ b/cpp/stdio.cpp Thu Nov 29 15:41:14 2012 +0000 @@ -274,10 +274,11 @@ namespace std { extern "C" int remove(const char *path) { - FileSystemLike *fs = FilePath::getFileSystem(path); + FilePath fp(path); + FileSystemLike *fs = fp.fileSystem(); if (fs == NULL) return -1; - return fs->remove(path); + return fs->remove(fp.fileName()); } extern "C" int rename(const char *oldname, const char *newname) { @@ -305,10 +306,11 @@ return FileSystemLike::opendir(); } - FileSystemLike *fs = FilePath::getFileSystem(path); + FilePath fp(path); + FileSystemLike* fs = fp.fileSystem(); if (fs == NULL) return NULL; - return fs->opendir(path); + return fs->opendir(fp.fileName()); } extern "C" struct dirent *readdir(DIR *dir) { @@ -332,10 +334,11 @@ } extern "C" int mkdir(const char *path, mode_t mode) { - FileSystemLike *fs = FilePath::getFileSystem(path); + FilePath fp(path); + FileSystemLike *fs = fp.fileSystem(); if (fs == NULL) return -1; - return fs->mkdir(path, mode); + return fs->mkdir(fp.fileName(), mode); } #if defined(TOOLCHAIN_GCC_CR) || defined(TOOLCHAIN_GCC_CS) || defined(TOOLCHAIN_GCC_ARM)