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] "power.cpp" fails to compile if board does not have PS_ON_PIN #22353

Closed
marciot opened this issue Jul 13, 2021 · 6 comments
Closed

[BUG] "power.cpp" fails to compile if board does not have PS_ON_PIN #22353

marciot opened this issue Jul 13, 2021 · 6 comments

Comments

@marciot
Copy link
Contributor

marciot commented Jul 13, 2021

Did you test the latest bugfix-2.0.x code?

Yes, and the problem still exists.

Bug Description

The "power.cpp" file generates compilation errors if PS_ON_PIN and PSU_POWERUP_DELAY if the board does not support the feature.

It seems like the "power.cpp" file needs a guard condition on whether that feature is available.

Bug Timeline

No response

Expected behavior

No response

Actual behavior

No response

Steps to Reproduce

No response

Version of Marlin Firmware

bugfix-2.0.x branch

Printer model

Unreleased Prototype Printer

Electronics

Ultimachine Archim 2 board

Add-ons

No response

Your Slicer

No response

Host Software

No response

Additional information & file uploads

Configuration files:

configuration.zip

Compilation errors:

compilation_errors.txt

@slowbro
Copy link
Member

slowbro commented Jul 14, 2021

I'm not able to reproduce this with your configs (in fact, the configs fail compilation for a number of other reasons). I tried to replicate it in other ways, i.e. enabling PSU_CONTROL with PS_ON_PIN unset, or set to -1, and it was properly caught with a error: #error "PSU_CONTROL requires PS_ON_PIN.". Make sure that your platformio.ini & ini/features files are up to date, as the most recent version excludes the power.cpp file unless PSU_CONRTOL is enabled.

@marciot
Copy link
Contributor Author

marciot commented Jul 14, 2021

@slobro: Thank you for this information, you actually explained the situation and gave me the hint I needed on how to fix it.

I am using the Makefile for compilation, not platform.io, so every file gets compiled. This was the way Marlin used to work prior to the switch to platform.io. Because few people use the Makefile anymore, the proper #ifdef guards often aren't updated.

I think I am the only one who uses or tests that, so I'll create a PR to take care of the problem.

@slowbro
Copy link
Member

slowbro commented Jul 14, 2021

Ah, that makes sense. Glad I could point you in the right direction!

@slobro
Copy link

slobro commented Jul 14, 2021 via email

@thisiskeithb
Copy link
Member

Fixed in #22361

@github-actions
Copy link

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 Sep 13, 2021
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

4 participants