From 8eb6240541bd759c8b478c27b8ae6f5dcf9a89a4 Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Mon, 18 Oct 2021 15:27:26 +0200 Subject: [PATCH] Add HAL AVR EEPROM implementation --- src/hal/avr/eeprom.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/hal/avr/eeprom.cpp b/src/hal/avr/eeprom.cpp index 4658b3a..976ccea 100644 --- a/src/hal/avr/eeprom.cpp +++ b/src/hal/avr/eeprom.cpp @@ -1,15 +1,17 @@ #include "../eeprom.h" +#include namespace hal { namespace eeprom { EEPROM eeprom; -uint8_t EEPROM::ReadByte(EEPROM::addr_t /*addr*/) { - return 0; +uint8_t EEPROM::ReadByte(EEPROM::addr_t addr) { + return eeprom_read_byte((const uint8_t *)addr); } -void EEPROM::UpdateByte(EEPROM::addr_t /*addr*/, uint8_t /*value*/) { +void EEPROM::UpdateByte(EEPROM::addr_t addr, uint8_t value) { + eeprom_update_byte((uint8_t *)addr, value); } } // namespace eeprom