Skip to content
Snippets Groups Projects
Commit ab9a3201 authored by Emile Castelnuovo's avatar Emile Castelnuovo Committed by Andrew Tridgell
Browse files

DataFlash: added #ifdefs for VRBRAIN board

parent 06744ea7
No related branches found
No related tags found
No related merge requests found
...@@ -42,16 +42,22 @@ DataFlash_File::DataFlash_File(const char *log_directory) : ...@@ -42,16 +42,22 @@ DataFlash_File::DataFlash_File(const char *log_directory) :
_log_directory(log_directory), _log_directory(log_directory),
_writebuf(NULL), _writebuf(NULL),
_writebuf_size(16*1024), _writebuf_size(16*1024),
#ifdef CONFIG_ARCH_BOARD_PX4FMU_V1 #if defined(CONFIG_ARCH_BOARD_PX4FMU_V1)
// V1 gets IO errors with larger than 512 byte writes // V1 gets IO errors with larger than 512 byte writes
_writebuf_chunk(512), _writebuf_chunk(512),
#elif defined(CONFIG_ARCH_BOARD_VRBRAIN_V4)
_writebuf_chunk(512),
#elif defined(CONFIG_ARCH_BOARD_VRBRAIN_V5)
_writebuf_chunk(512),
#elif defined(CONFIG_ARCH_BOARD_VRHERO_V1)
_writebuf_chunk(512),
#else #else
_writebuf_chunk(4096), _writebuf_chunk(4096),
#endif #endif
_writebuf_head(0), _writebuf_head(0),
_writebuf_tail(0), _writebuf_tail(0),
_last_write_time(0) _last_write_time(0)
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 #if CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
,_perf_write(perf_alloc(PC_ELAPSED, "DF_write")), ,_perf_write(perf_alloc(PC_ELAPSED, "DF_write")),
_perf_fsync(perf_alloc(PC_ELAPSED, "DF_fsync")), _perf_fsync(perf_alloc(PC_ELAPSED, "DF_fsync")),
_perf_errors(perf_alloc(PC_COUNT, "DF_errors")) _perf_errors(perf_alloc(PC_COUNT, "DF_errors"))
...@@ -67,7 +73,7 @@ void DataFlash_File::Init(const struct LogStructure *structure, uint8_t num_type ...@@ -67,7 +73,7 @@ void DataFlash_File::Init(const struct LogStructure *structure, uint8_t num_type
int ret; int ret;
struct stat st; struct stat st;
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 #if CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
// try to cope with an existing lowercase log directory // try to cope with an existing lowercase log directory
// name. NuttX does not handle case insensitive VFAT well // name. NuttX does not handle case insensitive VFAT well
DIR *d = opendir("/fs/microsd/APM"); DIR *d = opendir("/fs/microsd/APM");
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#ifndef DataFlash_File_h #ifndef DataFlash_File_h
#define DataFlash_File_h #define DataFlash_File_h
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 #if CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
#include <systemlib/perf_counter.h> #include <systemlib/perf_counter.h>
#else #else
#define perf_begin(x) #define perf_begin(x)
...@@ -83,7 +83,7 @@ private: ...@@ -83,7 +83,7 @@ private:
void _io_timer(void); void _io_timer(void);
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 #if CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
// performance counters // performance counters
perf_counter_t _perf_write; perf_counter_t _perf_write;
perf_counter_t _perf_fsync; perf_counter_t _perf_fsync;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment