diff --git a/firmware/application/file.cpp b/firmware/application/file.cpp index 3695063d..0ea0f57e 100644 --- a/firmware/application/file.cpp +++ b/firmware/application/file.cpp @@ -25,13 +25,13 @@ File::~File() { close(); } -bool File::open(const std::string& file_path) { +bool File::open_for_writing(const std::string& file_path) { const auto open_result = f_open(&f, file_path.c_str(), FA_WRITE | FA_OPEN_ALWAYS); return (open_result == FR_OK); } bool File::open_for_append(const std::string& file_path) { - if( open(file_path) ) { + if( open_for_writing(file_path) ) { const auto seek_result = f_lseek(&f, f_size(&f)); if( seek_result == FR_OK ) { return true; diff --git a/firmware/application/file.hpp b/firmware/application/file.hpp index 29ffc57d..df391db7 100644 --- a/firmware/application/file.hpp +++ b/firmware/application/file.hpp @@ -32,7 +32,7 @@ class File { public: ~File(); - bool open(const std::string& file_path); + bool open_for_writing(const std::string& file_path); bool open_for_append(const std::string& file_path); bool close(); diff --git a/firmware/common/png_writer.cpp b/firmware/common/png_writer.cpp index 8a07326c..15e1b8aa 100644 --- a/firmware/common/png_writer.cpp +++ b/firmware/common/png_writer.cpp @@ -53,7 +53,7 @@ PNGWriter::PNGWriter( const std::string& filename ) { - file.open(filename); + file.open_for_writing(filename); file.write(png_file_header); file.write(png_ihdr_screen_capture);