Skip to content

Commit 83f2d2d

Browse files
committed
return 0 instead of ff for invalid address or timeout
Signed-off-by: Alexandre d'Alton <alex@alexdalton.org>
1 parent eac2938 commit 83f2d2d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tmk_core/common/arm_atsam/eeprom.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ volatile uint8_t *SmartEEPROM8 = (uint8_t *) SEEPROM_ADDR;
2929
uint8_t eeprom_read_byte(const uint8_t *addr) {
3030
uintptr_t offset = (uintptr_t)addr;
3131
if (offset >= EEPROM_SIZE)
32-
return 0xff;
32+
return 0x0;
3333

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

43-
return 0xff;
43+
return 0;
4444
}
4545

4646
void eeprom_write_byte(uint8_t *addr, uint8_t value) {

0 commit comments

Comments
 (0)