zephyr/drivers/eeprom
Tyler Hall 62a13fb03b drivers: eeprom_at2x: guarantee retry until timeout
Make sure to retry at least once after the timeout elapses. Sample the
current time before starting the i2c transaction, and only give up if
the polling occurred after the timeout.

The timeout exists to allow the eeprom time to complete a write, during
which time it will nack transactions (at24) or the status register will
report busy (at25). If a transaction fails legitimately, but the 1ms
sleep overshoots the timeout expiration, we will not try again, which
fails to give the part the full grace period before declaring failure.

This is likely to happen in the last 1ms interval but also possible if
the eeprom thread is preempted. It is possible to only try once and give
up if the sleep lasts longer than the timeout, which fails to give the
part an adequate period to complete the write.

Waiting until the current time is after (not equal to) the timeout is
also important because we don't want to round up partial milliseconds if
the start time was sampled near the end of a millisecond boundary. The
timeouts of eeproms can be ~5ms.

Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
2020-07-07 15:04:31 +02:00
..
CMakeLists.txt
Kconfig shell: enable modules by default if shell is enabled 2020-06-24 21:37:12 -04:00
Kconfig.stm32
eeprom_at2x.c drivers: eeprom_at2x: guarantee retry until timeout 2020-07-07 15:04:31 +02:00
eeprom_handlers.c
eeprom_shell.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
eeprom_simulator.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
eeprom_stm32.c zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00