We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dfaa991 commit f2527d6Copy full SHA for f2527d6
lib/EEPROM/elrs_eeprom.h
@@ -12,4 +12,20 @@ class ELRS_EEPROM
12
uint8_t ReadByte(const uint32_t address);
13
void WriteByte(const uint32_t address, const uint8_t value);
14
void Commit();
15
+
16
+ // The extEEPROM lib that we use for STM doesn't have the get and put templates
17
+ // These templates need to be reimplemented here
18
+ template <typename T> void Get(uint32_t addr, T &value)
19
+ {
20
+ uint8_t* p = (uint8_t*)(void*)&value;
21
+ size_t i = sizeof(value);
22
+ while(i--) *p++ = ReadByte(addr++);
23
+ };
24
25
+ template <typename T> const void Put(uint32_t addr, const T &value)
26
27
+ const uint8_t* p = (const uint8_t*)(const void*)&value;
28
29
+ while(i--) WriteByte(addr++, *p++);
30
31
};
0 commit comments