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

Typo: MAX_ADC_RESOLUTION should be MAX_PWM_RESOLUTION ? #1378

Closed
AndrewBCN opened this issue May 1, 2021 · 2 comments · Fixed by #1379
Closed

Typo: MAX_ADC_RESOLUTION should be MAX_PWM_RESOLUTION ? #1378

AndrewBCN opened this issue May 1, 2021 · 2 comments · Fixed by #1379
Labels
bug 🐛 Something isn't working
Milestone

Comments

@AndrewBCN
Copy link

Hello,
in source file:
https://github.com/stm32duino/Arduino_Core_STM32/blob/master/cores/arduino/wiring_analog.c

line 123
_internalWriteResolution = MAX_ADC_RESOLUTION;

should (?) be
_internalWriteResolution = MAX_PWM_RESOLUTION;

since the max ADC resolution is irrelevant for the analogWrite function?

@fpistm fpistm added this to the 2.x.x milestone May 3, 2021
@fpistm fpistm added the bug 🐛 Something isn't working label May 3, 2021
@fpistm
Copy link
Member

fpistm commented May 3, 2021

Hi @AndrewBCN
Yes you are right.
Thank you for spotting this 👍

Hopefully MAX_ADC_RESOLUTION and MAX_PWM_RESOLUTION are equal in several case so no issue to use the analog write apis.

fpistm added a commit to fpistm/Arduino_Core_STM32 that referenced this issue May 3, 2021
@AndrewBCN
Copy link
Author

Yes, I spotted this by chance, while looking at how to set PWM resolution to 16 bits (the default is 8 bits, as you know). And MAX_ADC_RESOLUTION is 12 bits for the STM32F411CEU6, so that was a problem for me.

fpistm added a commit that referenced this issue May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants