Minor cleanup w/r/t LEDs

This commit is contained in:
Scott Lahteine
2020-08-23 23:57:51 -05:00
parent f473145d42
commit 9d2241efe7
16 changed files with 34 additions and 43 deletions

View File

@ -34,18 +34,19 @@
#include "../../feature/leds/leds.h"
#if ENABLED(LED_COLOR_PRESETS)
void menu_led_presets() {
START_MENU();
#if LCD_HEIGHT > 2
STATIC_ITEM(MSG_LED_PRESETS, SS_DEFAULT|SS_INVERT);
#endif
BACK_ITEM(MSG_LED_CONTROL);
ACTION_ITEM(MSG_SET_LEDS_WHITE, leds.set_white);
ACTION_ITEM(MSG_SET_LEDS_RED, leds.set_red);
ACTION_ITEM(MSG_SET_LEDS_WHITE, leds.set_white);
ACTION_ITEM(MSG_SET_LEDS_RED, leds.set_red);
ACTION_ITEM(MSG_SET_LEDS_ORANGE, leds.set_orange);
ACTION_ITEM(MSG_SET_LEDS_YELLOW,leds.set_yellow);
ACTION_ITEM(MSG_SET_LEDS_GREEN, leds.set_green);
ACTION_ITEM(MSG_SET_LEDS_BLUE, leds.set_blue);
ACTION_ITEM(MSG_SET_LEDS_YELLOW, leds.set_yellow);
ACTION_ITEM(MSG_SET_LEDS_GREEN, leds.set_green);
ACTION_ITEM(MSG_SET_LEDS_BLUE, leds.set_blue);
ACTION_ITEM(MSG_SET_LEDS_INDIGO, leds.set_indigo);
ACTION_ITEM(MSG_SET_LEDS_VIOLET, leds.set_violet);
END_MENU();
@ -83,11 +84,10 @@
#endif
#endif
void menu_led() {
START_MENU();
BACK_ITEM(MSG_MAIN);
#if ENABLED(LED_CONTROL_MENU)
bool led_on = leds.lights_on;
EDIT_ITEM(bool, MSG_LEDS, &led_on, leds.toggle);
@ -97,6 +97,7 @@ void menu_led() {
#endif
SUBMENU(MSG_CUSTOM_LEDS, menu_led_custom);
#endif
//
// Set Case light on/off/brightness
//

View File

@ -81,7 +81,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
#endif
void MarlinUI::buzz(const long duration, const uint16_t freq) {
#if ENABLED(PCA9632_BUZZER)
pca9632_buzz(duration, freq);
PCA9632_buzz(duration, freq);
#elif USE_BEEPER
buzzer.tone(duration, freq);
#endif