-
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
Bring in improved HAL APIs to master #7009
Bring in improved HAL APIs to master #7009
Conversation
@ARMmbed/mbed-os-maintainers please run ci. |
/morph build |
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.
What are the coverage numbers for these features (how much target coverage percentage ?) ?
Build : FAILUREBuild number : 2147 |
Reviewing build failures now |
Resolved both errors, tested locally , should build now and all be good 🤞 /morph build |
Build : FAILUREBuild number : 2149 |
One error missed (gcc somehow passed 😕 ), restarting /morph build |
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.
This PR is pretty big so I'll slip my reviews so I don't loose pending comments.
TESTS/mbed_drivers/lp_timer/main.cpp
Outdated
* */ | ||
#define DELTA_US(delay_ms) (500 + delay_ms * US_PER_MSEC / 20) | ||
#define DELTA_MS(delay_ms) (1 + (delay_ms * US_PER_MSEC / 20 / US_PER_MSEC)) | ||
#define DELTA_S(delay_ms) (0.000500f + (((float)delay_ms) / MSEC_PER_SEC / 20)) |
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.
As macro in C (and c++) are basic text subtitution, it is usually good practice to wrap the macro's argument between brackets.
If you pass to DELTA_US
an expression such as a_var + something_else
you may not obtain what you expect.
#define DELTA_US(delay_ms) (500 + (delay_ms) * US_PER_MSEC / 20)
Also, as this is in test it does not really impact the final code but in debug mode, double division may not get optimised away and (1 + (delay_ms * US_PER_MSEC / 20 / US_PER_MSEC))
will try to run 2 divisions.
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.
From what I see on GH these three macros are defined twice (the other definitions are line 63).
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.
And worse than that they are actually defined differently!!
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.
Nice catch. I agree with the first part, but since arithmetic operations are not passed to the macro its not a critical error.
Unfortunately the second bug is unsafe. It looks like I forgot to remove old definitions 😢 .
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.
Can you add a commit fixing this?
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.
@bulislaw needs to add you as collaborator to his repo.
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.
I can help, got that branch locally, point me to a commit and I'll cherry pick and push
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.
Fix can be found here:
mprse@83a0146
Tested on NRF51_DK
, NRF52_DK
boards and GCC_ARM
.
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.
@mprse actually there are arithmetic in mbed_drivers/timer/main.cpp#L724
It is ok as it is just division but for maintainability it might create non-obvious bugs.
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.
Provided fix adds brackets.
Build : SUCCESSBuild number : 2150 Triggering tests/morph test |
TESTS/mbed_drivers/lp_timer/main.cpp
Outdated
* */ | ||
#define DELTA_US(delay_ms) (500 + delay_ms * US_PER_MSEC / 20) | ||
#define DELTA_MS(delay_ms) (1 + (delay_ms * US_PER_MSEC / 20 / US_PER_MSEC)) | ||
#define DELTA_S(delay_ms) (0.000500f + (((float)delay_ms) / MSEC_PER_SEC / 20)) |
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.
And worse than that they are actually defined differently!!
Test : FAILUREBuild number : 1943 |
I have noticed that there is some inconsistency on this branch |
|
@0xc0170 Sorry, but to mention that Deepika came online and merged those two PRs, unblocking this one. |
Build : SUCCESSBuild number : 2171 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 1795 |
Test : FAILUREBuild number : 1959 |
78eb673
to
4ae6491
Compare
/morph build |
Build : SUCCESSBuild number : 2172 Triggering tests/morph test |
Looking into the sleep issue. |
Test : SUCCESSBuild number : 1960 |
Exporter Build : SUCCESSBuild number : 1796 |
@ithinuel Were your comments addressed ? If not, are they blocking ? |
@0xc0170 One is awaiting an answer from @SenRamakri but I don't think they are blocking |
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.
The documentation related comments can be addressed later.
Fix for http://mbed-os-logs.s3-website-us-west-1.amazonaws.com/?prefix=logs/7009/1959/FAIL/NRF51_DK/ can be found here: |
Description
This one PR to rule them all (tm) combines:
#6996
#6995
#6994
@ARMmbed/mbed-os-maintainers
Pull request type