-
Notifications
You must be signed in to change notification settings - Fork 3k
Add pin speed controlling interface #11368
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
@ua1arn, thank you for your changes. |
This fixes #11362 @ARMmbed/team-st-mcd |
targets/TARGET_STM/pinmap.c
Outdated
@@ -79,13 +80,21 @@ void pin_function(PinName pin, int data) | |||
#if defined (TARGET_STM32F1) | |||
if (mode == STM_PIN_OUTPUT) { | |||
#endif | |||
|
|||
switch (speed) | |||
{ |
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 please fix formatting, follow the one in the file
switch (speed):
case VALUE:
for 87-91 LL_ lines: they should move to be aligned with case (4 spaces to the right).
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.
done
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.
line 84 , move {
to the line above (=attached).
line 87 : #if
- preprocessor always at the beginning of the line (not aligned).
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.
done
Otherwise looks fine to me. Thanks for the fix! Waiting for @ARMmbed/team-st-mcd review |
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.
Looks fine to me now, however if you can squash all commits into one, it would be good
Sorry, I can not doing this operation... This is a git command ? |
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.
Hi
just reviewed the proposal - looks good to me.
Just a proposal for renaming and few padding issues to solve I think
targets/TARGET_STM/PinNamesTypes.h
Outdated
(((CHAN) & STM_PIN_CHAN_MASK) << STM_PIN_CHAN_SHIFT) |\ | ||
(((INV) & STM_PIN_INV_MASK) << STM_PIN_INV_SHIFT)) | ||
|
||
#define STM_PIN_DEFINE_EXT2(FUNC_OD, PUPD, AFNUM, CHAN, INV, SPEEDV) \ |
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.
Coud be STM_PIN_DEFINE_SPEED_EXT instead of _EXT2 ?
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.
It's addressed to me?
change names up to you reasons,,
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 cannot edit your Pull request. The idea is to all review together your proposal and ask you to take also our feedback into account, so that your code will be in master branch of mbed-os in the end and everyone can benefit for this improvement. It's just a minor change, so if you do it all your target code will also be compatible with it when it gets merged
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.
done
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.
Edits from maintainers are enabled for this pull request, Or, if I should make changes by own - what should I do?
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.
Please do changes as requested!
targets/TARGET_STM/PinNamesTypes.h
Outdated
@@ -90,15 +90,30 @@ extern "C" { | |||
#define STM_PIN_ANALOG_CONTROL(X) (((X) >> STM_PIN_AN_CTRL_SHIFT) & STM_PIN_AN_CTRL_MASK) | |||
|
|||
#define STM_PIN_DEFINE(FUNC_OD, PUPD, AFNUM) ((int)(FUNC_OD) |\ | |||
((PUPD & STM_PIN_PUPD_MASK) << STM_PIN_PUPD_SHIFT) |\ | |||
((AFNUM & STM_PIN_AFNUM_MASK) << STM_PIN_AFNUM_SHIFT)) | |||
((STM_PIN_SPEED_MASK & STM_PIN_SPEED_MASK) << STM_PIN_SPEED_SHIFT) |\ |
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.
seems like there is a padding issue
targets/TARGET_STM/PinNamesTypes.h
Outdated
(((AFNUM) & STM_PIN_AFNUM_MASK) << STM_PIN_AFNUM_SHIFT)) | ||
|
||
#define STM_PIN_DEFINE_SPEED(FUNC_OD, PUPD, AFNUM, SPEEDV) ((int)(FUNC_OD) |\ | ||
(((SPEEDV) & STM_PIN_SPEED_MASK) << STM_PIN_SPEED_SHIFT) |\ |
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.
padding issue ?
targets/TARGET_STM/PinNamesTypes.h
Outdated
(((INV) & STM_PIN_INV_MASK) << STM_PIN_INV_SHIFT)) | ||
|
||
#define STM_PIN_DEFINE_EXT2(FUNC_OD, PUPD, AFNUM, CHAN, INV, SPEEDV) \ | ||
((int)(FUNC_OD) |\ |
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.
padding issue ?
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've noticed in one file tabs, so all changes in this PR should be checked and tabs replaced by spaces
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.
Should I reformat original text too?
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 best would be to only format what you are changing (it should be consistent, if there are issues, you can create an issue or new commit to address them).
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.
files updated
@jeromecoutant will be worth a quick non-regression test like CI-shield test suite |
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.
Thanks a lot for your contribution !
CI started |
Because of 5.14.0-rc1 CI jobs, we aborted CI job here. We will restart once 5.14.0rc1 is ready. |
Test run: FAILEDSummary: 4 of 11 test jobs failed Failed test jobs:
|
CI restarted |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Description
Adding pin speed limit control for STM32-based targets. No other changes need, transparent for exiting code.
Pull request type
Reviewers
Release Notes