nuttx/arch/arm
Freddie Chopin 5a6d95dd9f ave elapsed time before handling I2C in stm32_i2c_sem_waitdone()
It is possible that a context switch occurs after stm32_i2c_isr() call
but before elapsed time is saved in stm32_i2c_sem_waitdone(). It is then
possible that the handling code was executed only once with "elapsed
time" equal 0. When scheduler resumes this thread it is quite possible
that now "elapsed time" will be well above timeout threshold. In that
case the function returns and reports a timeout, even though the
handling code was not executed "recently".

Fix this by inverting the order of operations in the loop - save elapsed
time before handling I2C. This way a context switch anywhere in the loop
will not cause an erroneous "timeout" error.
2017-03-09 07:29:12 -06:00
..
include add LPC4337FET256 2017-03-09 10:30:28 +01:00
src ave elapsed time before handling I2C in stm32_i2c_sem_waitdone() 2017-03-09 07:29:12 -06:00
Kconfig Merged in david_s5/nuttx/upstream_2_greg_f7_config (pull request #199) 2017-01-23 23:08:50 +00:00