-
-
Notifications
You must be signed in to change notification settings - Fork 178
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
Fix Read/Write in System.Device.I2c #1754
Conversation
Hi @AdrianSoundy, I'm nanoFramework bot. A human will be reviewing it shortly. 😉 |
Automated fixes for code style.
@AdrianSoundy there are issues with the code style on the source files. Make sure you are using the project code style. Check the details here. |
…b-b570-4a7f-b557-ae9347862517' into system-i2c
Notes for future reference. The root cause for this "misbehaviour" is that To be syntactically correct we would have to:
The fix in this PR works because the cc @Ellerbach @krwq |
Yes, that's the expected behavior. The way to check if there is something is on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With no further comments, let's have this merged.
Thanks for the quick fix!
Description
Fixes issues when a null parameter is passed into nativeTransmit() method.
As the parameter is a SpanByte structure we don't get a null parameter but a SpanByte structure with a null array
Also found an issue with the I2cTransferResult return type. If Windows.Devices.I2c assembly not loaded then it couldn't find type.
Added new I2cTransferResult for System.Device.I2C and renamed variable for one used by Windows.Devices.I2c
m_I2cTransferResult -> m_I2cTransferResult_old.
The Windows.Devices.I2c I2cTransferResult can be removed once no longer used.
Motivation and Context
How Has This Been Tested?
Tested on ESP32 only with nf_ssd1306 supplied test program for writes
and a BMP280 test program for reads
Types of changes
Checklist: