[riot-notifications] [RIOT-OS/RIOT] periph/i2c: return values of i2c_aquire and i2c_release (#10673)
notifications at github.com
Thu Jan 24 10:42:59 CET 2019
I'm against removing it, and the rational wit `i2c_init` does not hold (@kaspar030) when considering the following:
1. `i2c_init` is (supposed to be) called by `periph_init`
2. a driver (e.g. sensor) requiring I2C should (IIRC) call `i2c_init` (anymore) as per 1. and also because it could interfere with other devices using the same bus
3. considering 1. and 2. a driver cannot induce that the I2C bus it wants to use, that is `acquire` is valid
hence, the return value makes sense, specifically considering that the (future, far away) goal is to allow developers to link against RIOT (libs) without recompiling core parts, such as CPU and periph driver implementations.
True is, that many driver do not verify the return code of `i2c_acquire` and simply work on with the rest of their code, which is wrong according to the API spec (at least to me).
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications