diff --git a/libraries/AP_HAL_Empty/AP_HAL_Empty_Namespace.h b/libraries/AP_HAL_Empty/AP_HAL_Empty_Namespace.h index 25b769aaec..1cbbb54d7f 100644 --- a/libraries/AP_HAL_Empty/AP_HAL_Empty_Namespace.h +++ b/libraries/AP_HAL_Empty/AP_HAL_Empty_Namespace.h @@ -19,4 +19,5 @@ namespace Empty { class Storage; class UARTDriver; class Util; + class Flash; } diff --git a/libraries/AP_HAL_Empty/AP_HAL_Empty_Private.h b/libraries/AP_HAL_Empty/AP_HAL_Empty_Private.h index dc68f54bae..a5978582d7 100644 --- a/libraries/AP_HAL_Empty/AP_HAL_Empty_Private.h +++ b/libraries/AP_HAL_Empty/AP_HAL_Empty_Private.h @@ -17,3 +17,4 @@ #include "Storage.h" #include "UARTDriver.h" #include "Util.h" +#include "Flash.h" diff --git a/libraries/AP_HAL_Empty/Flash.h b/libraries/AP_HAL_Empty/Flash.h new file mode 100644 index 0000000000..b111edd9cd --- /dev/null +++ b/libraries/AP_HAL_Empty/Flash.h @@ -0,0 +1,14 @@ +#pragma once + +#include "AP_HAL_Empty.h" + +class Empty::Flash : public AP_HAL::Flash { +public: + uint32_t getpageaddr(uint32_t page) override { return 0; } + uint32_t getpagesize(uint32_t page) override { return 0; } + uint32_t getnumpages(void) override { return 0; } + bool erasepage(uint32_t page) override { return false; } + bool write(uint32_t addr, const void *buf, uint32_t count) override { return false; } + void keep_unlocked(bool set) override {} + bool ispageerased(uint32_t page) override { return false; } +}; diff --git a/libraries/AP_HAL_Empty/HAL_Empty_Class.cpp b/libraries/AP_HAL_Empty/HAL_Empty_Class.cpp index 9d415c9944..042880a53b 100644 --- a/libraries/AP_HAL_Empty/HAL_Empty_Class.cpp +++ b/libraries/AP_HAL_Empty/HAL_Empty_Class.cpp @@ -21,6 +21,7 @@ static RCOutput rcoutDriver; static Scheduler schedulerInstance; static Util utilInstance; static OpticalFlow opticalFlowDriver; +static Flash flashDriver; HAL_Empty::HAL_Empty() : AP_HAL::HAL( @@ -40,7 +41,8 @@ HAL_Empty::HAL_Empty() : &rcoutDriver, &schedulerInstance, &utilInstance, - &opticalFlowDriver), + &opticalFlowDriver, + &flashDriver, _member(new EmptyPrivateMember(123)) {}