Skip to content

Commit

Permalink
return 0 instead of ff for invalid address or timeout
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre d'Alton <[email protected]>
  • Loading branch information
daltona committed Apr 27, 2020
1 parent eac2938 commit 83f2d2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tmk_core/common/arm_atsam/eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ volatile uint8_t *SmartEEPROM8 = (uint8_t *) SEEPROM_ADDR;
uint8_t eeprom_read_byte(const uint8_t *addr) {
uintptr_t offset = (uintptr_t)addr;
if (offset >= EEPROM_SIZE)
return 0xff;
return 0x0;

if (NVMCTRL->SEESTAT.bit.PSZ == 0 || NVMCTRL->SEESTAT.bit.SBLK == 0)
return buffer[offset];
Expand All @@ -40,7 +40,7 @@ uint8_t eeprom_read_byte(const uint8_t *addr) {
if (!NVMCTRL->SEESTAT.bit.BUSY)
return SmartEEPROM8[offset];

return 0xff;
return 0;
}

void eeprom_write_byte(uint8_t *addr, uint8_t value) {
Expand Down

0 comments on commit 83f2d2d

Please sign in to comment.