We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7795695 commit 33f735cCopy full SHA for 33f735c
hardware/esp8266com/esp8266/libraries/EEPROM/EEPROM.h
@@ -24,6 +24,7 @@
24
25
#include <stddef.h>
26
#include <stdint.h>
27
+#include <string.h>
28
29
class EEPROMClass
30
{
@@ -41,7 +42,7 @@ class EEPROMClass
41
42
return t;
43
44
uint8_t *ptr = (uint8_t*) &t;
- for(int count = 0; count < sizeof(T); ++count) *ptr++ = _data[address + count];
45
+ memcpy(ptr, _data + address, sizeof(T));
46
47
}
48
@@ -51,7 +52,7 @@ class EEPROMClass
51
52
53
54
const uint8_t *ptr = (const uint8_t*) &t;
- for(int count = 0; count < sizeof(T); ++count) _data[address + count] = *ptr++;
55
+ memcpy(_data + address, ptr, sizeof(T));
56
_dirty = true;
57
58
0 commit comments