DataFlash: make log directory macro mandatory

Everybody defines the macro (or should be defining). Let smaller users
that don't have a filesystem to rather protect it with HAL_OS_POSIX_IO,
which also allow them to save more flash space.
This commit is contained in:
Lucas De Marchi 2017-10-20 13:22:45 -07:00
parent 591b846e2d
commit 3272ae2c04

View File

@ -74,17 +74,15 @@ void DataFlash_Class::Init(const struct LogStructure *structures, uint8_t num_ty
_num_types = num_types;
_structures = structures;
#if defined(HAL_BOARD_LOG_DIRECTORY)
#if HAL_OS_POSIX_IO
if (_params.backend_types == DATAFLASH_BACKEND_FILE ||
_params.backend_types == DATAFLASH_BACKEND_BOTH) {
DFMessageWriter_DFLogStart *message_writer =
new DFMessageWriter_DFLogStart(_firmware_string);
if (message_writer != nullptr) {
#if HAL_OS_POSIX_IO
backends[_next_backend] = new DataFlash_File(*this,
message_writer,
HAL_BOARD_LOG_DIRECTORY);
#endif
}
if (backends[_next_backend] == nullptr) {
hal.console->printf("Unable to open DataFlash_File");