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

[BUG] Static Assert shouldn't be used ON STM32 when verifying for PWM pin #15858

Closed
LinoBarreca opened this issue Nov 9, 2019 · 4 comments
Closed

Comments

@LinoBarreca
Copy link
Contributor

Description

On STM32 Platform every PIN can be "PWM" because they are handled through a timer if they are defined in the variant.
The macro PWM_PIN expands to digitalPinHasPWM(P) (which is correct)
Problem here is that you can't check it at compile time, (with a static assert)

Steps to Reproduce

Marlin/src/HAL/HAL_STM32/../../inc/SanityCheck.h:1854:5: error: non-constant condition for static assertion static_assert(PWM_PIN(E0_AUTO_FAN_PIN), "E0" AF_ERR_SUFF);

Expected behavior: compile fine

Actual behavior:

In file included
from Marlin/src/HAL/HAL_STM32/../../inc/MarlinConfig.h:38:0,
from Marlin/src/HAL/HAL_STM32/timers.h:25,
from Marlin/src/HAL/HAL_STM32/HAL.h:99,
from Marlin/src/HAL/HAL_STM32/HAL.cpp:26: Marlin/src/HAL/HAL_STM32/../../inc/SanityCheck.h:1854:5: error: non-constant condition for static assertion static_assert(PWM_PIN(E0_AUTO_FAN_PIN), "E0" AF_ERR_SUFF);

Additional Information

this shouldn't be a static assert on STM32.

@LinoBarreca LinoBarreca changed the title [BUG] Static Assert shouldn't be used ON STM32 [BUG] Static Assert shouldn't be used ON STM32 when verifying for PWM pin Nov 9, 2019
@LinoBarreca
Copy link
Contributor Author

this was found here
#15857

@shitcreek
Copy link
Contributor

Can we close this one?

@LinoBarreca
Copy link
Contributor Author

Close the issue? yes. 'cause it's a duplicate of this #15362

@github-actions
Copy link

github-actions bot commented Jul 4, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants