Skip to content
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

Merged
merged 156 commits into from
May 28, 2018

Conversation

bulislaw
Copy link
Member

Description

This one PR to rule them all (tm) combines:
#6996
#6995
#6994

@ARMmbed/mbed-os-maintainers

Pull request type

[ ] Fix
[ ] Refactor
[ ] New target
[x] Feature
[ ] Breaking change

@bulislaw
Copy link
Member Author

bulislaw commented May 25, 2018

@ARMmbed/mbed-os-maintainers please run ci.
@ithinuel @jamesbeyond @0xc0170 could you keep an eye on that and try to fix it if somethings goes wrong.

@0xc0170
Copy link
Contributor

0xc0170 commented May 25, 2018

/morph build

@0xc0170 0xc0170 requested a review from a team May 25, 2018 07:55
0xc0170
0xc0170 previously approved these changes May 25, 2018
Copy link
Contributor

@0xc0170 0xc0170 left a 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 ?) ?

@mbed-ci
Copy link

mbed-ci commented May 25, 2018

Build : FAILURE

Build number : 2147
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7009/

@0xc0170
Copy link
Contributor

0xc0170 commented May 25, 2018

Reviewing build failures now

@0xc0170
Copy link
Contributor

0xc0170 commented May 25, 2018

Resolved both errors, tested locally , should build now and all be good 🤞

/morph build

@mbed-ci
Copy link

mbed-ci commented May 25, 2018

Build : FAILURE

Build number : 2149
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7009/

@0xc0170
Copy link
Contributor

0xc0170 commented May 25, 2018

One error missed (gcc somehow passed 😕 ), restarting

/morph build

Copy link
Member

@ithinuel ithinuel left a 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.

* */
#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))
Copy link
Member

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.

Copy link
Member

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).

Copy link
Contributor

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!!

Copy link
Contributor

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 😢 .

Copy link
Contributor

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?

Copy link
Member

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.

Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provided fix adds brackets.

@mbed-ci
Copy link

mbed-ci commented May 25, 2018

Build : SUCCESS

Build number : 2150
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7009/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@adbridge adbridge self-requested a review May 25, 2018 12:37
* */
#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))
Copy link
Contributor

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!!

@adbridge adbridge added risk: R and removed risk: A labels May 25, 2018
@mbed-ci
Copy link

mbed-ci commented May 25, 2018

@mprse
Copy link
Contributor

mprse commented May 25, 2018

I have noticed that there is some inconsistency on this branch DEVICE_LOWPOWERTIMER should be replaced with DEVICE_LPTICKER in all source files and tests.

@mprse
Copy link
Contributor

mprse commented May 25, 2018

tests-mbed_hal-rtc_reset has failed on NRF52_DK board (all compilers), but as far as I remember RTC support should be disabled for this board (since it can not persist time over the reset).

@cmonr
Copy link
Contributor

cmonr commented May 27, 2018

@0xc0170 Sorry, but to mention that Deepika came online and merged those two PRs, unblocking this one.

@mbed-ci
Copy link

mbed-ci commented May 28, 2018

Build : SUCCESS

Build number : 2171
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7009/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented May 28, 2018

@mbed-ci
Copy link

mbed-ci commented May 28, 2018

@bulislaw bulislaw force-pushed the merge_feature_branches_for_5.9 branch from 78eb673 to 4ae6491 Compare May 28, 2018 04:31
@bulislaw
Copy link
Member Author

/morph build

@mbed-ci
Copy link

mbed-ci commented May 28, 2018

Build : SUCCESS

Build number : 2172
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7009/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mprse
Copy link
Contributor

mprse commented May 28, 2018

Looking into the sleep issue.

@mbed-ci
Copy link

mbed-ci commented May 28, 2018

@mbed-ci
Copy link

mbed-ci commented May 28, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented May 28, 2018

@ithinuel Were your comments addressed ? If not, are they blocking ?

@ithinuel
Copy link
Member

@0xc0170 One is awaiting an answer from @SenRamakri but I don't think they are blocking
Do you need me to change the review's status ?

Copy link
Member

@ithinuel ithinuel left a 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.

@mprse
Copy link
Contributor

mprse commented May 28, 2018

Fix for http://mbed-os-logs.s3-website-us-west-1.amazonaws.com/?prefix=logs/7009/1959/FAIL/NRF51_DK/ can be found here:

mprse@eeab68d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.