Skip to content

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

Merged
merged 11 commits into from
Sep 4, 2019
Merged

Add pin speed controlling interface #11368

merged 11 commits into from
Sep 4, 2019

Conversation

ua1arn
Copy link

@ua1arn ua1arn commented Aug 28, 2019

Description

Adding pin speed limit control for STM32-based targets. No other changes need, transparent for exiting code.

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[x] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

Release Notes

@ciarmcom ciarmcom requested a review from a team August 28, 2019 21:00
@ciarmcom
Copy link
Member

@ua1arn, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

@jeromecoutant
Copy link
Collaborator

This fixes #11362

@ARMmbed/team-st-mcd

@0xc0170 0xc0170 requested a review from a team August 29, 2019 07:49
@@ -79,13 +80,21 @@ void pin_function(PinName pin, int data)
#if defined (TARGET_STM32F1)
if (mode == STM_PIN_OUTPUT) {
#endif

switch (speed)
{
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 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).

Copy link
Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

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

Copy link
Author

Choose a reason for hiding this comment

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

done

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 29, 2019

Otherwise looks fine to me. Thanks for the fix!

Waiting for @ARMmbed/team-st-mcd review

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.

Looks fine to me now, however if you can squash all commits into one, it would be good

@ua1arn
Copy link
Author

ua1arn commented Sep 2, 2019

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 ?

Copy link
Contributor

@LMESTM LMESTM left a 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

(((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) \
Copy link
Contributor

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 ?

Copy link
Author

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

Copy link
Contributor

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

Copy link
Author

@ua1arn ua1arn Sep 2, 2019

Choose a reason for hiding this comment

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

done

Copy link
Author

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?

Copy link
Contributor

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!

@@ -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) |\
Copy link
Contributor

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

(((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) |\
Copy link
Contributor

Choose a reason for hiding this comment

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

padding issue ?

(((INV) & STM_PIN_INV_MASK) << STM_PIN_INV_SHIFT))

#define STM_PIN_DEFINE_EXT2(FUNC_OD, PUPD, AFNUM, CHAN, INV, SPEEDV) \
((int)(FUNC_OD) |\
Copy link
Contributor

Choose a reason for hiding this comment

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

padding issue ?

Copy link
Contributor

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

Copy link
Author

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?

Copy link
Contributor

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

Copy link
Author

Choose a reason for hiding this comment

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

files updated

@LMESTM
Copy link
Contributor

LMESTM commented Sep 2, 2019

@jeromecoutant will be worth a quick non-regression test like CI-shield test suite

Copy link
Contributor

@LMESTM LMESTM left a 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 !

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 3, 2019

CI started

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 3, 2019

Because of 5.14.0-rc1 CI jobs, we aborted CI job here. We will restart once 5.14.0rc1 is ready.

@mbed-ci
Copy link

mbed-ci commented Sep 3, 2019

Test run: FAILED

Summary: 4 of 11 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_mbed2-build-GCC_ARM
  • jenkins-ci/mbed-os-ci_mbed2-build-IAR
  • jenkins-ci/mbed-os-ci_mbed2-build-ARM
  • jenkins-ci/mbed-os-ci_greentea-test

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 4, 2019

CI restarted

@mbed-ci
Copy link

mbed-ci commented Sep 4, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 2
Build artifacts

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.

6 participants