39 { StorageParam, 0, 1280},
40 { StorageMission, 1280, 2506},
41 { StorageRally, 3786, 150},
42 { StorageFence, 3936, 160},
43 #if STORAGE_NUM_AREAS >= 8 44 { StorageParam, 4096, 1280},
45 { StorageRally, 5376, 300},
46 { StorageFence, 5676, 256},
47 { StorageMission, 5932, 2132},
48 { StorageKeys, 8064, 64},
49 { StorageBindInfo,8128, 56},
51 #if STORAGE_NUM_AREAS >= 12 52 { StorageParam, 8192, 1280},
53 { StorageRally, 9472, 300},
54 { StorageFence, 9772, 256},
55 { StorageMission, 10028, 6228},
66 { StorageParam, 0, 1536},
67 { StorageMission, 1536, 2422},
68 { StorageRally, 3958, 90},
69 { StorageFence, 4048, 48},
70 #if STORAGE_NUM_AREAS >= 8 71 { StorageParam, 4096, 1280},
72 { StorageRally, 5376, 300},
73 { StorageFence, 5676, 256},
74 { StorageMission, 5932, 2132},
75 { StorageKeys, 8064, 64},
76 { StorageBindInfo,8128, 56},
78 #if STORAGE_NUM_AREAS >= 12 79 { StorageParam, 8192, 1280},
80 { StorageRally, 9472, 300},
81 { StorageFence, 9772, 256},
82 { StorageMission, 10028, 6228},
95 memset(blk, 0,
sizeof(blk));
96 for (uint8_t i=0; i<STORAGE_NUM_AREAS; i++) {
98 uint16_t length = area.
length;
99 uint16_t offset = area.
offset;
100 for (uint16_t ofs=0; ofs<length; ofs +=
sizeof(blk)) {
102 if (ofs + n > length) {
119 for (uint8_t i=0; i<STORAGE_NUM_AREAS; i++) {
133 uint8_t *b = (uint8_t *)data;
134 for (uint8_t i=0; i<STORAGE_NUM_AREAS; i++) {
136 uint16_t length = area.
length;
137 uint16_t offset = area.
offset;
141 if (addr >= length) {
147 if (count+addr > length) {
149 count = length - addr;
173 const uint8_t *b = (
const uint8_t *)data;
174 for (uint8_t i=0; i<STORAGE_NUM_AREAS; i++) {
176 uint16_t length = area.
length;
177 uint16_t offset = area.
offset;
181 if (addr >= length) {
187 if (count+addr > length) {
189 count = length - addr;
const StorageManager::StorageType type
uint8_t read_byte(uint16_t loc) const
StorageAccess(StorageManager::StorageType _type)
void write_uint16(uint16_t loc, uint16_t value) const
static const StorageArea * layout
uint16_t read_uint16(uint16_t loc) const
static const StorageArea layout_default[STORAGE_NUM_AREAS]
void write_byte(uint16_t loc, uint8_t value) const
virtual void read_block(void *dst, uint16_t src, size_t n)=0
AP_HAL::Storage * storage
bool read_block(void *dst, uint16_t src, size_t n) const
uint32_t read_uint32(uint16_t loc) const
void write_uint32(uint16_t loc, uint32_t value) const
static const StorageArea layout_copter[STORAGE_NUM_AREAS]
bool write_block(uint16_t dst, const void *src, size_t n) const
const AP_HAL::HAL & hal
-*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
virtual void write_block(uint16_t dst, const void *src, size_t n)=0