mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-18 06:38:29 -04:00
HAL_Empty: added empty flash driver
This commit is contained in:
parent
35d711093b
commit
b7286ee03b
@ -19,4 +19,5 @@ namespace Empty {
|
|||||||
class Storage;
|
class Storage;
|
||||||
class UARTDriver;
|
class UARTDriver;
|
||||||
class Util;
|
class Util;
|
||||||
|
class Flash;
|
||||||
}
|
}
|
||||||
|
@ -17,3 +17,4 @@
|
|||||||
#include "Storage.h"
|
#include "Storage.h"
|
||||||
#include "UARTDriver.h"
|
#include "UARTDriver.h"
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
|
#include "Flash.h"
|
||||||
|
14
libraries/AP_HAL_Empty/Flash.h
Normal file
14
libraries/AP_HAL_Empty/Flash.h
Normal file
@ -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; }
|
||||||
|
};
|
@ -21,6 +21,7 @@ static RCOutput rcoutDriver;
|
|||||||
static Scheduler schedulerInstance;
|
static Scheduler schedulerInstance;
|
||||||
static Util utilInstance;
|
static Util utilInstance;
|
||||||
static OpticalFlow opticalFlowDriver;
|
static OpticalFlow opticalFlowDriver;
|
||||||
|
static Flash flashDriver;
|
||||||
|
|
||||||
HAL_Empty::HAL_Empty() :
|
HAL_Empty::HAL_Empty() :
|
||||||
AP_HAL::HAL(
|
AP_HAL::HAL(
|
||||||
@ -40,7 +41,8 @@ HAL_Empty::HAL_Empty() :
|
|||||||
&rcoutDriver,
|
&rcoutDriver,
|
||||||
&schedulerInstance,
|
&schedulerInstance,
|
||||||
&utilInstance,
|
&utilInstance,
|
||||||
&opticalFlowDriver),
|
&opticalFlowDriver,
|
||||||
|
&flashDriver,
|
||||||
_member(new EmptyPrivateMember(123))
|
_member(new EmptyPrivateMember(123))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user