mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-12-02 20:31:46 +00:00
Converge File object with std::fstream. Simplify LogFile.
LogFile no longer watches SD card presence and tries to open/close files dynamically.
This commit is contained in:
@@ -25,7 +25,6 @@
|
||||
#include <string>
|
||||
|
||||
#include "file.hpp"
|
||||
#include "sd_card.hpp"
|
||||
|
||||
#include "lpc43xx_cpp.hpp"
|
||||
using namespace lpc43xx;
|
||||
@@ -33,22 +32,15 @@ using namespace lpc43xx;
|
||||
class LogFile {
|
||||
public:
|
||||
LogFile(const std::string& file_path);
|
||||
~LogFile();
|
||||
|
||||
bool is_ready();
|
||||
bool is_open() const;
|
||||
|
||||
bool write_entry(const rtc::RTC& datetime, const std::string& entry);
|
||||
|
||||
private:
|
||||
const std::string file_path;
|
||||
|
||||
File file;
|
||||
|
||||
SignalToken sd_card_status_signal_token;
|
||||
|
||||
bool write(const std::string& message);
|
||||
|
||||
void on_sd_card_status(const sd_card::Status status);
|
||||
};
|
||||
|
||||
#endif/*__LOG_FILE_H__*/
|
||||
|
||||
Reference in New Issue
Block a user