-
Notifications
You must be signed in to change notification settings - Fork 3k
Allow NC pins to be instantiated on Silicon Labs platforms #10482
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
Conversation
@stevew817, thank you for your changes. |
This goes further than necessary - the gpio objects have to be instantiatable with NC, so we can use If you do want to add code to intercept the "using NC" case, that's fine, if you don't mind the ROM cost, but I'd still prefer the assert was there too - easier to catch invalid uses in non-release builds than silently ignoring. Think of The latest C++ standards are getting quite big on syntactically distinguishing "optional" values from compulsory ones - encoding "non-null" into the types. Conceivably I can see something similar happening in the Mbed OS APIs, but that would be done at the C++ I'll make a PR to update |
@stevew817 Please review #10489 |
@0xc0170 reviewed. |
#10489 fixed all targets except for efm32, since there was already a pr for those (this one). |
BTW, I haven't approved this yet because still waiting for response to my previous comment. |
@kjbracey-arm In response to your question, I don't have an issue with the slightly increased footprint. On a develop profile, the footprint is actually reduced because of the assert removal. I can update it once more to accommodate your remarks and move back to asserts as per your changes in #10489, if you feel that is required to approve this. Honestly, given the hard breakage that occurred with the SPI change and is already released, I had expected this to be fasttracked into a patch release. |
There are 4 permutations of the two choices "always check and ignore use of NC?" and "check and assert if NC used?" for the calls that are not valid with NC, and this is the only one of the four I'm not happy with - the one that bothers to have a check but never uses it to report that it saw the programming error. I don't want target code that makes an active effort to conceal bugs in Mbed OS application/driver code, as it's unhelpful if someone is trying to develop portable code on that target. The only actual fix required here is one-line removal of the |
Keep asserting on trying to use an NC-instantiated object for anything else, though.
252b260
to
365f364
Compare
@kjbracey-arm this should do it, right? |
Thanks! @0xc0170 can you get this in asap, as the other platforms have just had theirs merged? |
CI started |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Description
Allow gpio objects to be instantiated with NC on Silicon Labs targets. Although this is nowhere defined, it seems to be the de-facto standard to allow this on mbed.
Closes #7862
Closes #10191
Pull request type
Reviewers
Release Notes