1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-29 23:07:42 +00:00

🎨 Misc. fixes and formatting

This commit is contained in:
Scott Lahteine 2023-07-01 20:38:17 -05:00
parent 7b8a2180ff
commit 179260878f
8 changed files with 32 additions and 21 deletions

View File

@ -356,9 +356,7 @@ void startOrResumeJob() {
TERN_(GCODE_REPEAT_MARKERS, repeat.reset());
TERN_(CANCEL_OBJECTS, cancelable.reset());
TERN_(LCD_SHOW_E_TOTAL, e_move_accumulator = 0);
#if ENABLED(SET_REMAINING_TIME)
ui.reset_remaining_time();
#endif
TERN_(SET_REMAINING_TIME, ui.reset_remaining_time());
}
print_job_timer.start();
}

View File

@ -375,6 +375,8 @@
extern "C++" {
// C++11 solution that is standards compliant. Return type is deduced automatically
template <class N> static constexpr N _MIN(const N val) { return val; }
template <class N> static constexpr N _MAX(const N val) { return val; }
template <class L, class R> static constexpr auto _MIN(const L lhs, const R rhs) -> decltype(lhs + rhs) {
return lhs < rhs ? lhs : rhs;
}

View File

@ -242,11 +242,14 @@ void serialprint_truefalse(const bool tf);
void serial_offset(const_float_t v, const uint8_t sp=0); // For v==0 draw space (sp==1) or plus (sp==2)
void print_bin(const uint16_t val);
void print_pos(NUM_AXIS_ARGS_(const_float_t) FSTR_P const prefix=nullptr, FSTR_P const suffix=nullptr);
inline void print_pos(const xyze_pos_t &xyze, FSTR_P const prefix=nullptr, FSTR_P const suffix=nullptr) {
print_pos(NUM_AXIS_ELEM_(xyze) prefix, suffix);
}
#if LOGICAL_AXES > 1
inline void print_pos(const xyze_pos_t &xyze, FSTR_P const prefix=nullptr, FSTR_P const suffix=nullptr) {
print_pos(NUM_AXIS_ELEM_(xyze) prefix, suffix);
}
#endif
#define SERIAL_POS(SUFFIX,VAR) do { print_pos(VAR, F(" " STRINGIFY(VAR) "="), F(" : " SUFFIX "\n")); }while(0)
#define SERIAL_XYZ(PREFIX,V...) do { print_pos(V, F(PREFIX)); }while(0)

View File

@ -352,7 +352,9 @@ void GcodeSuite::G28() {
endstops.enable(true); // Enable endstops for next homing move
bool finalRaiseZ = false;
#if HAS_Z_AXIS
bool finalRaiseZ = false;
#endif
#if ENABLED(DELTA)
@ -622,10 +624,12 @@ void GcodeSuite::G28() {
// Move to a height where we can use the full xy-area
TERN_(DELTA_HOME_TO_SAFE_ZONE, do_blocking_move_to_z(delta_clip_start_height));
// Move to the configured Z only if Z was homed to MIN, because machines that
// home to MAX historically expect 'G28 Z' to be safe to use at the end of a
// print, and do_move_after_z_homing is not very nuanced.
if (finalRaiseZ) do_move_after_z_homing();
#if HAS_Z_AXIS
// Move to the configured Z only if Z was homed to MIN, because machines that
// home to MAX historically expect 'G28 Z' to be safe to use at the end of a
// print, and do_move_after_z_homing is not very nuanced.
if (finalRaiseZ) do_move_after_z_homing();
#endif
TERN_(CAN_SET_LEVELING_AFTER_G28, if (leveling_restore_state) set_bed_leveling_enabled());

View File

@ -70,7 +70,7 @@ void GcodeSuite::M24() {
#endif
if (card.isFileOpen()) {
card.startOrResumeFilePrinting(); // SD card will now be read for commands
card.startOrResumeFilePrinting(); // SD card will now be read for commands
startOrResumeJob(); // Start (or resume) the print job timer
TERN_(POWER_LOSS_RECOVERY, recovery.prepare());
}

View File

@ -38,7 +38,7 @@
//
// Servos
//
#define SERVO1_PIN 12 // Digital 12 / Pin 25
#define SERVO1_PIN 12
//
// Omitted RAMPS pins

View File

@ -320,14 +320,16 @@
//
// TMC software SPI
//
#ifndef TMC_SPI_MOSI
#define TMC_SPI_MOSI 66
#endif
#ifndef TMC_SPI_MISO
#define TMC_SPI_MISO 44
#endif
#ifndef TMC_SPI_SCK
#define TMC_SPI_SCK 64
#if HAS_TMC_SPI
#ifndef TMC_SPI_MOSI
#define TMC_SPI_MOSI 66
#endif
#ifndef TMC_SPI_MISO
#define TMC_SPI_MISO 44
#endif
#ifndef TMC_SPI_SCK
#define TMC_SPI_SCK 64
#endif
#endif
#if HAS_TMC_UART

View File

@ -57,6 +57,8 @@
#define CASE_LIGHT_PIN 65
#endif
#define SERVO1_PIN 12
#include "pins_RAMPS.h"
#ifndef BEEPER_PIN