-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make (synchronous) I2C work again #2972
Conversation
@betzw Looks like there are 3 changes in one commit. These would be better as 3 separate commits. Can you update? Also if there are test results, can you upload? |
@sg- @bcostm & @LMESTM |
Hi +---------------+---------------------+-----------+----------+-------------------------+--------------------+---------------+-------+ |
On my side I have setup the Sensors_Reader sample application for the X-NUCLEO-IKS01A1 expansion board together with the latest version of mbed-dev.
while with the version of the file as in this PR the application performs as expected:
|
It's not about what file and how many lines but a logical set of changes, that are easy to follow, and in the worst case to revert and should provide a description. These could be split, let's just focus now on the commit message: it would be helpful for anyone who comes back to this commit if the commit message describes what changes are included and how they fix a problem (in this case problems). I would propose:
Each of the list should contain - why, often also what does it fix, a problem of clocks, misconfiguration, wrong data, or anything else? For instance, for the first in the list above - remove waiting for BTF flag - It is removed because .... . If you can amend you commit, that would be nice Thanks for fixing i2c and providing test results |
- Remove waiting for 'BTF' flag in 'i2c_stop()': When 'i2c_stop()' is called from 'i2c_read()' or 'i2c_write()' flag 'BTF' has already been cleared (indirectly) by the calling functions and therefore 'i2c_stop()' would mistakenly always run into a timeout. - Delay clock enabling until pins are configured: Enabling the I2C bus clock before configuring its pins might in rare cases lead to HW faults on the bus. - Move initialization of 'handle->Instance' to function 'i2c_reset()': As 'i2c_reset()' uses '__HAL_I2C_GET_FLAG(handle, I2C_FLAG_BUSY)' field 'handle->Instance' must have been initialized before doing so. Therefore, this operation has been anticipated by moving it from function 'i2c_frequency()' to function 'i2c_reset()'.
Commit updated! |
+1, thanks! LGTM |
Description
BTF
flag ini2c_stop()
handle->Instance
to functioni2c_reset()
Status
READY