-
Notifications
You must be signed in to change notification settings - Fork 47
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
General Improvements #38
Conversation
Made data paramater to brzo_i2c_write() const Add brzo_i2c_get_error() function
Many thanks! I will have a look at it ASAP! |
Also, I don't think you keep track of working I2C devices, but I've been doing my testing with an SSD1306 128x64 display and MMA8452Q accelerometer. |
Initialize Variable to zero
I've accepted the initialization of variables. But did not go for the |
Thanks for accepting initialization. I understand not accepting I'm still not sure about the error code. Only
Do you think users would want to detect errors earlier than |
Well, the idea is that you group any number of "unseful" i2c commands (i.e. reads/writes) together into a (brzo i2c) transaction. And on the level of such a transaction you can then tell wether it has failed or succeeded by evaluating the error code returned by However, I agree, for debugging a long transaction with many reads/writes, it could be useful to have the error code already inside the transaction. Because otherwise you might not know wich of the commands actually failed. |
Initialize variables to 0 to fix warnings from
-Wuninitialized
. I don't know if the variables were initialized within the assembly, but GCC didn't know either, and was throwing a bunch of warnings. I figured 0 is a safe value to start with.Made
data
parameter tobrzo_i2c_write()
const
. This data should not be modified by the function, soconst
seems appropriate.Add
brzo_i2c_get_error()
function. I used this to debug errors from my main program.My project uses ESP NON-OS SDK 3.0.1, and brzo_i2c works fine, so I added a note to README.md