summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2024-06-10 01:23:25 +0100
committerGitHub <noreply@github.com>2024-06-10 01:23:25 +0100
commit8b5cdfabf5d05958a607efa174e64377d36e4b64 (patch)
treed8fb10f2c94de5c9aef101d27d83402e0ff29cdf
parentdf4538d894d8e5c1321c239ecbe4293a4ec3ee2d (diff)
Re-implement `eeprom_write_qword` as define (#23890)0.25.8
-rw-r--r--platforms/eeprom.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/platforms/eeprom.h b/platforms/eeprom.h
index 8e69eecc4c..067fa01616 100644
--- a/platforms/eeprom.h
+++ b/platforms/eeprom.h
@@ -22,9 +22,14 @@ void eeprom_update_dword(uint32_t *__p, uint32_t __value);
void eeprom_update_block(const void *__src, void *__dst, size_t __n);
#endif
-static inline void eeprom_write_qword(uint64_t *__p, uint64_t __value) {
- eeprom_update_block(&__value, __p, sizeof(uint64_t));
-}
+// While newer avr-libc versions may have an implementation
+// use preprocessor as to not cause conflicts
+#undef eeprom_write_qword
+#define eeprom_write_qword(__p, __value) \
+ do { \
+ uint64_t tmp = __value; \
+ eeprom_update_block(&tmp, __p, sizeof(uint64_t)); \
+ } while (0)
#if defined(EEPROM_CUSTOM)
# ifndef EEPROM_SIZE