SuperHouse / esp-open-rtos

Open source FreeRTOS-based ESP8266 software framework
BSD 3-Clause "New" or "Revised" License
1.53k stars 491 forks source link

i2c: increase the default clock strech timeout to 250msec. #642

Closed ourairquality closed 6 years ago

ourairquality commented 6 years ago

This also redefines the timeout in FreeRTOS clock ticks, and implements a two stage wait: firstly spinning sampling frequently, and then falling back to a longer wait while sampling less frequently and yielding.

flannelhead commented 6 years ago

Looks like a sane implementation to me :) Makes it also more easy and explicit to detect situations where the slave is stretching for too long.

I just wonder if the spin count should depend on the CPU frequency. Probably it won't matter too much, though.