21 lines
412 B
C++
21 lines
412 B
C++
#pragma once
|
|
#include <cstdint>
|
|
#include <tuple>
|
|
|
|
namespace flash {
|
|
|
|
constexpr uint32_t FLASH_BASE = 0x10000000;
|
|
constexpr uint32_t FLASH_SIZE = 2 * 1024 * 1024;
|
|
|
|
struct slot {
|
|
bool valid;
|
|
uint32_t version;
|
|
bool hash_ok;
|
|
auto as_tuple() const { return std::tie(valid, version, hash_ok); }
|
|
auto as_tuple() { return std::tie(valid, version, hash_ok); }
|
|
};
|
|
|
|
slot scan(uint32_t flash_offset);
|
|
|
|
}
|