From ec09161c422da45e95b5110122776fb60cba2bc4 Mon Sep 17 00:00:00 2001 From: tekka007 Date: Sun, 20 Nov 2016 16:27:30 +0100 Subject: [PATCH] AVR: Use avr-libc eeprom update functions --- core/MyHwATMega328.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/core/MyHwATMega328.h b/core/MyHwATMega328.h index bf38a24..bb5962f 100644 --- a/core/MyHwATMega328.h +++ b/core/MyHwATMega328.h @@ -73,15 +73,9 @@ do { \ #define hwMillis() millis() #define hwRandomNumberInit() randomSeed(analogRead(MY_SIGNING_SOFT_RANDOMSEED_PIN)) #define hwReadConfig(__pos) eeprom_read_byte((uint8_t*)(__pos)) - -#ifndef eeprom_update_byte - #define hwWriteConfig(__loc, __val) if((uint8_t)(__val) != eeprom_read_byte((uint8_t*)(__loc))) { eeprom_write_byte((uint8_t*)(__loc), (__val)); } -#else - #define hwWriteConfig(__pos, __val) eeprom_update_byte((uint8_t*)(__pos), (__val)) -#endif - +#define hwWriteConfig(__pos, __val) eeprom_update_byte((uint8_t*)(__pos), (__val)) #define hwReadConfigBlock(__buf, __pos, __length) eeprom_read_block((void*)(__buf), (void*)(__pos), (__length)) -#define hwWriteConfigBlock(__buf, __pos, __length) eeprom_write_block((void*)(__buf), (void*)(__pos), (__length)) +#define hwWriteConfigBlock(__buf, __pos, __length) eeprom_update_block((void*)(__buf), (void*)(__pos), (__length))