aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
Diffstat (limited to 'os')
-rw-r--r--os/fs/fatfs/fatfs_fsimpl.cpp47
-rw-r--r--os/fs/fatfs/fatfs_fsimpl.hpp12
-rw-r--r--os/fs/fs.hpp5
-rw-r--r--os/various/cpp_wrappers/ch.cpp8
-rw-r--r--os/various/cpp_wrappers/ch.hpp1
5 files changed, 61 insertions, 12 deletions
diff --git a/os/fs/fatfs/fatfs_fsimpl.cpp b/os/fs/fatfs/fatfs_fsimpl.cpp
index 8c9fd73c7..e42c11e50 100644
--- a/os/fs/fatfs/fatfs_fsimpl.cpp
+++ b/os/fs/fatfs/fatfs_fsimpl.cpp
@@ -36,6 +36,9 @@
#define ERR_TERMINATING (msg_t)1
#define ERR_UNKNOWN_MSG (msg_t)2
+using namespace chibios_rt;
+using namespace chibios_fs;
+
/**
* @brief FatFS wrapper-related classes and interfaces.
*/
@@ -51,11 +54,11 @@ namespace chibios_fatfs {
start(FATFS_THREAD_PRIORITY);
}
- FatFSWrapper::FatFSServerThread::~FatFSServerThread() {
+/* FatFSWrapper::FatFSServerThread::~FatFSServerThread() {
sendMessage(MSG_TERMINATE);
wait();
- }
+ }*/
msg_t FatFSWrapper::FatFSServerThread::main() {
msg_t sts;
@@ -84,9 +87,47 @@ namespace chibios_fatfs {
server.start(FATFS_THREAD_PRIORITY);
}
- FatFSWrapper::~FatFSWrapper() {
+/* FatFSWrapper::~FatFSWrapper() {
server.~FatFSServerThread();
+ }*/
+
+ uint32_t FatFSWrapper::getAndClearLastError(void) {
+
+ return 0;
+ }
+
+ void FatFSWrapper::synchronize(void) {
+
+ }
+
+ void FatFSWrapper::remove(const char *fname) {
+
+ (void)fname;
+ }
+
+ BaseFileStreamInterface *FatFSWrapper::open(const char *fname) {
+
+ (void)fname;
+ return NULL;
+ }
+
+ BaseFileStreamInterface *FatFSWrapper::openForRead(const char *fname) {
+
+ (void)fname;
+ return NULL;
+ }
+
+ BaseFileStreamInterface *FatFSWrapper::openForWrite(const char *fname) {
+
+ (void)fname;
+ return NULL;
+ }
+
+ BaseFileStreamInterface *FatFSWrapper::create(const char *fname) {
+
+ (void)fname;
+ return NULL;
}
}
diff --git a/os/fs/fatfs/fatfs_fsimpl.hpp b/os/fs/fatfs/fatfs_fsimpl.hpp
index c8a454c3c..8c61c5748 100644
--- a/os/fs/fatfs/fatfs_fsimpl.hpp
+++ b/os/fs/fatfs/fatfs_fsimpl.hpp
@@ -27,6 +27,7 @@
*/
#include "ch.hpp"
+#include "fs.hpp"
#include "hal.h"
#ifndef _FS_FATFS_IMPL_HPP_
@@ -47,6 +48,7 @@
#endif
using namespace chibios_rt;
+using namespace chibios_fs;
/**
* @brief FatFS wrapper-related classes and interfaces.
@@ -71,13 +73,17 @@ namespace chibios_fatfs {
virtual msg_t main(void);
public:
FatFSServerThread(::BaseBlockDevice *blkdev);
- ~FatFSServerThread();
} server;
public:
FatFSWrapper(::BaseBlockDevice *blkdev);
-
- ~FatFSWrapper();
+ virtual uint32_t getAndClearLastError(void);
+ virtual void synchronize(void);
+ virtual void remove(const char *fname);
+ virtual BaseFileStreamInterface *open(const char *fname);
+ virtual BaseFileStreamInterface *openForRead(const char *fname);
+ virtual BaseFileStreamInterface *openForWrite(const char *fname);
+ virtual BaseFileStreamInterface *create(const char *fname);
};
}
diff --git a/os/fs/fs.hpp b/os/fs/fs.hpp
index 1ba2cfdc2..ed4a3e177 100644
--- a/os/fs/fs.hpp
+++ b/os/fs/fs.hpp
@@ -124,11 +124,6 @@ namespace chibios_fs {
class BaseFileSystemInterface {
public:
/**
- * @brief File system unmount and object destruction.
- */
- virtual ~BaseFileSystemInterface() = 0;
-
- /**
* @brief Returns an implementation dependent error code.
*
* @return An implementation-dependent error code.
diff --git a/os/various/cpp_wrappers/ch.cpp b/os/various/cpp_wrappers/ch.cpp
index 8437719af..5191f2748 100644
--- a/os/various/cpp_wrappers/ch.cpp
+++ b/os/various/cpp_wrappers/ch.cpp
@@ -279,6 +279,14 @@ namespace chibios_rt {
chThdYield();
}
+#if CH_USE_MESSAGES
+ ThreadReference BaseThread::waitMessage(void) {
+
+ ThreadReference tr(chMsgWait());
+ return tr;
+ }
+#endif /* CH_USE_MESSAGES */
+
#if CH_USE_EVENTS
eventmask_t BaseThread::getAndClearEvents(eventmask_t mask) {
diff --git a/os/various/cpp_wrappers/ch.hpp b/os/various/cpp_wrappers/ch.hpp
index 4cc6704b9..370b9a3f2 100644
--- a/os/various/cpp_wrappers/ch.hpp
+++ b/os/various/cpp_wrappers/ch.hpp
@@ -385,7 +385,6 @@ namespace chibios_rt {
*/
class BaseThread : public ThreadReference {
public:
-
/**
* @brief BaseThread constructor.
*