diff --git a/firmware/application/file.hpp b/firmware/application/file.hpp index 34466c4c0..d8c711f28 100644 --- a/firmware/application/file.hpp +++ b/firmware/application/file.hpp @@ -37,11 +37,7 @@ namespace std { namespace filesystem { struct filesystem_error { - const BYTE err; - - operator bool() const { - return err != FR_OK; - } + const uint32_t err; std::string what() const; }; @@ -129,6 +125,14 @@ public: return err == FR_OK; } + bool bad() const { + return err != FR_OK; + } + + std::filesystem::filesystem_error error() const { + return { err }; + } + bool read(void* const data, const size_t bytes_to_read); bool write(const void* const data, const size_t bytes_to_write);