Browse Source

Small LED code reorganization (#12929)

pull/1/head
Giuliano Zaro 6 years ago
committed by Scott Lahteine
parent
commit
7bb5d4bfe8
  1. 12
      Marlin/src/Marlin.cpp
  2. 1
      Marlin/src/feature/caselight.cpp
  3. 8
      Marlin/src/feature/leds/leds.cpp

12
Marlin/src/Marlin.cpp

@ -860,16 +860,10 @@ void setup() {
leds.setup(); leds.setup();
#endif #endif
#if ENABLED(RGB_LED) || ENABLED(RGBW_LED)
SET_OUTPUT(RGB_LED_R_PIN);
SET_OUTPUT(RGB_LED_G_PIN);
SET_OUTPUT(RGB_LED_B_PIN);
#if ENABLED(RGBW_LED)
SET_OUTPUT(RGB_LED_W_PIN);
#endif
#endif
#if HAS_CASE_LIGHT #if HAS_CASE_LIGHT
#if DISABLED(CASE_LIGHT_USE_NEOPIXEL)
SET_OUTPUT(CASE_LIGHT_PIN);
#endif
update_case_light(); update_case_light();
#endif #endif

1
Marlin/src/feature/caselight.cpp

@ -69,7 +69,6 @@ void update_case_light() {
#else // !CASE_LIGHT_USE_NEOPIXEL #else // !CASE_LIGHT_USE_NEOPIXEL
SET_OUTPUT(CASE_LIGHT_PIN);
if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN))
analogWrite(CASE_LIGHT_PIN, n10ct); analogWrite(CASE_LIGHT_PIN, n10ct);
else { else {

8
Marlin/src/feature/leds/leds.cpp

@ -60,6 +60,14 @@
LEDLights leds; LEDLights leds;
void LEDLights::setup() { void LEDLights::setup() {
#if ENABLED(RGB_LED) || ENABLED(RGBW_LED)
SET_OUTPUT(RGB_LED_R_PIN);
SET_OUTPUT(RGB_LED_G_PIN);
SET_OUTPUT(RGB_LED_B_PIN);
#if ENABLED(RGBW_LED)
SET_OUTPUT(RGB_LED_W_PIN);
#endif
#endif
#if ENABLED(NEOPIXEL_LED) #if ENABLED(NEOPIXEL_LED)
setup_neopixel(); setup_neopixel();
#endif #endif

Loading…
Cancel
Save