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

fix M81 issue #25612

Closed
wants to merge 2 commits into from
Closed

fix M81 issue #25612

wants to merge 2 commits into from

Conversation

ellensp
Copy link
Contributor

@ellensp ellensp commented Apr 1, 2023

Description

M81 has been reported to no longer work.
A fix was also provided
This PR adds the fix.

This was in the code prior to 22304

Benefits

M81 works again

Related Issues

#23396 (comment)
#22304

@thinkyhead
Copy link
Member

thinkyhead commented Apr 7, 2023

Did you confirm this yourself?

This fix is strange. Marlin already does this in setup():

  #if ENABLED(PSU_CONTROL)
    SETUP_RUN(powerManager.init());
  #endif

…which calls…

void Power::init() {
  psu_on = ENABLED(PSU_DEFAULT_OFF);              // Set opposite state to get full power_off/on
  TERN(PSU_DEFAULT_OFF, power_off(), power_on());
}

Therefore:

  • If you have PSU_DEFAULT_OFF enabled it causes psu_on to be initialized as true and then power_off() is called which turns off the power and sets it false.
  • If you have PSU_DEFAULT_OFF disabled it causes psu_on to be initialized as false and then power_on() is called which turns on the power and sets it true.

If you don't enable PSU_CONTROL at all then various things are turned off by M81, but there is no psu_on flag and control of the PSU is not available.

@thinkyhead thinkyhead force-pushed the bugfix-2.1.x branch 3 times, most recently from de391db to 0f34163 Compare April 12, 2023 05:14
@ellensp
Copy link
Contributor Author

ellensp commented Apr 16, 2023

Tested on ramps, works without patch

@ellensp ellensp closed this Apr 16, 2023
@ellensp ellensp deleted the patch-2 branch April 16, 2023 01:48
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.

None yet

2 participants