Skip to content

Commit

Permalink
Merge 'bugfix-2.1.x' into pr/24795
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Oct 18, 2022
2 parents 7669dd6 + 1aa0ece commit a3e9d88
Show file tree
Hide file tree
Showing 61 changed files with 2,403 additions and 297 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ tests-single-ci:

tests-single-local:
@if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make tests-all-local" ; return 1; fi
export PATH=./buildroot/bin/:./buildroot/tests/:${PATH} \
export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \
&& export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \
&& run_tests . $(TEST_TARGET) "$(ONLY_TEST)"
.PHONY: tests-single-local
Expand All @@ -38,7 +38,7 @@ tests-single-local-docker:
.PHONY: tests-single-local-docker

tests-all-local:
export PATH=./buildroot/bin/:./buildroot/tests/:${PATH} \
export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \
&& export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \
&& for TEST_TARGET in $$(./get_test_targets.py) ; do echo "Running tests for $$TEST_TARGET" ; run_tests . $$TEST_TARGET ; done
.PHONY: tests-all-local
Expand Down
2 changes: 1 addition & 1 deletion Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -3059,7 +3059,7 @@
//#define MKS_ROBIN_TFT_V1_1R

//
// 480x320, 3.5", FSMC Stock Display from TronxXY
// 480x320, 3.5", FSMC Stock Display from Tronxy
//
//#define TFT_TRONXY_X5SA

Expand Down
2 changes: 1 addition & 1 deletion Marlin/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2022-10-12"
//#define STRING_DISTRIBUTION_DATE "2022-10-18"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@
#define BOARD_OPULO_LUMEN_REV4 4241 // Opulo Lumen PnP Controller REV4 (STM32F407VE / STM32F407VG)
#define BOARD_FYSETC_SPIDER_KING407 4242 // FYSETC Spider King407 (STM32F407ZG)
#define BOARD_MKS_SKIPR_V1 4243 // MKS SKIPR v1.0 all-in-one board (STM32F407VE)
#define BOARD_TRONXY_V10 4244 // TRONXY V10 (STM32F446ZE)

//
// ARM Cortex M7
Expand Down
202 changes: 101 additions & 101 deletions Marlin/src/core/types.h

Large diffs are not rendered by default.

27 changes: 24 additions & 3 deletions Marlin/src/feature/host_actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,29 @@ void HostUI::action(FSTR_P const fstr, const bool eol) {
if (eol) SERIAL_EOL();
}

void HostUI::prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char/*='\0'*/) {
void HostUI::prompt_plus(const bool pgm, FSTR_P const ptype, const char * const str, const char extra_char/*='\0'*/) {
prompt(ptype, false);
PORT_REDIRECT(SerialMask::All);
SERIAL_CHAR(' ');
SERIAL_ECHOF(fstr);
if (pgm)
SERIAL_ECHOPGM_P(str);
else
SERIAL_ECHO(str);
if (extra_char != '\0') SERIAL_CHAR(extra_char);
SERIAL_EOL();
}

void HostUI::prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char/*='\0'*/) {
prompt_end();
host_prompt_reason = reason;
prompt_plus(F("begin"), fstr, extra_char);
}
void HostUI::prompt_button(FSTR_P const fstr) { prompt_plus(F("button"), fstr); }
void HostUI::prompt_begin(const PromptReason reason, const char * const cstr, const char extra_char/*='\0'*/) {
prompt_end();
host_prompt_reason = reason;
prompt_plus(F("begin"), cstr, extra_char);
}

void HostUI::prompt_end() { prompt(F("end")); }
void HostUI::prompt_show() { prompt(F("show")); }

Expand All @@ -133,14 +142,26 @@ void HostUI::action(FSTR_P const fstr, const bool eol) {
if (btn2) prompt_button(btn2);
prompt_show();
}

void HostUI::prompt_button(FSTR_P const fstr) { prompt_plus(F("button"), fstr); }
void HostUI::prompt_button(const char * const cstr) { prompt_plus(F("button"), cstr); }

void HostUI::prompt_do(const PromptReason reason, FSTR_P const fstr, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
prompt_begin(reason, fstr);
_prompt_show(btn1, btn2);
}
void HostUI::prompt_do(const PromptReason reason, const char * const cstr, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
prompt_begin(reason, cstr);
_prompt_show(btn1, btn2);
}
void HostUI::prompt_do(const PromptReason reason, FSTR_P const fstr, const char extra_char, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
prompt_begin(reason, fstr, extra_char);
_prompt_show(btn1, btn2);
}
void HostUI::prompt_do(const PromptReason reason, const char * const cstr, const char extra_char, FSTR_P const btn1/*=nullptr*/, FSTR_P const btn2/*=nullptr*/) {
prompt_begin(reason, cstr, extra_char);
_prompt_show(btn1, btn2);
}

#if ENABLED(ADVANCED_PAUSE_FEATURE)
void HostUI::filament_load_prompt() {
Expand Down
18 changes: 16 additions & 2 deletions Marlin/src/feature/host_actions.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,14 @@ class HostUI {
#if ENABLED(HOST_PROMPT_SUPPORT)
private:
static void prompt(FSTR_P const ptype, const bool eol=true);
static void prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char='\0');
static void prompt_plus(const bool pgm, FSTR_P const ptype, const char * const str, const char extra_char='\0');
static void prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char='\0') {
prompt_plus(true, ptype, FTOP(fstr), extra_char);
}
static void prompt_plus(FSTR_P const ptype, const char * const cstr, const char extra_char='\0') {
prompt_plus(false, ptype, cstr, extra_char);
}

static void prompt_show();
static void _prompt_show(FSTR_P const btn1, FSTR_P const btn2);

Expand All @@ -93,10 +100,17 @@ class HostUI {
static void notify(const char * const message);

static void prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char='\0');
static void prompt_button(FSTR_P const fstr);
static void prompt_begin(const PromptReason reason, const char * const cstr, const char extra_char='\0');
static void prompt_end();

static void prompt_button(FSTR_P const fstr);
static void prompt_button(const char * const cstr);

static void prompt_do(const PromptReason reason, FSTR_P const pstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
static void prompt_do(const PromptReason reason, const char * const cstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
static void prompt_do(const PromptReason reason, FSTR_P const pstr, const char extra_char, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);
static void prompt_do(const PromptReason reason, const char * const cstr, const char extra_char, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr);

static void prompt_open(const PromptReason reason, FSTR_P const pstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr) {
if (host_prompt_reason == PROMPT_NOT_DEFINED) prompt_do(reason, pstr, btn1, btn2);
}
Expand Down
46 changes: 19 additions & 27 deletions Marlin/src/feature/mmu/mmu2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ MMU2 mmu2;
#define MMU_CMD_TIMEOUT 45000UL // 45s timeout for mmu commands (except P0)
#define MMU_P0_TIMEOUT 3000UL // Timeout for P0 command: 3seconds

#define MMU2_COMMAND(S) tx_str(F(S "\n"))
#define MMU2_SEND(S) tx_str(F(S "\n"))
#define MMU2_RECV(S) rx_str(F(S "\n"))

#if ENABLED(MMU_EXTRUDER_SENSOR)
uint8_t mmu_idl_sens = 0;
Expand Down Expand Up @@ -131,7 +132,7 @@ void MMU2::reset() {
safe_delay(20);
WRITE(MMU2_RST_PIN, HIGH);
#else
MMU2_COMMAND("X0"); // Send soft reset
MMU2_SEND("X0"); // Send soft reset
#endif
}

Expand All @@ -157,11 +158,9 @@ void MMU2::mmu_loop() {
case -1:
if (rx_start()) {
prev_P0_request = millis(); // Initialize finda sensor timeout

DEBUG_ECHOLNPGM("MMU => 'start'");
DEBUG_ECHOLNPGM("MMU <= 'S1'");

MMU2_COMMAND("S1"); // Read Version
MMU2_SEND("S1"); // Read Version
state = -2;
}
else if (millis() > 30000) { // 30sec after reset disable MMU
Expand All @@ -173,10 +172,8 @@ void MMU2::mmu_loop() {
case -2:
if (rx_ok()) {
sscanf(rx_buffer, "%huok\n", &version);

DEBUG_ECHOLNPGM("MMU => ", version, "\nMMU <= 'S2'");

MMU2_COMMAND("S2"); // Read Build Number
MMU2_SEND("S2"); // Read Build Number
state = -3;
}
break;
Expand All @@ -191,14 +188,12 @@ void MMU2::mmu_loop() {

#if ENABLED(MMU2_MODE_12V)
DEBUG_ECHOLNPGM("MMU <= 'M1'");

MMU2_COMMAND("M1"); // Stealth Mode
MMU2_SEND("M1"); // Stealth Mode
state = -5;

#else
DEBUG_ECHOLNPGM("MMU <= 'P0'");

MMU2_COMMAND("P0"); // Read FINDA
MMU2_SEND("P0"); // Read FINDA
state = -4;
#endif
}
Expand All @@ -209,10 +204,8 @@ void MMU2::mmu_loop() {
// response to M1
if (rx_ok()) {
DEBUG_ECHOLNPGM("MMU => ok");

DEBUG_ECHOLNPGM("MMU <= 'P0'");

MMU2_COMMAND("P0"); // Read FINDA
MMU2_SEND("P0"); // Read FINDA
state = -4;
}
break;
Expand Down Expand Up @@ -250,14 +243,13 @@ void MMU2::mmu_loop() {
else if (cmd == MMU_CMD_C0) {
// continue loading
DEBUG_ECHOLNPGM("MMU <= 'C0'");
MMU2_COMMAND("C0");
MMU2_SEND("C0");
state = 3; // wait for response
}
else if (cmd == MMU_CMD_U0) {
// unload current
DEBUG_ECHOLNPGM("MMU <= 'U0'");

MMU2_COMMAND("U0");
MMU2_SEND("U0");
state = 3; // wait for response
}
else if (WITHIN(cmd, MMU_CMD_E0, MMU_CMD_E0 + EXTRUDERS - 1)) {
Expand All @@ -270,7 +262,7 @@ void MMU2::mmu_loop() {
else if (cmd == MMU_CMD_R0) {
// recover after eject
DEBUG_ECHOLNPGM("MMU <= 'R0'");
MMU2_COMMAND("R0");
MMU2_SEND("R0");
state = 3; // wait for response
}
else if (WITHIN(cmd, MMU_CMD_F0, MMU_CMD_F0 + EXTRUDERS - 1)) {
Expand All @@ -285,7 +277,7 @@ void MMU2::mmu_loop() {
cmd = MMU_CMD_NONE;
}
else if (ELAPSED(millis(), prev_P0_request + 300)) {
MMU2_COMMAND("P0"); // Read FINDA
MMU2_SEND("P0"); // Read FINDA
state = 2; // wait for response
}

Expand Down Expand Up @@ -314,7 +306,7 @@ void MMU2::mmu_loop() {
if (mmu_idl_sens) {
if (FILAMENT_PRESENT() && mmu_loading_flag) {
DEBUG_ECHOLNPGM("MMU <= 'A'");
MMU2_COMMAND("A"); // send 'abort' request
MMU2_SEND("A"); // send 'abort' request
mmu_idl_sens = 0;
DEBUG_ECHOLNPGM("MMU IDLER_SENSOR = 0 - ABORT");
}
Expand All @@ -327,9 +319,9 @@ void MMU2::mmu_loop() {
const bool keep_trying = !mmu2s_triggered && last_cmd == MMU_CMD_C0;
if (keep_trying) {
// MMU ok received but filament sensor not triggered, retrying...
DEBUG_ECHOLNPGM("MMU => 'ok' (filament not present in gears)");
DEBUG_ECHOLNPGM("MMU => 'ok' (no filament in gears)");
DEBUG_ECHOLNPGM("MMU <= 'C0' (keep trying)");
MMU2_COMMAND("C0");
MMU2_SEND("C0");
}
#else
constexpr bool keep_trying = false;
Expand Down Expand Up @@ -361,7 +353,7 @@ void MMU2::mmu_loop() {
*/
bool MMU2::rx_start() {
// check for start message
return rx_str(F("start\n"));
return MMU2_RECV("start");
}

/**
Expand Down Expand Up @@ -440,7 +432,7 @@ void MMU2::clear_rx_buffer() {
* Check if we received 'ok' from MMU
*/
bool MMU2::rx_ok() {
if (rx_str(F("ok\n"))) {
if (MMU2_RECV("ok")) {
prev_P0_request = millis();
return true;
}
Expand Down Expand Up @@ -673,7 +665,7 @@ static void mmu2_not_responding() {
// When (T0 rx->ok) load is ready, but in fact it did not load
// successfully or an overload created pressure in the extruder.
// Send (C0) to load more and move E_AXIS a little to release pressure.
if ((fil_present = FILAMENT_PRESENT())) MMU2_COMMAND("A");
if ((fil_present = FILAMENT_PRESENT())) MMU2_SEND("A");
} while (!fil_present && PENDING(millis(), expire_ms));
stepper.disable_extruder();
manage_response(true, true);
Expand Down Expand Up @@ -882,7 +874,7 @@ void MMU2::filament_runout() {
if (cmd == MMU_CMD_NONE && last_cmd == MMU_CMD_C0) {
if (present && !mmu2s_triggered) {
DEBUG_ECHOLNPGM("MMU <= 'A'");
tx_str(F("A\n"));
MMU2_SEND("A");
}
// Slowly spin the extruder during C0
else {
Expand Down
2 changes: 0 additions & 2 deletions Marlin/src/gcode/calibrate/M665.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@
if (parser.seenval('T')) draw_area_max.y = parser.value_linear_units();
if (parser.seenval('B')) draw_area_min.y = parser.value_linear_units();
if (parser.seenval('H')) polargraph_max_belt_len = parser.value_linear_units();
draw_area_size.x = draw_area_max.x - draw_area_min.x;
draw_area_size.y = draw_area_max.y - draw_area_min.y;
}

void GcodeSuite::M665_report(const bool forReplay/*=true*/) {
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/control/M993_M994.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include "../../inc/MarlinConfig.h"

#if ALL(HAS_SPI_FLASH, SDSUPPORT, MARLIN_DEV_MODE)
#if ALL(SPI_FLASH, SDSUPPORT, MARLIN_DEV_MODE)

#include "../gcode.h"
#include "../../sd/cardreader.h"
Expand Down Expand Up @@ -85,4 +85,4 @@ void GcodeSuite::M994() {
card.closefile();
}

#endif // HAS_SPI_FLASH && SDSUPPORT && MARLIN_DEV_MODE
#endif // SPI_FLASH && SDSUPPORT && MARLIN_DEV_MODE
8 changes: 6 additions & 2 deletions Marlin/src/gcode/feature/trinamic/M569.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,12 @@ void GcodeSuite::M569_report(const bool forReplay/*=true*/) {
if (chop_x2 || chop_y2 || chop_z2) {
say_M569(forReplay, F("I1"));
if (chop_x2) SERIAL_ECHOPGM_P(SP_X_STR);
if (chop_y2) SERIAL_ECHOPGM_P(SP_Y_STR);
if (chop_z2) SERIAL_ECHOPGM_P(SP_Z_STR);
#if HAS_Y_AXIS
if (chop_y2) SERIAL_ECHOPGM_P(SP_Y_STR);
#endif
#if HAS_Z_AXIS
if (chop_z2) SERIAL_ECHOPGM_P(SP_Z_STR);
#endif
SERIAL_EOL();
}

Expand Down
10 changes: 8 additions & 2 deletions Marlin/src/gcode/gcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,9 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 108: M108(); break; // M108: Cancel Waiting
case 112: M112(); break; // M112: Full Shutdown
case 410: M410(); break; // M410: Quickstop - Abort all the planned moves.
TERN_(HOST_PROMPT_SUPPORT, case 876:) // M876: Handle Host prompt responses
#if ENABLED(HOST_PROMPT_SUPPORT)
case 876: M876(); break; // M876: Handle Host prompt responses
#endif
#else
case 108: case 112: case 410:
TERN_(HOST_PROMPT_SUPPORT, case 876:)
Expand Down Expand Up @@ -793,6 +795,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 250: M250(); break; // M250: Set LCD contrast
#endif

#if HAS_GCODE_M255
case 255: M255(); break; // M255: Set LCD Sleep/Backlight Timeout (Minutes)
#endif

#if HAS_LCD_BRIGHTNESS
case 256: M256(); break; // M256: Set LCD brightness
#endif
Expand Down Expand Up @@ -1047,7 +1053,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 422: M422(); break; // M422: Set Z Stepper automatic alignment position using probe
#endif

#if ALL(HAS_SPI_FLASH, SDSUPPORT, MARLIN_DEV_MODE)
#if ALL(SPI_FLASH, SDSUPPORT, MARLIN_DEV_MODE)
case 993: M993(); break; // M993: Backup SPI Flash to SD
case 994: M994(); break; // M994: Load a Backup from SD to SPI Flash
#endif
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/gcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,7 @@ class GcodeSuite {
static void M995();
#endif

#if BOTH(HAS_SPI_FLASH, SDSUPPORT)
#if BOTH(SPI_FLASH, SDSUPPORT)
static void M993();
static void M994();
#endif
Expand Down
Loading

0 comments on commit a3e9d88

Please sign in to comment.