logger: remove _log_buffer from Logger, initialize it in the writer instead

it's not used in the logger, so don't store it there. It is accessed via
LogWriter::write.
This also makes sure the buffer size is >= _min_write_chunk and handles
allocation failure properly.
This commit is contained in:
Beat Küng
2016-05-14 11:27:07 +02:00
committed by Lorenz Meier
parent 04f38b9197
commit 8b5a325644
4 changed files with 39 additions and 15 deletions
+1 -2
View File
@@ -80,13 +80,12 @@ private:
bool copy_if_updated_multi(orb_id_t topic, int multi_instance, int *handle, void *buffer, uint64_t *time_last_checked);
static constexpr size_t MAX_TOPICS_NUM = 128;
static constexpr size_t MAX_TOPICS_NUM = 128; /**< Maximum number of logged topics */
static constexpr unsigned MAX_NO_LOGFOLDER = 999; /**< Maximum number of log dirs */
static constexpr unsigned MAX_NO_LOGFILE = 999; /**< Maximum number of log files */
static constexpr const char *LOG_ROOT = PX4_ROOTFSDIR"/fs/microsd/log";
bool _task_should_exit = true;
uint8_t *_log_buffer;
char _log_dir[64];
uORB::Subscription<vehicle_status_s> _vehicle_status_sub {ORB_ID(vehicle_status)};
uORB::Subscription<parameter_update_s> _parameter_update_sub {ORB_ID(parameter_update)};