♻️ Consolidate PSU_CONTROL (#22304)

This commit is contained in:
Katelyn Schiesser
2021-07-11 22:13:58 -07:00
committed by GitHub
parent 37cf94b888
commit c8ee056cc6
10 changed files with 212 additions and 177 deletions

View File

@@ -30,6 +30,10 @@
#include "menu_item.h"
#if ENABLED(PSU_CONTROL)
#include "../../feature/power.h"
#endif
#if ENABLED(LED_CONTROL_MENU)
#include "../../feature/leds/leds.h"
@@ -125,12 +129,7 @@ void menu_led() {
BACK_ITEM(MSG_MAIN);
#if ENABLED(LED_CONTROL_MENU)
#if ENABLED(PSU_CONTROL)
extern bool powersupply_on;
#else
constexpr bool powersupply_on = true;
#endif
if (powersupply_on) {
if (TERN1(PSU_CONTROL, powerManager.psu_on)) {
editable.state = leds.lights_on;
EDIT_ITEM(bool, MSG_LEDS, &editable.state, leds.toggle);
}