Skip to content

Commit

Permalink
🎨 Misc. fixes and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead authored and Andy-Big committed Jul 20, 2023
1 parent 05c5f12 commit b1543d5
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 21 deletions.
4 changes: 1 addition & 3 deletions Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,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();
}
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/core/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
9 changes: 6 additions & 3 deletions Marlin/src/core/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 9 additions & 5 deletions Marlin/src/gcode/calibrate/G28.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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());

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/sd/M24_M25.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/ramps/pins_MKS_BASE_16.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
//
// Servos
//
#define SERVO1_PIN 12 // Digital 12 / Pin 25
#define SERVO1_PIN 12

//
// Omitted RAMPS pins
Expand Down
18 changes: 10 additions & 8 deletions Marlin/src/pins/ramps/pins_RAMPS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
#define CASE_LIGHT_PIN 65
#endif

#define SERVO1_PIN 12

#include "pins_RAMPS.h"

#ifndef BEEPER_PIN
Expand Down

0 comments on commit b1543d5

Please sign in to comment.