[2.0.x] Use the new const functions of the persistentStore api (#11544)

This commit is contained in:
Nils Hasenbanck
2018-08-15 01:35:36 +02:00
committed by Scott Lahteine
parent 5573ef62c6
commit b37bfeffeb
3 changed files with 13 additions and 21 deletions

View File

@ -33,13 +33,15 @@ public:
static bool read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing=true);
static size_t capacity();
static inline bool write_data(const int pos, uint8_t* value, const size_t size) {
static inline bool write_data(const int pos, const uint8_t* value, const size_t size=sizeof(uint8_t)) {
int data_pos = pos;
uint16_t crc = 0;
return write_data(data_pos, value, size, &crc);
}
static inline bool read_data(const int pos, uint8_t* value, const size_t size) {
static inline bool write_data(const int pos, const uint8_t value) { return write_data(pos, &value); }
static inline bool read_data(const int pos, uint8_t* value, const size_t size=1) {
int data_pos = pos;
uint16_t crc = 0;
return read_data(data_pos, value, size, &crc);