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

stm32: GPIO driver implementation uses magic numbers #4880

Closed
jnohlgard opened this issue Feb 23, 2016 · 10 comments
Closed

stm32: GPIO driver implementation uses magic numbers #4880

jnohlgard opened this issue Feb 23, 2016 · 10 comments
Assignees
Labels
Area: drivers Area: Device drivers Platform: ARM Platform: This PR/issue effects ARM-based platforms State: stale State: The issue / PR has no activity for >185 days Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Comments

@jnohlgard
Copy link
Member

Example:

SYSCFG->EXTICR[pin_num >> 2] &= ~(0xf << ((pin_num & 0x03) * 4));

These can lead to hard to find bugs and should be changed to preprocessor constants.

@jnohlgard jnohlgard added Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: drivers Area: Device drivers ugly labels Feb 23, 2016
@PeterKietzmann
Copy link
Member

That looks like a task for @A-Paul :-) ???

@A-Paul
Copy link
Member

A-Paul commented Mar 10, 2016

@PeterKietzmann, do you want me to be assigned to this issue?

@PeterKietzmann
Copy link
Member

@A-Paul no matter about the assignment. IIRC you once wanted to start an offensive to eliminate all magic numbers :-)

@A-Paul
Copy link
Member

A-Paul commented Mar 16, 2016

@PeterKietzmann, in my opinion the use of numeric literals leads to some problems and should be avoided. Although I'm not feeling to be in charge of cleaning them up... ;)

@A-Paul
Copy link
Member

A-Paul commented Mar 16, 2016

This issue has been announced in #4862 as a reminder for @haukepetersen. Are you going to address this?

@DipSwitch
Copy link
Member

I'm gonna regret this... But I think I know fix the magic numbers using the STM32 header files... Only for STM ofcourse =)

@haukepetersen
Copy link
Contributor

I am not going to address this anytime soon, as I personally don't have that strong opinions against magic numbers at certain places...

@miri64 miri64 added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation and removed quality defect labels Oct 1, 2018
@stale
Copy link

stale bot commented Aug 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Aug 10, 2019
@stale stale bot closed this as completed Sep 10, 2019
@aabadie
Copy link
Contributor

aabadie commented Sep 10, 2019

This is still an issue and could be fixed with new CMSIS headers. I think all STM32 cpu uses the new CMSIS versions now.

@aabadie aabadie reopened this Sep 10, 2019
@stale stale bot removed the State: stale State: The issue / PR has no activity for >185 days label Sep 10, 2019
@stale
Copy link

stale bot commented Mar 13, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Mar 13, 2020
@stale stale bot closed this as completed Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers Platform: ARM Platform: This PR/issue effects ARM-based platforms State: stale State: The issue / PR has no activity for >185 days Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

No branches or pull requests

8 participants