Skip to content

Commit 6444761

Browse files
committed
Merge branch 'bugfix-2.1.x' into HEVO-BTT-SKR-1.3
2 parents 542cc52 + 202114c commit 6444761

File tree

91 files changed

+2244
-2396
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+2244
-2396
lines changed

Marlin/Configuration.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,11 +1867,18 @@
18671867
//#define RGB_LED
18681868
//#define RGBW_LED
18691869

1870-
#if ENABLED(RGB_LED) || ENABLED(RGBW_LED)
1871-
#define RGB_LED_R_PIN 34
1872-
#define RGB_LED_G_PIN 43
1873-
#define RGB_LED_B_PIN 35
1874-
#define RGB_LED_W_PIN -1
1870+
#if EITHER(RGB_LED, RGBW_LED)
1871+
//#define RGB_LED_R_PIN 34
1872+
//#define RGB_LED_G_PIN 43
1873+
//#define RGB_LED_B_PIN 35
1874+
//#define RGB_LED_W_PIN -1
1875+
#endif
1876+
1877+
#if ANY(RGB_LED, RGBW_LED, PCA9632)
1878+
//#define RGB_STARTUP_TEST // For PWM pins, fade between all colors
1879+
#if ENABLED(RGB_STARTUP_TEST)
1880+
#define RGB_STARTUP_TEST_INNER_MS 10 // (ms) Reduce or increase fading speed
1881+
#endif
18751882
#endif
18761883

18771884
// Support for Adafruit Neopixel LED driver

Marlin/Configuration_adv.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,18 +146,18 @@
146146
* Thermistors able to support high temperature tend to have a hard time getting
147147
* good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP
148148
* will probably be caught when the heating element first turns on during the
149-
* preheating process, which will trigger a min_temp_error as a safety measure
149+
* preheating process, which will trigger a MINTEMP error as a safety measure
150150
* and force stop everything.
151151
* To circumvent this limitation, we allow for a preheat time (during which,
152-
* min_temp_error won't be triggered) and add a min_temp buffer to handle
152+
* MINTEMP error won't be triggered) and add a min_temp buffer to handle
153153
* aberrant readings.
154154
*
155155
* If you want to enable this feature for your hotend thermistor(s)
156156
* uncomment and set values > 0 in the constants below
157157
*/
158158

159159
// The number of consecutive low temperature errors that can occur
160-
// before a min_temp_error is triggered. (Shouldn't be more than 10.)
160+
// before a MINTEMP error is triggered. (Shouldn't be more than 10.)
161161
//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
162162

163163
// The number of milliseconds a hotend will preheat before starting to check

Marlin/Version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* here we define this default string as the date where the latest release
4242
* version was tagged.
4343
*/
44-
//#define STRING_DISTRIBUTION_DATE "2023-01-02"
44+
//#define STRING_DISTRIBUTION_DATE "2023-01-09"
4545

4646
/**
4747
* Defines a generic printer name to be output to the LCD after booting Marlin.

Marlin/src/HAL/SAMD21/timers.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ const tTimerConfig timer_config[NUM_HARDWARE_TIMERS] = {
4747
{ {.pTcc=TCC0}, TimerType::tcc, TCC0_IRQn, TC_PRIORITY(0) }, // 0 - stepper (assigned priority 2)
4848
{ {.pTcc=TCC1}, TimerType::tcc, TCC1_IRQn, TC_PRIORITY(1) }, // 1 - stepper (needed by 32 bit timers)
4949
{ {.pTcc=TCC2}, TimerType::tcc, TCC2_IRQn, 5 }, // 2 - tone (reserved by framework and fixed assigned priority 5)
50-
{ {.pTc=TC3}, TimerType::tc, TC3_IRQn, TC_PRIORITY(3) }, // 3 - servo (assigned priority 1)
51-
{ {.pTc=TC4}, TimerType::tc, TC4_IRQn, TC_PRIORITY(4) }, // 4 - software serial (no interrupts used)
52-
{ {.pTc=TC5}, TimerType::tc, TC5_IRQn, TC_PRIORITY(5) },
53-
{ {.pTc=TC6}, TimerType::tc, TC6_IRQn, TC_PRIORITY(6) },
54-
{ {.pTc=TC7}, TimerType::tc, TC7_IRQn, TC_PRIORITY(7) },
50+
{ {.pTc=TC3}, TimerType::tc, TC3_IRQn, TC_PRIORITY(3) }, // 3 - servo (assigned priority 1)
51+
{ {.pTc=TC4}, TimerType::tc, TC4_IRQn, TC_PRIORITY(4) }, // 4 - software serial (no interrupts used)
52+
{ {.pTc=TC5}, TimerType::tc, TC5_IRQn, TC_PRIORITY(5) },
53+
{ {.pTc=TC6}, TimerType::tc, TC6_IRQn, TC_PRIORITY(6) },
54+
{ {.pTc=TC7}, TimerType::tc, TC7_IRQn, TC_PRIORITY(7) },
5555
{ {.pRtc=RTC}, TimerType::rtc, RTC_IRQn, TC_PRIORITY(8) } // 8 - temperature (assigned priority 6)
5656
};
5757

Marlin/src/MarlinCore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@
232232
#include "feature/password/password.h"
233233
#endif
234234

235-
#if ENABLED(DGUS_LCD_UI_MKS)
235+
#if DGUS_LCD_UI_MKS
236236
#include "lcd/extui/dgus/DGUSScreenHandler.h"
237237
#endif
238238

Marlin/src/feature/leds/leds.cpp

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,62 @@ void LEDLights::setup() {
9595
delay(500);
9696
}
9797
#endif // RGB_STARTUP_TEST
98-
#endif
98+
99+
#elif BOTH(PCA9632, RGB_STARTUP_TEST) // PCA9632 RGB_STARTUP_TEST
100+
101+
constexpr int8_t led_pin_count = TERN(HAS_WHITE_LED, 4, 3);
102+
103+
// Startup animation
104+
LEDColor curColor = LEDColorOff();
105+
PCA9632_set_led_color(curColor); // blackout
106+
delay(200);
107+
108+
/*
109+
* LED Pin Counter steps -> events
110+
* | 0-100 | 100-200 | 200-300 | 300-400 |
111+
* fade in steady | fade out
112+
* start next pin fade in
113+
*/
114+
115+
uint16_t led_pin_counters[led_pin_count] = { 1, 0, 0 };
116+
117+
bool canEnd = false;
118+
while (led_pin_counters[0] != 99 || !canEnd) {
119+
if (led_pin_counters[0] == 99) // End loop next time pin0 counter is 99
120+
canEnd = true;
121+
LOOP_L_N(i, led_pin_count) {
122+
if (led_pin_counters[i] > 0) {
123+
if (++led_pin_counters[i] == 400) // turn off current pin counter in led_pin_counters
124+
led_pin_counters[i] = 0;
125+
else if (led_pin_counters[i] == 201) { // start next pin pwm
126+
led_pin_counters[i + 1 == led_pin_count ? 0 : i + 1] = 1;
127+
i++; // skip next pin in this loop so it doesn't increment twice
128+
}
129+
}
130+
}
131+
uint16_t r, g, b;
132+
r = led_pin_counters[0]; curColor.r = r <= 100 ? r : r <= 300 ? 100 : 400 - r;
133+
g = led_pin_counters[1]; curColor.g = g <= 100 ? g : g <= 300 ? 100 : 400 - g;
134+
b = led_pin_counters[2]; curColor.b = b <= 100 ? b : b <= 300 ? 100 : 400 - b;
135+
#if HAS_WHITE_LED
136+
const uint16_t w = led_pin_counters[3]; curColor.w = w <= 100 ? w : w <= 300 ? 100 : 400 - w;
137+
#endif
138+
PCA9632_set_led_color(curColor);
139+
delay(RGB_STARTUP_TEST_INNER_MS);
140+
}
141+
142+
// Fade to white
143+
LOOP_LE_N(led_pwm, 100) {
144+
NOLESS(curColor.r, led_pwm);
145+
NOLESS(curColor.g, led_pwm);
146+
NOLESS(curColor.b, led_pwm);
147+
TERN_(HAS_WHITE_LED, NOLESS(curColor.w, led_pwm));
148+
PCA9632_set_led_color(curColor);
149+
delay(RGB_STARTUP_TEST_INNER_MS);
150+
}
151+
152+
#endif // PCA9632 && RGB_STARTUP_TEST
153+
99154
TERN_(NEOPIXEL_LED, neo.init());
100155
TERN_(PCA9533, PCA9533_init());
101156
TERN_(LED_USER_PRESET_STARTUP, set_default());

Marlin/src/feature/leds/neopixel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ void Marlin_NeoPixel::init() {
108108
set_color(adaneo1.Color
109109
TERN(LED_USER_PRESET_STARTUP,
110110
(LED_USER_PRESET_RED, LED_USER_PRESET_GREEN, LED_USER_PRESET_BLUE, LED_USER_PRESET_WHITE),
111-
(255, 255, 255, 255))
111+
(0, 0, 0, 0))
112112
);
113113
}
114114

Marlin/src/feature/pause.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
211211
while (wait_for_user) {
212212
impatient_beep(max_beep_count);
213213
#if BOTH(FILAMENT_CHANGE_RESUME_ON_INSERT, FILAMENT_RUNOUT_SENSOR)
214-
#if ENABLED(MULTI_FILAMENT_SENSOR)
214+
#if MULTI_FILAMENT_SENSOR
215215
#define _CASE_INSERTED(N) case N-1: if (READ(FIL_RUNOUT##N##_PIN) != FIL_RUNOUT##N##_STATE) wait_for_user = false; break;
216216
switch (active_extruder) {
217217
REPEAT_1(NUM_RUNOUT_SENSORS, _CASE_INSERTED)
@@ -410,7 +410,6 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool
410410
#endif
411411

412412
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_INFO, F("Pause"), FPSTR(DISMISS_STR)));
413-
TERN_(DWIN_LCD_PROUI, DWIN_Print_Pause());
414413

415414
// Indicate that the printer is paused
416415
++did_pause_print;
@@ -461,6 +460,7 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool
461460

462461
// If axes don't need to home then the nozzle can park
463462
if (do_park) nozzle.park(0, park_point); // Park the nozzle by doing a Minimum Z Raise followed by an XY Move
463+
TERN_(DWIN_LCD_PROUI, if (!do_park) ui.set_status(GET_TEXT_F(MSG_PARK_FAILED)));
464464

465465
#if ENABLED(DUAL_X_CARRIAGE)
466466
const int8_t saved_ext = active_extruder;
@@ -710,13 +710,8 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_
710710

711711
TERN_(HAS_FILAMENT_SENSOR, runout.reset());
712712

713-
#if ENABLED(DWIN_LCD_PROUI)
714-
DWIN_Print_Resume();
715-
HMI_ReturnScreen();
716-
#else
717-
ui.reset_status();
718-
ui.return_to_status();
719-
#endif
713+
ui.reset_status();
714+
ui.return_to_status();
720715
}
721716

722717
#endif // ADVANCED_PAUSE_FEATURE

Marlin/src/gcode/config/M302.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "../../module/temperature.h"
2929

3030
#if ENABLED(DWIN_LCD_PROUI)
31-
#include "../../lcd/e3v2/proui/dwin_defines.h"
31+
#include "../../lcd/e3v2/proui/dwin.h"
3232
#endif
3333

3434
/**

Marlin/src/gcode/control/M605.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169
if (parser.seen("EPS")) {
170170
planner.synchronize();
171171
if (parser.seenval('P')) duplication_e_mask = parser.value_int(); // Set the mask directly
172-
else if (parser.seenval('E')) duplication_e_mask = pow(2, parser.value_int() + 1) - 1; // Set the mask by E index
172+
else if (parser.seenval('E')) duplication_e_mask = _BV(parser.value_int() + 1) - 1; // Set the mask by E index
173173
ena = (2 == parser.intval('S', extruder_duplication_enabled ? 2 : 0));
174174
set_duplication_enabled(ena && (duplication_e_mask >= 3));
175175
}

0 commit comments

Comments
 (0)