diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 3aa430db20ec..2af79821f11a 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -306,7 +306,8 @@ PGMSTR(M112_KILL_STR, "M112 Shutdown"); KEEPALIVE_STATE(PAUSED_FOR_USER); wait_start(); if (ms) ms += millis(); // expire time - while (wait_for_user && !(ms && ELAPSED(millis(), ms))) + const MTimeout24 expiration(ms); + while (wait_for_user && (!ms || expiration.pending())) idle(TERN_(ADVANCED_PAUSE_FEATURE, no_sleep)); user_resume(); while (ui.button_pressed()) safe_delay(50); @@ -484,9 +485,9 @@ void Marlin::manage_inactivity(const bool no_stepper_sleep/*=false*/) { #if ENABLED(PHOTO_GCODE) && PIN_EXISTS(CHDK) // Check if CHDK should be set to LOW (after M240 set it HIGH) - extern millis_t chdk_timeout; - if (chdk_timeout && ELAPSED(ms, chdk_timeout)) { - chdk_timeout = 0; + extern TTimeout chdk_timeout; + if (chdk_timeout.on_elapsed(ms)) { + chdk_timeout.cancel(); WRITE(CHDK_PIN, LOW); } #endif @@ -531,10 +532,10 @@ void Marlin::manage_inactivity(const bool no_stepper_sleep/*=false*/) { #if HAS_HOME // Handle a standalone HOME button constexpr millis_t HOME_DEBOUNCE_DELAY = 1000UL; - static millis_t next_home_key_ms; // = 0 + static millis_t prev_home_key_ms; // = 0 if (!card.isStillPrinting() && !READ(HOME_PIN)) { // HOME_PIN goes LOW when pressed - if (ELAPSED(ms, next_home_key_ms)) { - next_home_key_ms = ms + HOME_DEBOUNCE_DELAY; + if (ELAPSED(ms, prev_home_key_ms, HOME_DEBOUNCE_DELAY)) { + prev_home_key_ms = ms; LCD_MESSAGE(MSG_AUTO_HOME); queue.inject_P(G28_STR); } @@ -547,13 +548,12 @@ void Marlin::manage_inactivity(const bool no_stepper_sleep/*=false*/) { #define HAS_CUSTOM_USER_BUTTON(N) (PIN_EXISTS(BUTTON##N) && defined(BUTTON##N##_HIT_STATE) && defined(BUTTON##N##_GCODE)) #define HAS_BETTER_USER_BUTTON(N) HAS_CUSTOM_USER_BUTTON(N) && defined(BUTTON##N##_DESC) #define _CHECK_CUSTOM_USER_BUTTON(N, CODE) do{ \ - constexpr millis_t CUB_DEBOUNCE_DELAY_##N = 250UL; \ - static millis_t next_cub_ms_##N; \ + static millis_t prev_cub_ms_##N; \ if (BUTTON##N##_HIT_STATE == READ(BUTTON##N##_PIN) \ && (ENABLED(BUTTON##N##_WHEN_PRINTING) || printer_not_busy) \ ) { \ - if (ELAPSED(ms, next_cub_ms_##N)) { \ - next_cub_ms_##N = ms + CUB_DEBOUNCE_DELAY_##N; \ + if (ELAPSED(ms, prev_cub_ms_##N, CUB_DEBOUNCE_DELAY_##N)) { \ + prev_cub_ms_##N = ms; \ CODE; \ if (ENABLED(BUTTON##N##_IMMEDIATE)) \ gcode.process_subcommands_now(F(BUTTON##N##_GCODE)); \ @@ -698,6 +698,8 @@ void Marlin::manage_inactivity(const bool no_stepper_sleep/*=false*/) { TERN_(USE_CONTROLLER_FAN, controllerFan.update()); // Check if fan should be turned on to cool stepper drivers down + // Check for power needing to be turned on or off + // Send a bool to pause the power-off timer for ongoing activities TERN_(AUTO_POWER_CONTROL, powerManager.check(!ui.on_status_screen() || printJobOngoing() || printingIsPaused())); TERN_(HOTEND_IDLE_TIMEOUT, hotend_idle.check()); @@ -731,12 +733,11 @@ void Marlin::manage_inactivity(const bool no_stepper_sleep/*=false*/) { #endif // EXTRUDER_RUNOUT_PREVENT #if ENABLED(DUAL_X_CARRIAGE) - // handle delayed move timeout - if (motion.delayed_move_time && ELAPSED(ms, motion.delayed_move_time) && isRunning()) { - // travel moves have been received so enact them - motion.delayed_move_time = UINT32_MAX; // force moves to be done + // Add a delayed move when the proper time arrives, or always add it + if (motion.delayed_move_interval > 1 && IsRunning() && ELAPSED(ms, motion.delayed_move_start_ms, motion.delayed_move_interval)) { + motion.delayed_move_interval = 1; // Force moves to be done in dual_x_carriage_unpark motion.destination = motion.position; - motion.prepare_line_to_destination(); + motion.prepare_line_to_destination(); // Also calls dual_x_carriage_unpark planner.synchronize(); } #endif @@ -746,16 +747,16 @@ void Marlin::manage_inactivity(const bool no_stepper_sleep/*=false*/) { TERN_(MONITOR_DRIVER_STATUS, monitor_tmc_drivers()); // Limit check_axes_activity frequency to 10Hz - static millis_t next_check_axes_ms = 0; - if (ELAPSED(ms, next_check_axes_ms)) { + static millis_t prev_check_axes_ms = 0; + if (ELAPSED(ms, prev_check_axes_ms, 100UL)) { planner.check_axes_activity(); - next_check_axes_ms = ms + 100UL; + prev_check_axes_ms = ms; } #if PIN_EXISTS(FET_SAFETY) - static millis_t FET_next; - if (ELAPSED(ms, FET_next)) { - FET_next = ms + FET_SAFETY_DELAY; // 2µs pulse every FET_SAFETY_DELAY mS + static millis_t prev_FET = 0; + if (ELAPSED(ms, prev_FET, FET_SAFETY_DELAY)) { // 2µs pulse every FET_SAFETY_DELAY mS + prev_FET = ms; OUT_WRITE(FET_SAFETY_PIN, !FET_SAFETY_INVERTED); DELAY_US(2); WRITE(FET_SAFETY_PIN, FET_SAFETY_INVERTED); @@ -768,6 +769,9 @@ void Marlin::manage_inactivity(const bool no_stepper_sleep/*=false*/) { #include "feature/babystep.h" #endif +// For millis_t.h +void marlin_idle(const bool no_stepper_sleep/*=false*/) { marlin.idle(no_stepper_sleep); } + /** * Standard idle routine keeps the machine alive: * - Core Marlin activities @@ -837,7 +841,7 @@ void Marlin::idle(const bool no_stepper_sleep/*=false*/) { // Run StallGuard endstop checks #if ENABLED(SPI_ENDSTOPS) - if (endstops.tmc_spi_homing.any && TERN1(IMPROVE_HOMING_RELIABILITY, ELAPSED(millis(), sg_guard_period))) + if (endstops.tmc_spi_homing.any && TERN1(IMPROVE_HOMING_RELIABILITY, ELAPSED(millis(), sg_guard_start_ms, default_sg_guard_duration))) for (uint8_t i = 0; i < 4; ++i) if (endstops.tmc_spi_homing_check()) break; // Read SGT 4 times per idle loop #endif @@ -874,12 +878,12 @@ void Marlin::idle(const bool no_stepper_sleep/*=false*/) { // Run i2c Position Encoders #if ENABLED(I2C_POSITION_ENCODERS) { - static millis_t i2cpem_next_update_ms; + static MTimeout24 i2c_encoder_timer; if (planner.has_blocks_queued()) { const millis_t ms = millis(); - if (ELAPSED(ms, i2cpem_next_update_ms)) { + if (i2c_encoder_timer.elapsed(ms)) { + i2c_encoder_timer.start(I2CPE_MIN_UPD_TIME_MS, ms); I2CPEM.update(); - i2cpem_next_update_ms = ms + I2CPE_MIN_UPD_TIME_MS; } } } @@ -1194,13 +1198,11 @@ void setup() { #define SETUP_RUN(C) do{ SETUP_LOG(STRINGIFY(C)); C; }while(0) MYSERIAL1.begin(BAUDRATE); - millis_t serial_connect_timeout = millis() + 1000UL; - while (!MYSERIAL1.connected() && PENDING(millis(), serial_connect_timeout)) { /*nada*/ } + MTimeout24(1000).wait_until([]{ return MYSERIAL1.connected(); }); #if ENABLED(SOVOL_SV06_RTS) LCD_SERIAL.begin(BAUDRATE); - serial_connect_timeout = millis() + 1000UL; - while (!LCD_SERIAL.connected() && PENDING(millis(), serial_connect_timeout)) { /*nada*/ } + MTimeout24(1000).wait_until([]{ return LCD_SERIAL.connected(); }); #endif #if HAS_MULTI_SERIAL && !HAS_ETHERNET @@ -1208,15 +1210,13 @@ void setup() { #define BAUDRATE_2 BAUDRATE #endif MYSERIAL2.begin(BAUDRATE_2); - serial_connect_timeout = millis() + 1000UL; - while (!MYSERIAL2.connected() && PENDING(millis(), serial_connect_timeout)) { /*nada*/ } + MTimeout24(1000).wait_until([]{ return MYSERIAL2.connected(); }); #ifdef SERIAL_PORT_3 #ifndef BAUDRATE_3 #define BAUDRATE_3 BAUDRATE #endif MYSERIAL3.begin(BAUDRATE_3); - serial_connect_timeout = millis() + 1000UL; - while (!MYSERIAL3.connected() && PENDING(millis(), serial_connect_timeout)) { /*nada*/ } + MTimeout24(1000).wait_until([]{ return MYSERIAL3.connected(); }); #endif #endif SERIAL_ECHOLNPGM("start"); diff --git a/Marlin/src/core/millis_t.h b/Marlin/src/core/millis_t.h index 1d3cc853b3a9..e9554f27f158 100644 --- a/Marlin/src/core/millis_t.h +++ b/Marlin/src/core/millis_t.h @@ -21,7 +21,7 @@ */ #pragma once -#include +#include "../HAL/shared/Marduino.h" typedef uint32_t millis_t; @@ -34,3 +34,107 @@ constexpr bool _PENDING(const millis_t now, const millis_t when) { return int32_ constexpr bool _PENDING(const millis_t now, const millis_t start, const millis_t interval) { return (now - start) < interval; } #define PENDING(V...) _PENDING(V) #define ELAPSED(V...) !_PENDING(V) + +inline millis_t nz_millis() { const millis_t now = millis(); return now + !now; } +inline uint16_t millis16() { return uint16_t(millis()); } +inline uint16_t nz_millis16() { return uint16_t(nz_millis()); } + +#define FI FORCE_INLINE + +void marlin_idle(const bool no_stepper_sleep=false); + +// A function to call continually the from run(fn) method +typedef void (*timeoutFunc_t)(); + +// Pass a test function to the wait_while(fn) / idle_while(fn) methods +typedef bool (*testFunc_t)(); + +// Single-use instant delay up to 65535 milliseconds. Example: TDelay<500> halfsec; halfsec.idle(); +template +struct TDelay { + uint16_t start_ms; + TDelay(const uint16_t ms=millis16()) { prime(ms); } + FI void prime(const uint16_t ms=millis16()) { start_ms = millis16(); } + FI bool pending(const uint16_t ms=millis16()) const { return age() < DELAY_MS; } + FI bool elapsed(const uint16_t ms=millis16()) const { return age() >= DELAY_MS; } + FI void wait() const { while (pending()) { /* wait */ } } + FI void idle(const bool nss=false) const { while (pending()) marlin_idle(nss); } + FI void wait_while(testFunc_t fn) const { while (pending() && fn()) { /* wait */ }; } + FI void wait_until(testFunc_t fn) const { while (pending() && !fn()) { /* wait */ }; } + FI void idle_while(testFunc_t fn, const bool nss=false) const { while (pending() && fn()) marlin_idle(nss); } + FI void run(timeoutFunc_t fn) const { while (pending()) fn(); } + FI uint16_t age(const uint16_t ms=millis16()) const { return ms - start_ms; } + FI uint16_t remaining(const uint16_t ms=millis16()) const { return pending(ms) ? DELAY_MS - age() : 0; } +}; + +// Reusable timeout in milliseconds units up to 24 days of duration. +template +struct TTimeout24 { + T end_ms = 0; + TTimeout24() {} + TTimeout24(const T interval, const T ms=millis()) { start(interval, ms); } + FI void start(const T interval, const T ms=millis()) { end_ms = ms + interval; } + FI bool pending(const T ms=millis()) const { return _remaining() > 0; } + FI bool elapsed(const T ms=millis()) const { return _remaining() <= 0; } + FI void wait() const { while (pending()) { /* wait */ } } + FI void idle(const bool nss=false) const { while (pending()) marlin_idle(nss); } + FI void wait_while(testFunc_t fn) const { while (pending() && fn()) { /* wait */ }; } + FI void wait_until(testFunc_t fn) const { while (pending() && !fn()) { /* wait */ }; } + FI void idle_while(testFunc_t fn, const bool nss=false) const { while (pending() && fn()) marlin_idle(nss); } + FI void run(timeoutFunc_t fn) const { while (pending()) fn(); } + FI signed _remaining(const T ms=millis()) const { return end_ms - ms; } + FI T remaining(const T ms=millis()) const { return pending(ms) ? _remaining() : 0; } +}; + +// Reusable timeout in milliseconds units up to 48 days of duration. +template +struct TTimeout { + T start_ms = 0, delay_ms = 0; + TTimeout() {} + TTimeout(const T interval, const T ms=millis()) { start(interval, ms); } + FI void prime(const T ms=millis()) { start_ms = ms; } + FI void cancel() { delay_ms = 0; } + FI bool enabled() const { return delay_ms != 0; } + FI void start(const T interval, const T ms=millis()) { delay_ms = interval; prime(ms); } + FI bool pending(const T ms=millis()) const { return age() < delay_ms; } + FI bool elapsed(const T ms=millis()) const { return age() >= delay_ms; } + FI bool on_pending(const T ms=millis()) const { return enabled() && pending(ms); } + FI bool on_elapsed(const T ms=millis()) const { return enabled() && elapsed(ms); } + FI void wait() const { while (pending()) { /* wait */ } } + FI void idle(const bool nss=false) const { while (pending()) marlin_idle(nss); } + FI void wait_while(testFunc_t fn) const { while (pending() && fn()) { /* wait */ }; } + FI void wait_until(testFunc_t fn) const { while (pending() && !fn()) { /* wait */ }; } + FI void idle_while(testFunc_t fn, const bool nss=false) const { while (pending() && fn()) marlin_idle(nss); } + FI void run(timeoutFunc_t fn) const { while (on_pending()) fn(); } + FI T age(const T ms=millis()) const { return ms - start_ms; } + FI T remaining(const T ms=millis()) const { return on_pending(ms) ? delay_ms - age() : 0; } +}; + +// Reusable timeout in seconds units up to 48 days of duration. +template +struct TSeconds { + T start_ms = 0; + uint8_t delay_sec = 0; + TSeconds() {} + TSeconds(const T seconds, const T ms=millis()) { start(seconds, ms); } + FI void prime(const T ms=millis()) { start_ms = ms; } + FI void cancel() { delay_sec = 0; } + FI bool enabled() const { return delay_sec != 0; } + FI void start(const T seconds, const T ms=millis()) { delay_sec = seconds; prime(ms); } + FI bool pending(const T ms=millis()) const { return age() < delay_sec; } + FI bool elapsed(const T ms=millis()) const { return age() >= delay_sec; } + FI bool on_pending(const T ms=millis()) const { return enabled() && pending(ms); } + FI bool on_elapsed(const T ms=millis()) const { return enabled() && elapsed(ms); } + FI void wait() const { while (pending()) { /* wait */ } } + FI void idle(const bool nss=false) const { while (pending()) marlin_idle(nss); } + FI void wait_while(testFunc_t fn) const { while (pending() && fn()) { /* wait */ }; } + FI void wait_until(testFunc_t fn) const { while (pending() && !fn()) { /* wait */ }; } + FI void idle_while(testFunc_t fn, const bool nss=false) const { while (pending() && fn()) marlin_idle(nss); } + FI void run(timeoutFunc_t fn) const { while (on_pending()) fn(); } + FI uint8_t age(const T ms=millis()) const { return MS_TO_SEC(ms - start_ms); } + FI uint8_t remaining(const T ms=millis()) const { return on_pending(ms) ? delay_sec - age() : 0; } +}; + +typedef TTimeout24<> MTimeout24; +typedef TTimeout<> MTimeout; +typedef TSeconds<> MSeconds; diff --git a/Marlin/src/core/mstring.h b/Marlin/src/core/mstring.h index 3ed21950def3..5810cab342e7 100644 --- a/Marlin/src/core/mstring.h +++ b/Marlin/src/core/mstring.h @@ -318,5 +318,5 @@ class MString { #ifndef TS_SIZE #define TS_SIZE 63 #endif -typedef MString TString; +typedef MString TString; #define TS(V...) TString(V) diff --git a/Marlin/src/feature/binary_stream.cpp b/Marlin/src/feature/binary_stream.cpp index 81e110339bda..e5a1f3a1096a 100644 --- a/Marlin/src/feature/binary_stream.cpp +++ b/Marlin/src/feature/binary_stream.cpp @@ -28,7 +28,8 @@ #include "binary_stream.h" char* SDFileTransferProtocol::Packet::Open::data = nullptr; -size_t SDFileTransferProtocol::data_waiting, SDFileTransferProtocol::transfer_timeout, SDFileTransferProtocol::idle_timeout; +size_t SDFileTransferProtocol::data_waiting; +TDelay SDFileTransferProtocol::transfer_timeout; bool SDFileTransferProtocol::transfer_active, SDFileTransferProtocol::dummy_transfer, SDFileTransferProtocol::compression; BinaryStream binaryStream[NUM_SERIAL]; diff --git a/Marlin/src/feature/binary_stream.h b/Marlin/src/feature/binary_stream.h index 304fdae3009f..c5a8caefd594 100644 --- a/Marlin/src/feature/binary_stream.h +++ b/Marlin/src/feature/binary_stream.h @@ -40,6 +40,9 @@ inline int bs_read_serial(const serial_index_t index) { } class SDFileTransferProtocol { +public: + static const uint16_t VERSION_MAJOR = 0, VERSION_MINOR = 1, VERSION_PATCH = 0, TIMEOUT = 10000, IDLE_PERIOD = 1000; + private: struct Packet { struct [[gnu::packed]] Open { @@ -128,22 +131,24 @@ class SDFileTransferProtocol { enum class FileTransfer : uint8_t { QUERY, OPEN, CLOSE, WRITE, ABORT }; - static size_t data_waiting, transfer_timeout, idle_timeout; + static size_t data_waiting; + static TDelay transfer_timeout; static bool transfer_active, dummy_transfer, compression; public: static void idle() { - // If a transfer is interrupted and a file is left open, abort it after 'idle_period' ms - const millis_t ms = millis(); - if (transfer_active && ELAPSED(ms, idle_timeout)) { - idle_timeout = ms + idle_period; - if (ELAPSED(ms, transfer_timeout)) transfer_abort(); + // If a transfer is interrupted and a file is left open, abort it after TIMEOUT ms + static TDelay idle_timeout; + const uint16_t ms = millis16(); + if (transfer_active && idle_timeout.elapsed(ms)) { + idle_timeout.prime(ms); + if (transfer_timeout.elapsed(ms)) transfer_abort(); } } static void process(uint8_t packet_type, char *buffer, const uint16_t length) { - transfer_timeout = millis() + timeout; + transfer_timeout.prime(); switch (static_cast(packet_type)) { case FileTransfer::QUERY: SERIAL_ECHO(F("PFT:version:"), version_major, C('.'), version_minor, C('.'), version_patch); @@ -206,6 +211,8 @@ class BinaryStream { enum class StreamState : uint8_t { PACKET_RESET, PACKET_WAIT, PACKET_HEADER, PACKET_DATA, PACKET_FOOTER, PACKET_PROCESS, PACKET_RESEND, PACKET_TIMEOUT, PACKET_ERROR }; + static const uint16_t PACKET_MAX_WAIT = 500, RX_TIMESLICE = 20, MAX_RETRIES = 0, VERSION_MAJOR = 0, VERSION_MINOR = 1, VERSION_PATCH = 0; + struct Packet { // 10 byte protocol overhead, ascii with checksum and line number has a minimum of 7 increasing with line union Header { @@ -236,7 +243,7 @@ class BinaryStream { Footer footer; uint32_t bytes_received; uint16_t checksum, header_checksum; - millis_t timeout; + TDelay max_wait; char* buffer; void reset() { @@ -245,7 +252,7 @@ class BinaryStream { bytes_received = 0; checksum = 0; header_checksum = 0; - timeout = millis() + packet_max_wait; + max_wait.prime(); buffer = nullptr; } } packet{}; @@ -258,28 +265,28 @@ class BinaryStream { // fletchers 16 checksum uint32_t checksum(uint32_t cs, uint8_t value) { - uint16_t cs_low = (((cs & 0xFF) + value) % 255); - return ((((cs >> 8) + cs_low) % 255) << 8) | cs_low; + const uint16_t cs_low = (((cs & 0xFF) + value) % 255); + return ((((cs >> 8) + cs_low) % 255) << 8) | cs_low; } // read the next byte from the data stream keeping track of // whether the stream times out from data starvation // takes the data variable by reference in order to return status bool stream_read(uint8_t& data) { - if (stream_state != StreamState::PACKET_WAIT && ELAPSED(millis(), packet.timeout)) { + if (stream_state != StreamState::PACKET_WAIT && packet.max_wait.pending()) { stream_state = StreamState::PACKET_TIMEOUT; return false; } if (!bs_serial_data_available(card.transfer_port_index)) return false; data = bs_read_serial(card.transfer_port_index); - packet.timeout = millis() + packet_max_wait; + packet.max_wait.prime(); return true; } template void receive(char (&buffer)[buffer_size]) { uint8_t data = 0; - millis_t transfer_window = millis() + rx_timeslice; + const TDelay transfer_window; #if HAS_MEDIA PORT_REDIRECT(SERIAL_PORTMASK(card.transfer_port_index)); @@ -288,7 +295,7 @@ class BinaryStream { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Warray-bounds" - while (PENDING(millis(), transfer_window)) { + while (transfer_window.pending()) { switch (stream_state) { /** * Data stream packet handling diff --git a/Marlin/src/feature/power.cpp b/Marlin/src/feature/power.cpp index 2068558fe9e5..48712e93d0d0 100644 --- a/Marlin/src/feature/power.cpp +++ b/Marlin/src/feature/power.cpp @@ -61,7 +61,7 @@ bool Power::psu_on; #include "spindle_laser.h" #endif - millis_t Power::lastPowerOn; + millis_t Power::lastPowerOn; // = 0 #endif #if PSU_TRACK_STATE_MS @@ -169,8 +169,9 @@ void Power::power_off() { #if ANY(POWER_OFF_TIMER, POWER_OFF_WAIT_FOR_COOLDOWN) #if ENABLED(POWER_OFF_TIMER) - millis_t Power::power_off_time = 0; - void Power::setPowerOffTimer(const millis_t delay_ms) { power_off_time = millis() + delay_ms; } + millis_t Power::power_off_start_ms = 0; + uint16_t power_off_secs = 0; + void Power::setPowerOffTimer(const uint16_t delay_sec) { power_off_start_ms = millis(); power_off_secs = delay_sec; } #endif #if ENABLED(POWER_OFF_WAIT_FOR_COOLDOWN) @@ -179,14 +180,14 @@ void Power::power_off() { #endif void Power::cancelAutoPowerOff() { - TERN_(POWER_OFF_TIMER, power_off_time = 0); + TERN_(POWER_OFF_TIMER, power_off_secs = 0); TERN_(POWER_OFF_WAIT_FOR_COOLDOWN, power_off_on_cooldown = false); } void Power::checkAutoPowerOff() { - if (TERN1(POWER_OFF_TIMER, !power_off_time) && TERN1(POWER_OFF_WAIT_FOR_COOLDOWN, !power_off_on_cooldown)) return; + if (TERN1(POWER_OFF_TIMER, !power_off_secs) && TERN1(POWER_OFF_WAIT_FOR_COOLDOWN, !power_off_on_cooldown)) return; if (TERN0(POWER_OFF_WAIT_FOR_COOLDOWN, power_off_on_cooldown && is_cooling_needed())) return; - if (TERN0(POWER_OFF_TIMER, power_off_time && PENDING(millis(), power_off_time))) return; + if (TERN0(POWER_OFF_TIMER, power_off_secs && PENDING(millis(), power_off_start_ms, SEC_TO_MS(power_off_secs)))) return; power_off(); } @@ -247,8 +248,9 @@ void Power::power_off() { * @param pause pause the 'timer' */ void Power::check(const bool pause) { - static millis_t nextPowerCheck = 0; + static MTimeout24 lastPowerCheck; const millis_t now = millis(); + #if POWER_TIMEOUT > 0 static bool _pause = false; if (pause != _pause) { @@ -257,8 +259,9 @@ void Power::power_off() { } if (pause) return; #endif - if (ELAPSED(now, nextPowerCheck)) { - nextPowerCheck = now + 2500UL; + + if (lastPowerCheck.elapsed(now)) { + lastPowerCheck.start(2500); if (is_power_needed()) power_on(); else if (!lastPowerOn || (POWER_TIMEOUT > 0 && ELAPSED(now, lastPowerOn, SEC_TO_MS(POWER_TIMEOUT)))) diff --git a/Marlin/src/feature/power.h b/Marlin/src/feature/power.h index 16f9dbcef54f..ab287b617eb0 100644 --- a/Marlin/src/feature/power.h +++ b/Marlin/src/feature/power.h @@ -47,7 +47,7 @@ class Power { #if ANY(POWER_OFF_TIMER, POWER_OFF_WAIT_FOR_COOLDOWN) #if ENABLED(POWER_OFF_TIMER) static millis_t power_off_time; - static void setPowerOffTimer(const millis_t delay_ms); + static void setPowerOffTimer(const uint16_t delay_sec); #endif #if ENABLED(POWER_OFF_WAIT_FOR_COOLDOWN) static bool power_off_on_cooldown; diff --git a/Marlin/src/gcode/control/M605.cpp b/Marlin/src/gcode/control/M605.cpp index 8a4a7712b0d7..76849ddc2f95 100644 --- a/Marlin/src/gcode/control/M605.cpp +++ b/Marlin/src/gcode/control/M605.cpp @@ -134,7 +134,8 @@ "\nmotion.extruder_duplication: ", motion.extruder_duplication, "\nmotion.duplicate_extruder_x_offset: ", motion.duplicate_extruder_x_offset, "\nmotion.duplicate_extruder_temp_offset: ", motion.duplicate_extruder_temp_offset, - "\nmotion.delayed_move_time: ", motion.delayed_move_time, + "\nmotion.delayed_move_start_ms: ", motion.delayed_move_start_ms, + "\nmotion.delayed_move_interval: ", motion.delayed_move_interval, "\nX1 Home: ", motion.x_home_pos(0), " X1_MIN_POS=", X1_MIN_POS, " X1_MAX_POS=", X1_MAX_POS, "\nX2 Home: ", motion.x_home_pos(1), " X2_MIN_POS=", X2_MIN_POS, " X2_MAX_POS=", X2_MAX_POS, "\nDEFAULT_DUAL_X_CARRIAGE_MODE=", STRINGIFY(DEFAULT_DUAL_X_CARRIAGE_MODE), diff --git a/Marlin/src/gcode/control/M80_M81.cpp b/Marlin/src/gcode/control/M80_M81.cpp index a7653a4037d0..c10e31be6e98 100644 --- a/Marlin/src/gcode/control/M80_M81.cpp +++ b/Marlin/src/gcode/control/M80_M81.cpp @@ -76,6 +76,12 @@ * M81: Turn off Power, including Power Supply, if there is one. * * This code should ALWAYS be available for FULL SHUTDOWN! + * + * With POWER_OFF_TIMER: + * D - Set timer for power-off to occur in some number of seconds + * + * With POWER_OFF_WAIT_FOR_COOLDOWN: + * S - Enable / disable Power-Off when the machine has cooled down */ void GcodeSuite::M81() { planner.finish_and_disable(); @@ -102,10 +108,10 @@ void GcodeSuite::M81() { #if ENABLED(POWER_OFF_TIMER) if (parser.seenval('D')) { - uint16_t delay = parser.value_ushort(); - if (delay > 1) { // skip already observed 1s delay + const uint16_t seconds = parser.value_ushort(); + if (seconds > 1) { // skip already observed 1s delay delayed_power_off = true; - powerManager.setPowerOffTimer(SEC_TO_MS(delay - 1)); + powerManager.setPowerOffTimer(seconds - 1); } } #endif diff --git a/Marlin/src/gcode/feature/camera/M240.cpp b/Marlin/src/gcode/feature/camera/M240.cpp index 7ce0a1934cac..40c6e3c0a39c 100644 --- a/Marlin/src/gcode/feature/camera/M240.cpp +++ b/Marlin/src/gcode/feature/camera/M240.cpp @@ -28,7 +28,7 @@ #include "../../../module/motion.h" // for motion.extruder and motion.position #if PIN_EXISTS(CHDK) - millis_t chdk_timeout; // = 0 + TTimeout chdk_timeout; #endif #ifdef PHOTO_RETRACT_MM @@ -168,7 +168,7 @@ void GcodeSuite::M240() { #if PIN_EXISTS(CHDK) OUT_WRITE(CHDK_PIN, HIGH); - chdk_timeout = millis() + parser.intval('D', PHOTO_SWITCH_MS); + chdk_timeout.start(parser.intval('D', PHOTO_SWITCH_MS)); #elif HAS_PHOTOGRAPH @@ -180,8 +180,7 @@ void GcodeSuite::M240() { #ifdef PHOTO_POSITION #if PHOTO_DELAY_MS > 0 - const millis_t timeout = millis() + parser.intval('P', PHOTO_DELAY_MS); - while (PENDING(millis(), timeout)) marlin.idle(); + MTimeout(parser.intval('P', PHOTO_DELAY_MS)).idle(); #endif motion.blocking_move(old_pos, fr_mm_s); #ifdef PHOTO_RETRACT_MM diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index e84b367e7af4..bbac7a9efd01 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -251,8 +251,7 @@ void GcodeSuite::get_destination_from_command() { * Dwell waits immediately. It does not synchronize. */ void GcodeSuite::dwell(const millis_t time) { - const millis_t start_ms = millis(); - while (PENDING(millis(), start_ms, time)) marlin.idle(); + MTimeout(time).idle(); } /** diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index 4d76f8ab4822..d68f874af7fb 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -45,10 +45,13 @@ int16_t Touch::x, Touch::y; touch_control_t Touch::controls[]; touch_control_t *Touch::current_control; uint16_t Touch::controls_count; -millis_t Touch::next_touch_ms = 0, - Touch::time_to_hold, +millis_t Touch::time_to_hold, Touch::repeat_delay, Touch::nada_start_ms; + Touch::touch_time; + +MTimeout24 Touch::touch_timer; + TouchControlType Touch::touch_control_type = NONE; #if HAS_DISPLAY_SLEEP millis_t Touch::next_sleep_ms; // = 0 @@ -79,8 +82,8 @@ void Touch::idle() { // Return if Touch::idle is called within the same millisecond const millis_t now = millis(); - if (now == next_touch_ms) return; - next_touch_ms = now; + if (touch_timer.pending(now)) return; + touch_timer.start(0, now); // Get the point where the screen is touched int16_t _x, _y; @@ -330,7 +333,7 @@ void Touch::hold(touch_control_t * const control, const millis_t delay/*=0*/) { current_control = control; if (delay) { repeat_delay = _MAX(delay, uint32_t(MIN_REPEAT_DELAY)); - time_to_hold = next_touch_ms + repeat_delay; + time_to_hold = touch_timer.end_ms + repeat_delay; } ui.refresh(); } @@ -378,8 +381,8 @@ bool Touch::get_point(int16_t * const x, int16_t * const y) { #elif PIN_EXISTS(TFT_BACKLIGHT) WRITE(TFT_BACKLIGHT_PIN, HIGH); #endif - next_touch_ms = millis() + 100; safe_delay(20); + touch_timer.start(80); } next_sleep_ms = ui.sleep_timeout_minutes ? millis() + MIN_TO_MS(ui.sleep_timeout_minutes) : 0; } diff --git a/Marlin/src/lcd/tft/touch.h b/Marlin/src/lcd/tft/touch.h index ad1317d5c909..6954eaa7e6a8 100644 --- a/Marlin/src/lcd/tft/touch.h +++ b/Marlin/src/lcd/tft/touch.h @@ -85,6 +85,7 @@ class Touch { static uint16_t controls_count; static millis_t next_touch_ms, time_to_hold, repeat_delay, nada_start_ms; + static MTimeout24 touch_timer; static TouchControlType touch_control_type; static bool get_point(int16_t * const x, int16_t * const y); diff --git a/Marlin/src/libs/autoreport.h b/Marlin/src/libs/autoreport.h index 9aa74ab81e08..0cfe377f31c4 100644 --- a/Marlin/src/libs/autoreport.h +++ b/Marlin/src/libs/autoreport.h @@ -25,23 +25,21 @@ template struct AutoReporter { - millis_t next_report_ms; - uint8_t report_interval; + MSeconds timeout; #if HAS_MULTI_SERIAL SerialMask report_port_mask; AutoReporter() : report_port_mask(SerialMask::All) {} #endif inline void set_interval(uint8_t seconds, const uint8_t limit=60) { - report_interval = _MIN(seconds, limit); - next_report_ms = millis() + SEC_TO_MS(seconds); + timeout.start(_MIN(seconds, limit)); } inline void tick() { - if (!report_interval) return; + if (!timeout.enabled()) return; const millis_t ms = millis(); - if (ELAPSED(ms, next_report_ms)) { - next_report_ms = ms + SEC_TO_MS(report_interval); + if (timeout.elapsed(ms)) { + timeout.prime(ms); PORT_REDIRECT(report_port_mask); Helper::report(); PORT_RESTORE(); diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index b401090d8722..8c4e769dc4ba 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -1818,7 +1818,8 @@ float Motion::get_move_distance(const xyze_pos_t &diff OPTARG(HAS_ROTATIONAL_AXE bool Motion::idex_mirrored_mode = false; // Used in mode 3 xyz_pos_t Motion::raised_parked_position; // Used in mode 1 bool Motion::active_extruder_parked = false; // Used in mode 1, 2 & 3 - millis_t Motion::delayed_move_time = 0; // Used in mode 1 + millis_t Motion::delayed_move_start_ms = 0; // Used in mode 1 + uint16_t Motion::delayed_move_interval = 0; // Used in mode 1 celsius_t Motion::duplicate_extruder_temp_offset = 0; // Used in mode 2 & 3 void Motion::set_extruder_duplication(const bool dupe, const int8_t tool_index/*=-1*/) { @@ -1833,7 +1834,7 @@ float Motion::get_move_distance(const xyze_pos_t &diff OPTARG(HAS_ROTATIONAL_AXE } void Motion::idex_set_parked(const bool park/*=true*/) { - delayed_move_time = 0; + delayed_move_interval = 0; active_extruder_parked = park; if (park) raised_parked_position = position; // Remember current raised toolhead position for use by unpark } @@ -1854,10 +1855,11 @@ float Motion::get_move_distance(const xyze_pos_t &diff OPTARG(HAS_ROTATIONAL_AXE // This is a travel move (with no extrusion) // Skip it, but keep track of the current position // (so it can be used as the start of the next non-travel move) - if (delayed_move_time != UINT32_MAX) { - position = destination; - NOLESS(raised_parked_position.z, destination.z); - delayed_move_time = millis() + 1000UL; + if (delayed_move_interval != 1) { + motion.position = motion.destination; + NOLESS(raised_parked_position.z, motion.destination.z); + delayed_move_start_ms = millis(); + delayed_move_interval = 1000; return true; } } diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index e6a8e232540e..693599fa64d4 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -222,7 +222,8 @@ class Motion { duplicate_extruder_x_offset; // Used in mode 2 & 3 static bool active_extruder_parked; // Used in mode 1, 2 & 3 - static millis_t delayed_move_time; // Used in mode 1 + static millis_t delayed_move_start_ms; // Used in mode 1 + static uint16_t delayed_move_interval; // Used in mode 1 static celsius_t duplicate_extruder_temp_offset; // Used in mode 2 & 3 static bool idex_mirrored_mode; // Used in mode 3 diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 37113662daec..3319cceb7c47 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -544,9 +544,6 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED); #if WATCH_BED bed_watch_t Temperature::watch_bed; // = { 0 } #endif - #if DISABLED(PIDTEMPBED) - millis_t Temperature::next_bed_check_ms; - #endif #endif #if HAS_TEMP_CHAMBER @@ -558,9 +555,6 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED); #if WATCH_CHAMBER chamber_watch_t Temperature::watch_chamber; // = { 0 } #endif - #if DISABLED(PIDTEMPCHAMBER) - millis_t Temperature::next_chamber_check_ms; - #endif #endif #endif @@ -574,7 +568,6 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED); #if WATCH_COOLER cooler_watch_t Temperature::watch_cooler; // = { 0 } #endif - millis_t Temperature::next_cooler_check_ms, Temperature::cooler_fan_flush_ms; #endif #endif @@ -2010,10 +2003,11 @@ void Temperature::mintemp_error(const heater_id_t heater_id OPTARG(ERR_INCLUDE_T do { // 'break' out of this block #if DISABLED(PIDTEMPBED) - if (PENDING(ms, next_bed_check_ms) + static MTimeout24 bed_check_timer; + if (bed_check_timer.pending() && TERN1(PAUSE_CHANGE_REQD, paused_for_probing == last_pause_state) ) break; - next_bed_check_ms = ms + BED_CHECK_INTERVAL; + bed_check_timer.start(BED_CHECK_INTERVAL, ms); TERN_(PAUSE_CHANGE_REQD, last_pause_state = paused_for_probing); #endif @@ -2196,8 +2190,9 @@ void Temperature::mintemp_error(const heater_id_t heater_id OPTARG(ERR_INCLUDE_T // PIDTEMPCHAMBER doesn't support a CHAMBER_VENT yet. temp_chamber.soft_pwm_amount = WITHIN(temp_chamber.celsius, CHAMBER_MINTEMP, CHAMBER_MAXTEMP) ? (int)get_pid_output_chamber() >> 1 : 0; #else - if (ELAPSED(ms, next_chamber_check_ms)) { - next_chamber_check_ms = ms + CHAMBER_CHECK_INTERVAL; + static MTimeout24 chamber_check_timer; + if (chamber_check_timer.elapsed(ms)) { + chamber_check_timer.start(CHAMBER_CHECK_INTERVAL, ms); if (WITHIN(temp_chamber.celsius, CHAMBER_MINTEMP, CHAMBER_MAXTEMP)) { if (flag_chamber_excess_heat) { @@ -2269,14 +2264,14 @@ void Temperature::mintemp_error(const heater_id_t heater_id OPTARG(ERR_INCLUDE_T if (cooler.enabled) { flag_cooler_state = true; // used to allow M106 fan control when cooler is disabled if (temp_cooler.target == 0) temp_cooler.target = COOLER_MIN_TARGET; - if (ELAPSED(ms, next_cooler_check_ms)) { - next_cooler_check_ms = ms + COOLER_CHECK_INTERVAL; + static MTimeout24 cooler_check_timer; + if (cooler_check_timer.elapsed(ms)) { + cooler_check_timer.start(COOLER_CHECK_INTERVAL, ms); if (temp_cooler.is_above_target()) { // too warm? temp_cooler.soft_pwm_amount = MAX_COOLER_POWER; #if ENABLED(COOLER_FAN) const int16_t fan_cooler_pwm = (COOLER_FAN_BASE) + (COOLER_FAN_FACTOR) * ABS(temp_cooler.celsius - temp_cooler.target); set_fan_speed(COOLER_FAN_INDEX, _MIN(fan_cooler_pwm, 255)); // Set cooler fan pwm - cooler_fan_flush_ms = ms + 5000; #endif } else { diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index ceda88738ec4..e3bac7150101 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -794,9 +794,6 @@ class Temperature { #if WATCH_BED static bed_watch_t watch_bed; #endif - #if DISABLED(PIDTEMPBED) - static millis_t next_bed_check_ms; - #endif static temp_raw_range_t temp_sensor_range_bed; #endif @@ -804,9 +801,6 @@ class Temperature { #if WATCH_CHAMBER static chamber_watch_t watch_chamber; #endif - #if DISABLED(PIDTEMPCHAMBER) - static millis_t next_chamber_check_ms; - #endif static temp_raw_range_t temp_sensor_range_chamber; #endif @@ -814,7 +808,6 @@ class Temperature { #if WATCH_COOLER static cooler_watch_t watch_cooler; #endif - static millis_t next_cooler_check_ms, cooler_fan_flush_ms; static temp_raw_range_t temp_sensor_range_cooler; #endif diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 321857048081..d19f0875a1ce 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -854,7 +854,7 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. if (motion.idex_mode == DXC_AUTO_PARK_MODE // If Auto-Park mode is enabled && marlin.isRunning() && !no_move // ...and movement is permitted - && (motion.delayed_move_time || motion.position.x != xhome) // ...and delayed_move_time is set OR not "already parked"... + && (motion.delayed_move_interval || motion.position.x != xhome) // ...and delayed_move_interval is set OR not "already parked"... ) { DEBUG_ECHOLNPGM("Move X to ", xhome); motion.position.x = xhome; diff --git a/buildroot/tests/STM32F103RC_meeb_maple b/buildroot/tests/STM32F103RC_meeb_maple index f2a05abee19a..97ce351971be 100755 --- a/buildroot/tests/STM32F103RC_meeb_maple +++ b/buildroot/tests/STM32F103RC_meeb_maple @@ -12,4 +12,5 @@ set -e restore_configs opt_set MOTHERBOARD BOARD_CCROBOT_MEEB_3DP SERIAL_PORT 1 SERIAL_PORT_2 -1 \ X_DRIVER_TYPE TMC2208 Y_DRIVER_TYPE TMC2208 Z_DRIVER_TYPE TMC2208 E0_DRIVER_TYPE TMC2208 +opt_enable PHOTO_GCODE PHOTO_SWITCH_MS exec_test $1 $2 "MEEB_3DP - Basic Config with TMC2208 SW Serial" "$3" diff --git a/buildroot/tests/STM32F103RE_btt_USB b/buildroot/tests/STM32F103RE_btt_USB index b74b8dd3a3dd..6d9dff4ec919 100755 --- a/buildroot/tests/STM32F103RE_btt_USB +++ b/buildroot/tests/STM32F103RE_btt_USB @@ -17,7 +17,7 @@ exec_test $1 $2 "BigTreeTech SKR E3 DIP v1.0 - Basic Configuration" "$3" restore_configs opt_set MOTHERBOARD BOARD_BTT_SKR_CR6 SERIAL_PORT -1 SERIAL_PORT_2 2 TEMP_SENSOR_BED 1 BUTTON1_PIN PA12 opt_enable CR10_STOCKDISPLAY SDSUPPORT EMERGENCY_PARSER FAN_SOFT_PWM \ - NOZZLE_AS_PROBE Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN Z_SAFE_HOMING \ + NOZZLE_AS_PROBE Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN Z_SAFE_HOMING WAIT_FOR_BED_HEATER \ PROBE_ACTIVATION_SWITCH PROBE_TARE PROBE_TARE_ONLY_WHILE_INACTIVE \ PROBING_HEATERS_OFF PREHEAT_BEFORE_PROBING CUSTOM_USER_BUTTONS BUTTON1_IMMEDIATE \ CUSTOM_MENU_MAIN MAIN_MENU_ITEM_1_CONFIRM MAIN_MENU_ITEM_2_IMMEDIATE MAIN_MENU_ITEM_3_DESC MAIN_MENU_ITEM_3_GCODE \ diff --git a/buildroot/tests/STM32F446VE_fysetc b/buildroot/tests/STM32F446VE_fysetc index bdc51e43ca03..49eac6ac6277 100755 --- a/buildroot/tests/STM32F446VE_fysetc +++ b/buildroot/tests/STM32F446VE_fysetc @@ -17,9 +17,10 @@ exec_test $1 $2 "FYSETC S6 Example" "$3" # Build with FTDI Eve Touch UI and some features # restore_configs -opt_set MOTHERBOARD BOARD_FYSETC_S6_V2_0 SERIAL_PORT 1 X_DRIVER_TYPE TMC2130 +opt_set MOTHERBOARD BOARD_FYSETC_S6_V2_0 SERIAL_PORT 1 X_DRIVER_TYPE TMC2130 \ + TEMP_SENSOR_PROBE 1 TEMP_PROBE_PIN PB6 opt_enable TOUCH_UI_FTDI_EVE LCD_FYSETC_TFT81050 S6_TFT_PINMAP LCD_LANGUAGE_2 SDSUPPORT CUSTOM_MENU_MAIN \ - FIX_MOUNTED_PROBE AUTO_BED_LEVELING_UBL Z_SAFE_HOMING \ + FIX_MOUNTED_PROBE PTC_PROBE PTC_BED AUTO_BED_LEVELING_UBL Z_SAFE_HOMING \ EEPROM_SETTINGS PRINTCOUNTER CALIBRATION_GCODE LIN_ADVANCE \ FILAMENT_RUNOUT_SENSOR ADVANCED_PAUSE_FEATURE NOZZLE_PARK_FEATURE exec_test $1 $2 "FYSETC S6 2 with LCD FYSETC TFT81050" "$3" diff --git a/buildroot/tests/mega1280 b/buildroot/tests/mega1280 index 6d703ac8f687..14a2c7ae9e00 100755 --- a/buildroot/tests/mega1280 +++ b/buildroot/tests/mega1280 @@ -49,7 +49,8 @@ exec_test $1 $2 "ZRIB_V52 | DUAL_X_CARRIAGE" "$3" # Delta Config (generic) + Probeless # use_example_configs delta/generic -opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER DELTA_AUTO_CALIBRATION DELTA_CALIBRATION_MENU +opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER DELTA_AUTO_CALIBRATION DELTA_CALIBRATION_MENU \ + LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TEST exec_test $1 $2 "RAMPS | DELTA | RRD LCD | DELTA_AUTO_CALIBRATION | DELTA_CALIBRATION_MENU" "$3" # diff --git a/buildroot/tests/mega2560 b/buildroot/tests/mega2560 index 468ade98d6f9..03cab45c3590 100755 --- a/buildroot/tests/mega2560 +++ b/buildroot/tests/mega2560 @@ -63,7 +63,7 @@ opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO NUM_SERVOS 1 \ EXTRUDERS 4 TEMP_SENSOR_1 1 TEMP_SENSOR_2 1 TEMP_SENSOR_3 1 TEMP_SENSOR_4 1 FAN_KICKSTART_TIME 500 \ NUM_RUNOUT_SENSORS 4 FIL_RUNOUT2_PIN 44 FIL_RUNOUT3_PIN 45 FIL_RUNOUT4_PIN 46 \ FIL_RUNOUT3_STATE HIGH FILAMENT_RUNOUT_SCRIPT '"M600 T%c"' -opt_enable VIKI2 BOOT_MARLIN_LOGO_ANIMATED SDSUPPORT AUTO_REPORT_SD_STATUS \ +opt_enable VIKI2 BOOT_MARLIN_LOGO_ANIMATED SDSUPPORT AUTO_REPORT_SD_STATUS BINARY_FILE_TRANSFER \ Z_PROBE_SERVO_NR Z_SERVO_ANGLES Z_SERVO_MEASURE_ANGLE DEACTIVATE_SERVOS_AFTER_MOVE Z_SERVO_DEACTIVATE_AFTER_STOW \ AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE PROBE_PT_1 PROBE_PT_2 PROBE_PT_3 PROBE_WAKEUP_TIME_MS \ EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL AUTO_REPORT_POSITION \ diff --git a/buildroot/tests/rambo b/buildroot/tests/rambo index 9b1c7ed421a4..4e533d019792 100755 --- a/buildroot/tests/rambo +++ b/buildroot/tests/rambo @@ -12,23 +12,17 @@ set -e restore_configs opt_set MOTHERBOARD BOARD_RAMBO \ EXTRUDERS 2 TEMP_SENSOR_0 -2 TEMP_SENSOR_1 1 TEMP_SENSOR_BED 2 \ - TEMP_SENSOR_PROBE 1 TEMP_PROBE_PIN 12 \ TEMP_SENSOR_CHAMBER 3 TEMP_CHAMBER_PIN 3 HEATER_CHAMBER_PIN 45 \ PLR_HEAT_BED_EXTRA 5 PLR_BED_THRESHOLD 60 \ GRID_MAX_POINTS_X 16 BACKLASH_MEASUREMENT_FEEDRATE 600 \ AUTO_POWER_E_TEMP 80 FANMUX0_PIN 53 FIL_MOTION1_PIN 45 opt_disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN USE_WATCHDOG -opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TEST \ - FIX_MOUNTED_PROBE CODEPENDENT_XY_HOMING PIDTEMPBED PTC_PROBE PTC_BED \ - PREHEAT_BEFORE_PROBING PROBING_HEATERS_OFF PROBING_FANS_OFF PROBING_STEPPERS_OFF WAIT_FOR_BED_HEATER \ - EEPROM_SETTINGS SDSUPPORT SD_REPRINT_LAST_SELECTED_FILE BINARY_FILE_TRANSFER \ +opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER \ + FIX_MOUNTED_PROBE EEPROM_SETTINGS SDSUPPORT SD_REPRINT_LAST_SELECTED_FILE \ BLINKM PCA9533 PCA9632 RGB_LED RGB_LED_R_PIN RGB_LED_G_PIN RGB_LED_B_PIN LED_CONTROL_MENU \ NEOPIXEL_LED NEOPIXEL_PIN CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CASE_LIGHT_MENU \ PID_PARAMS_PER_HOTEND PID_AUTOTUNE_MENU PID_EDIT_MENU PID_EXTRUSION_SCALING LCD_SHOW_E_TOTAL \ PRINTCOUNTER SERVICE_NAME_1 SERVICE_INTERVAL_1 LCD_BED_TRAMMING BED_TRAMMING_INCLUDE_CENTER \ - NOZZLE_PARK_FEATURE FILAMENT_RUNOUT_SENSOR FILAMENT_RUNOUT_DISTANCE_MM FILAMENT_MOTION_SENSOR FILAMENT_SWITCH_AND_MOTION \ - ADVANCED_PAUSE_FEATURE FILAMENT_LOAD_UNLOAD_GCODES FILAMENT_UNLOAD_ALL_EXTRUDERS \ - PASSWORD_FEATURE PASSWORD_ON_STARTUP PASSWORD_ON_SD_PRINT_MENU PASSWORD_AFTER_SD_PRINT_END PASSWORD_AFTER_SD_PRINT_ABORT \ AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DISTINCT_E_FACTORS \ SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE ONE_CLICK_PRINT NO_SD_AUTOSTART \ BACKLASH_COMPENSATION BACKLASH_GCODE BAUD_RATE_GCODE BEZIER_CURVE_SUPPORT \ @@ -59,6 +53,7 @@ opt_set MOTHERBOARD BOARD_RAMBO \ opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER REVERSE_ENCODER_DIRECTION SDSUPPORT EEPROM_SETTINGS \ S_CURVE_ACCELERATION X_DUAL_ENDSTOPS Y_DUAL_ENDSTOPS \ ADAPTIVE_STEP_SMOOTHING CNC_COORDINATE_SYSTEMS GCODE_MOTION_MODES \ + PASSWORD_FEATURE PASSWORD_ON_STARTUP PASSWORD_ON_SD_PRINT_MENU PASSWORD_AFTER_SD_PRINT_END PASSWORD_AFTER_SD_PRINT_ABORT \ LCD_INFO_MENU LCD_BED_TRAMMING BED_TRAMMING_INCLUDE_CENTER opt_disable MIN_SOFTWARE_ENDSTOP_Z MAX_SOFTWARE_ENDSTOPS exec_test $1 $2 "Rambo CNC Configuration" "$3"