Skip to content

Commit

Permalink
⛙ Merge w/Marlin
Browse files Browse the repository at this point in the history
  • Loading branch information
classicrocker883 committed Aug 29, 2024
2 parents 74515ee + 8ac0f14 commit d0094ab
Show file tree
Hide file tree
Showing 34 changed files with 1,317 additions and 1,259 deletions.
2 changes: 1 addition & 1 deletion Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@

/**
* Select a third serial port on the board to use for communication with the host.
* Currently only supported for AVR, DUE, LPC1768/9 and STM32/STM32F1
* Currently supported for AVR, DUE, SAMD51, LPC1768/9, STM32/STM32F1/HC32, and Teensy 4.x
* :[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
*/
//#define SERIAL_PORT_3 1
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 "2024-08-27"
//#define STRING_DISTRIBUTION_DATE "2024-08-29"

#define STRING_DISTRIBUTION_DATE __DATE__
#define STRING_DISTRIBUTION_TIME __TIME__
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/gcode/control/M80_M81.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
#include "../../feature/power.h"
#endif

#if ENABLED(POWER_LOSS_RECOVERY)
#include "../../feature/powerloss.h"
#endif

#if HAS_SUICIDE
#include "../../MarlinCore.h"
#endif
Expand Down Expand Up @@ -84,6 +88,8 @@ void GcodeSuite::M81() {
ZERO(thermalManager.saved_fan_speed);
#endif

TERN_(POWER_LOSS_RECOVERY, recovery.purge()); // Clear PLR on intentional shutdown

safe_delay(1000); // Wait 1 second before switching off

LCD_MESSAGE_F(MACHINE_NAME " " STR_OFF ".");
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void GCodeQueue::RingBuffer::commit_command(const bool skip_ok
commands[index_w].skip_ok = skip_ok;
TERN_(HAS_MULTI_SERIAL, commands[index_w].port = serial_ind);
TERN_(POWER_LOSS_RECOVERY, recovery.commit_sdpos(index_w));
advance_pos(index_w, 1);
advance_w();
}

/**
Expand Down Expand Up @@ -699,7 +699,7 @@ void GCodeQueue::advance() {
#endif // HAS_MEDIA

// The queue may be reset by a command handler or by code invoked by idle() within a handler
ring_buffer.advance_pos(ring_buffer.index_r, -1);
ring_buffer.advance_r();
}

#if ENABLED(BUFFER_MONITORING)
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/gcode/queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ class GCodeQueue {
inline void clear() { length = index_r = index_w = 0; }

void advance_pos(uint8_t &p, const int inc) { if (++p >= BUFSIZE) p = 0; length += inc; }
inline void advance_w() { advance_pos(index_w, 1); }
inline void advance_r() { if (length) advance_pos(index_r, -1); }

void commit_command(const bool skip_ok
OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind=serial_index_t())
Expand Down
Loading

0 comments on commit d0094ab

Please sign in to comment.