Browse Source

AP_HAL_SITL: use a separate eeprom.bin for SITL build

This resolves a problem in autotest where the eeprom.bin gets wiped out
when we run Replay against a log as part of test.Copter.Replay
c415-sdk
Peter Barker 4 years ago committed by Peter Barker
parent
commit
035e798b23
  1. 13
      libraries/AP_HAL_SITL/Storage.cpp
  2. 4
      libraries/AP_HAL_SITL/Storage.h

13
libraries/AP_HAL_SITL/Storage.cpp

@ -1,3 +1,6 @@ @@ -1,3 +1,6 @@
#include "Storage.h"
#include <AP_Vehicle/AP_Vehicle_Type.h>
#include <AP_HAL/AP_HAL.h>
#include <assert.h>
@ -5,10 +8,16 @@ @@ -5,10 +8,16 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "Storage.h"
#include <stdio.h>
#ifndef HAL_STORAGE_FILE
#if APM_BUILD_TYPE(APM_BUILD_Replay)
#define HAL_STORAGE_FILE "eeprom-replay.bin"
#else
#define HAL_STORAGE_FILE "eeprom.bin"
#endif
#endif
using namespace HALSITL;
extern const AP_HAL::HAL& hal;

4
libraries/AP_HAL_SITL/Storage.h

@ -5,10 +5,6 @@ @@ -5,10 +5,6 @@
#include "AP_HAL_SITL_Namespace.h"
#include <AP_FlashStorage/AP_FlashStorage.h>
#ifndef HAL_STORAGE_FILE
#define HAL_STORAGE_FILE "eeprom.bin"
#endif
// define which storage system to use. This allows us to test flash storage with --sitl-flash-storage
// configure option
#ifndef STORAGE_USE_FLASH

Loading…
Cancel
Save