🎨 Misc code and spacing cleanup

This commit is contained in:
Scott Lahteine 2021-08-21 18:00:55 -05:00
parent 0aa87af82f
commit dc5ae16861
24 changed files with 79 additions and 159 deletions

View File

@ -88,7 +88,7 @@ extern uint8_t marlin_debug_flags;
#if HAS_MULTI_SERIAL #if HAS_MULTI_SERIAL
#define _PORT_REDIRECT(n,p) REMEMBER(n,multiSerial.portMask,p) #define _PORT_REDIRECT(n,p) REMEMBER(n,multiSerial.portMask,p)
#define _PORT_RESTORE(n,p) RESTORE(n) #define _PORT_RESTORE(n,p) RESTORE(n)
#define SERIAL_ASSERT(P) if(multiSerial.portMask!=(P)){ debugger(); } #define SERIAL_ASSERT(P) if (multiSerial.portMask!=(P)) { debugger(); }
// If we have a catchall, use that directly // If we have a catchall, use that directly
#ifdef SERIAL_CATCHALL #ifdef SERIAL_CATCHALL
#define _SERIAL_LEAF_2 SERIAL_CATCHALL #define _SERIAL_LEAF_2 SERIAL_CATCHALL

View File

@ -174,9 +174,7 @@ void Mixer::refresh_collector(const float proportion/*=1.0*/, const uint8_t t/*=
0, 0, // start_z, end_z 0, 0, // start_z, end_z
0, 1, // start_vtool, end_vtool 0, 1, // start_vtool, end_vtool
{0}, {0} // start_mix[], end_mix[] {0}, {0} // start_mix[], end_mix[]
#if ENABLED(GRADIENT_VTOOL) OPTARG(GRADIENT_VTOOL, -1) // vtool_index
, -1 // vtool_index
#endif
}; };
float Mixer::prev_z; // = 0 float Mixer::prev_z; // = 0

View File

@ -191,13 +191,14 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
KEEPALIVE_STATE(PAUSED_FOR_USER); KEEPALIVE_STATE(PAUSED_FOR_USER);
wait_for_user = true; // LCD click or M108 will clear this wait_for_user = true; // LCD click or M108 will clear this
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Load Filament")));
#if ENABLED(HOST_PROMPT_SUPPORT) #if ENABLED(HOST_PROMPT_SUPPORT)
const char tool = '0' + TERN0(MULTI_FILAMENT_SENSOR, active_extruder); const char tool = '0' + TERN0(MULTI_FILAMENT_SENSOR, active_extruder);
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Load Filament T"), tool, CONTINUE_STR); host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Load Filament T"), tool, CONTINUE_STR);
#endif #endif
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Load Filament")));
while (wait_for_user) { while (wait_for_user) {
impatient_beep(max_beep_count); impatient_beep(max_beep_count);
idle_no_sleep(); idle_no_sleep();
@ -237,8 +238,8 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
if (show_lcd) ui.pause_show_message(PAUSE_MESSAGE_PURGE); if (show_lcd) ui.pause_show_message(PAUSE_MESSAGE_PURGE);
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Filament Purging..."), CONTINUE_STR));
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Filament Purging..."))); TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Filament Purging...")));
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Filament Purging..."), CONTINUE_STR));
wait_for_user = true; // A click or M108 breaks the purge_length loop wait_for_user = true; // A click or M108 breaks the purge_length loop
for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count) for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count)
unscaled_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE); unscaled_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE);
@ -272,7 +273,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
#endif #endif
// Keep looping if "Purge More" was selected // Keep looping if "Purge More" was selected
} while (TERN0(M600_PURGE_MORE_RESUMABLE, show_lcd && pause_menu_response == PAUSE_RESPONSE_EXTRUDE_MORE)); } while (TERN0(M600_PURGE_MORE_RESUMABLE, pause_menu_response == PAUSE_RESPONSE_EXTRUDE_MORE));
#endif #endif
TERN_(HOST_PROMPT_SUPPORT, host_action_prompt_end()); TERN_(HOST_PROMPT_SUPPORT, host_action_prompt_end());

View File

@ -38,16 +38,12 @@ int16_t ProbeTempComp::z_offsets_probe[cali_info_init[TSI_PROBE].measurements],
int16_t *ProbeTempComp::sensor_z_offsets[TSI_COUNT] = { int16_t *ProbeTempComp::sensor_z_offsets[TSI_COUNT] = {
ProbeTempComp::z_offsets_probe, ProbeTempComp::z_offsets_bed ProbeTempComp::z_offsets_probe, ProbeTempComp::z_offsets_bed
#if ENABLED(USE_TEMP_EXT_COMPENSATION) OPTARG(USE_TEMP_EXT_COMPENSATION, ProbeTempComp::z_offsets_ext)
, ProbeTempComp::z_offsets_ext
#endif
}; };
const temp_calib_t ProbeTempComp::cali_info[TSI_COUNT] = { const temp_calib_t ProbeTempComp::cali_info[TSI_COUNT] = {
cali_info_init[TSI_PROBE], cali_info_init[TSI_BED] cali_info_init[TSI_PROBE], cali_info_init[TSI_BED]
#if ENABLED(USE_TEMP_EXT_COMPENSATION) OPTARG(USE_TEMP_EXT_COMPENSATION, cali_info_init[TSI_EXT])
, cali_info_init[TSI_EXT]
#endif
}; };
constexpr xyz_pos_t ProbeTempComp::park_point; constexpr xyz_pos_t ProbeTempComp::park_point;

View File

@ -878,9 +878,7 @@ G29_TYPE GcodeSuite::G29() {
// Sync the planner from the current_position // Sync the planner from the current_position
if (planner.leveling_active) sync_plan_position(); if (planner.leveling_active) sync_plan_position();
#if HAS_BED_PROBE TERN_(HAS_BED_PROBE, probe.move_z_after_probing());
probe.move_z_after_probing();
#endif
#ifdef Z_PROBE_END_SCRIPT #ifdef Z_PROBE_END_SCRIPT
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Z Probe End Script: ", Z_PROBE_END_SCRIPT); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("Z Probe End Script: ", Z_PROBE_END_SCRIPT);

View File

@ -135,17 +135,8 @@ void GcodeSuite::M240() {
}; };
#ifdef PHOTO_RETRACT_MM #ifdef PHOTO_RETRACT_MM
const float rval = parser.seenval('R') ? parser.value_linear_units() : _PHOTO_RETRACT_MM; const float rval = parser.linearval('R', _PHOTO_RETRACT_MM);
feedRate_t sval = ( const feedRate_t sval = parser.feedrateval('S', TERN(ADVANCED_PAUSE_FEATURE, PAUSE_PARK_RETRACT_FEEDRATE, TERN(FWRETRACT, RETRACT_FEEDRATE, 45)));
#if ENABLED(ADVANCED_PAUSE_FEATURE)
PAUSE_PARK_RETRACT_FEEDRATE
#elif ENABLED(FWRETRACT)
RETRACT_FEEDRATE
#else
45
#endif
);
if (parser.seenval('S')) sval = parser.value_feedrate();
e_move_m240(-rval, sval); e_move_m240(-rval, sval);
#endif #endif

View File

@ -32,16 +32,7 @@
* G10 - Retract filament according to settings of M207 * G10 - Retract filament according to settings of M207
* TODO: Handle 'G10 P' for tool settings and 'G10 L' for workspace settings * TODO: Handle 'G10 P' for tool settings and 'G10 L' for workspace settings
*/ */
void GcodeSuite::G10() { void GcodeSuite::G10() { fwretract.retract(true OPTARG(HAS_MULTI_EXTRUDER, parser.boolval('S'))); }
#if HAS_MULTI_EXTRUDER
const bool rs = parser.boolval('S');
#endif
fwretract.retract(true
#if HAS_MULTI_EXTRUDER
, rs
#endif
);
}
/** /**
* G11 - Recover filament according to settings of M208 * G11 - Recover filament according to settings of M208

View File

@ -114,9 +114,7 @@ void GcodeSuite::M701() {
true, // show_lcd true, // show_lcd
thermalManager.still_heating(target_extruder), // pause_for_user thermalManager.still_heating(target_extruder), // pause_for_user
PAUSE_MODE_LOAD_FILAMENT // pause_mode PAUSE_MODE_LOAD_FILAMENT // pause_mode
#if ENABLED(DUAL_X_CARRIAGE) OPTARG(DUAL_X_CARRIAGE, target_extruder) // Dual X target
, target_extruder // Dual X target
#endif
); );
#endif #endif

View File

@ -416,7 +416,8 @@ public:
static inline float linearval(const char c, const float dval=0) { return seenval(c) ? value_linear_units() : dval; } static inline float linearval(const char c, const float dval=0) { return seenval(c) ? value_linear_units() : dval; }
static inline float axisunitsval(const char c, const AxisEnum a, const float dval=0) static inline float axisunitsval(const char c, const AxisEnum a, const float dval=0)
{ return seenval(c) ? value_axis_units(a) : dval; } { return seenval(c) ? value_axis_units(a) : dval; }
static inline celsius_t celsiusval(const char c, const float dval=0) { return seenval(c) ? value_celsius() : dval; } static inline celsius_t celsiusval(const char c, const celsius_t dval=0) { return seenval(c) ? value_celsius() : dval; }
static inline feedRate_t feedrateval(const char c, const feedRate_t dval=0) { return seenval(c) ? value_feedrate() : dval; }
#if ENABLED(MARLIN_DEV_MODE) #if ENABLED(MARLIN_DEV_MODE)

View File

@ -118,11 +118,7 @@ bool GCodeQueue::RingBuffer::enqueue(const char *cmd, bool skip_ok/*=true*/
) { ) {
if (*cmd == ';' || length >= BUFSIZE) return false; if (*cmd == ';' || length >= BUFSIZE) return false;
strcpy(commands[index_w].buffer, cmd); strcpy(commands[index_w].buffer, cmd);
commit_command(skip_ok commit_command(skip_ok OPTARG(HAS_MULTI_SERIAL, serial_ind));
#if HAS_MULTI_SERIAL
, serial_ind
#endif
);
return true; return true;
} }
@ -538,11 +534,7 @@ void GCodeQueue::get_serial_commands() {
#endif #endif
// Add the command to the queue // Add the command to the queue
ring_buffer.enqueue(serial.line_buffer, false ring_buffer.enqueue(serial.line_buffer, false OPTARG(HAS_MULTI_SERIAL, p));
#if HAS_MULTI_SERIAL
, p
#endif
);
} }
else else
process_stream_char(serial_char, serial.input_state, serial.line_buffer, serial.count); process_stream_char(serial_char, serial.input_state, serial.line_buffer, serial.count);

View File

@ -390,9 +390,7 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u
LOOP_L_N(y, PAGE_HEIGHT) { LOOP_L_N(y, PAGE_HEIGHT) {
uint32_t k = 0; uint32_t k = 0;
#if HAS_LCD_IO TERN_(HAS_LCD_IO, buffer = (y & 1) ? bufferB : bufferA);
buffer = (y & 1) ? bufferB : bufferA;
#endif
for (uint16_t i = 0; i < (uint32_t)pb->width; i++) { for (uint16_t i = 0; i < (uint32_t)pb->width; i++) {
const uint8_t b = *(((uint8_t *)pb->buf) + i); const uint8_t b = *(((uint8_t *)pb->buf) + i);
const uint16_t c = TEST(b, y) ? TFT_MARLINUI_COLOR : TFT_MARLINBG_COLOR; const uint16_t c = TEST(b, y) ? TFT_MARLINUI_COLOR : TFT_MARLINBG_COLOR;

View File

@ -64,7 +64,7 @@ namespace ExtUI {
ScreenHandler.SetupConfirmAction(setUserConfirmed); ScreenHandler.SetupConfirmAction(setUserConfirmed);
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_POPUP); ScreenHandler.GotoScreen(DGUSLCD_SCREEN_POPUP);
} }
else if (ScreenHandler.getCurrentScreen() == DGUSLCD_SCREEN_POPUP ) { else if (ScreenHandler.getCurrentScreen() == DGUSLCD_SCREEN_POPUP) {
ScreenHandler.SetupConfirmAction(nullptr); ScreenHandler.SetupConfirmAction(nullptr);
ScreenHandler.PopToOldScreen(); ScreenHandler.PopToOldScreen();
} }

View File

@ -569,9 +569,7 @@ void menu_advanced_settings() {
SUBMENU(MSG_JERK, menu_advanced_jerk); SUBMENU(MSG_JERK, menu_advanced_jerk);
#elif HAS_JUNCTION_DEVIATION #elif HAS_JUNCTION_DEVIATION
EDIT_ITEM(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.001f, 0.3f EDIT_ITEM(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.001f, 0.3f
#if ENABLED(LIN_ADVANCE) OPTARG(LIN_ADVANCE, planner.recalculate_max_e_jerk)
, planner.recalculate_max_e_jerk
#endif
); );
#endif #endif

View File

@ -192,9 +192,7 @@ void _lcd_ubl_edit_mesh() {
char ubl_lcd_gcode[20]; char ubl_lcd_gcode[20];
sprintf_P(ubl_lcd_gcode, PSTR("G28\nG26CPH%" PRIi16 TERN_(HAS_HEATED_BED, "B%" PRIi16)) sprintf_P(ubl_lcd_gcode, PSTR("G28\nG26CPH%" PRIi16 TERN_(HAS_HEATED_BED, "B%" PRIi16))
, custom_hotend_temp , custom_hotend_temp
#if HAS_HEATED_BED OPTARG(HAS_HEATED_BED, custom_bed_temp)
, custom_bed_temp
#endif
); );
queue.inject(ubl_lcd_gcode); queue.inject(ubl_lcd_gcode);
} }

View File

@ -1388,9 +1388,7 @@ void Planner::check_axes_activity() {
// Update Fan speeds // Update Fan speeds
// Only if synchronous M106/M107 is disabled // Only if synchronous M106/M107 is disabled
// //
#if HAS_TAIL_FAN_SPEED TERN_(HAS_TAIL_FAN_SPEED, sync_fan_speeds(tail_fan_speed));
sync_fan_speeds(tail_fan_speed);
#endif
TERN_(AUTOTEMP, autotemp_task()); TERN_(AUTOTEMP, autotemp_task());
@ -1585,11 +1583,7 @@ void Planner::check_axes_activity() {
raw.z += ( raw.z += (
#if ENABLED(MESH_BED_LEVELING) #if ENABLED(MESH_BED_LEVELING)
mbl.get_z(raw mbl.get_z(raw OPTARG(ENABLE_LEVELING_FADE_HEIGHT, fade_scaling_factor))
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
, fade_scaling_factor
#endif
)
#elif ENABLED(AUTO_BED_LEVELING_UBL) #elif ENABLED(AUTO_BED_LEVELING_UBL)
fade_scaling_factor ? fade_scaling_factor * ubl.get_z_correction(raw) : 0.0 fade_scaling_factor ? fade_scaling_factor * ubl.get_z_correction(raw) : 0.0
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR) #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
@ -1622,11 +1616,7 @@ void Planner::check_axes_activity() {
raw.z -= ( raw.z -= (
#if ENABLED(MESH_BED_LEVELING) #if ENABLED(MESH_BED_LEVELING)
mbl.get_z(raw mbl.get_z(raw OPTARG(ENABLE_LEVELING_FADE_HEIGHT, fade_scaling_factor))
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
, fade_scaling_factor
#endif
)
#elif ENABLED(AUTO_BED_LEVELING_UBL) #elif ENABLED(AUTO_BED_LEVELING_UBL)
fade_scaling_factor ? fade_scaling_factor * ubl.get_z_correction(raw) : 0.0 fade_scaling_factor ? fade_scaling_factor * ubl.get_z_correction(raw) : 0.0
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR) #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
@ -1811,12 +1801,8 @@ bool Planner::_buffer_steps(const xyze_long_t &target
// Fill the block with the specified movement // Fill the block with the specified movement
if (!_populate_block(block, false, target if (!_populate_block(block, false, target
#if HAS_POSITION_FLOAT OPTARG(HAS_POSITION_FLOAT, target_float)
, target_float OPTARG(HAS_DIST_MM_ARG, cart_dist_mm)
#endif
#if HAS_DIST_MM_ARG
, cart_dist_mm
#endif
, fr_mm_s, extruder, millimeters , fr_mm_s, extruder, millimeters
)) { )) {
// Movement was not queued, probably because it was too short. // Movement was not queued, probably because it was too short.
@ -1975,9 +1961,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
#endif #endif
#endif #endif
#if HAS_EXTRUDERS TERN_(HAS_EXTRUDERS, if (de < 0) SBI(dm, E_AXIS));
if (de < 0) SBI(dm, E_AXIS);
#endif
#if HAS_EXTRUDERS #if HAS_EXTRUDERS
const float esteps_float = de * e_factor[extruder]; const float esteps_float = de * e_factor[extruder];
@ -2075,9 +2059,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
); );
#endif #endif
#if HAS_EXTRUDERS TERN_(HAS_EXTRUDERS, steps_dist_mm.e = esteps_float * steps_to_mm[E_AXIS_N(extruder)]);
steps_dist_mm.e = esteps_float * steps_to_mm[E_AXIS_N(extruder)];
#endif
TERN_(LCD_SHOW_E_TOTAL, e_move_accumulator += steps_dist_mm.e); TERN_(LCD_SHOW_E_TOTAL, e_move_accumulator += steps_dist_mm.e);
@ -2162,9 +2144,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
block->e_to_p_pressure = baricuda_e_to_p_pressure; block->e_to_p_pressure = baricuda_e_to_p_pressure;
#endif #endif
#if HAS_MULTI_EXTRUDER TERN_(HAS_MULTI_EXTRUDER, block->extruder = extruder);
block->extruder = extruder;
#endif
#if ENABLED(AUTO_POWER_CONTROL) #if ENABLED(AUTO_POWER_CONTROL)
if (LINEAR_AXIS_GANG( if (LINEAR_AXIS_GANG(
@ -2986,12 +2966,8 @@ bool Planner::buffer_segment(const abce_pos_t &abce
// Queue the movement. Return 'false' if the move was not queued. // Queue the movement. Return 'false' if the move was not queued.
if (!_buffer_steps(target if (!_buffer_steps(target
#if HAS_POSITION_FLOAT OPTARG(HAS_POSITION_FLOAT, target_float)
, target_float OPTARG(HAS_DIST_MM_ARG, cart_dist_mm)
#endif
#if HAS_DIST_MM_ARG
, cart_dist_mm
#endif
, fr_mm_s, extruder, millimeters) , fr_mm_s, extruder, millimeters)
) return false; ) return false;

View File

@ -2555,9 +2555,7 @@ void MarlinSettings::reset() {
TERN_(HAS_CLASSIC_E_JERK, planner.max_jerk.e = DEFAULT_EJERK); TERN_(HAS_CLASSIC_E_JERK, planner.max_jerk.e = DEFAULT_EJERK);
#endif #endif
#if HAS_JUNCTION_DEVIATION TERN_(HAS_JUNCTION_DEVIATION, planner.junction_deviation_mm = float(JUNCTION_DEVIATION_MM));
planner.junction_deviation_mm = float(JUNCTION_DEVIATION_MM);
#endif
#if HAS_SCARA_OFFSET #if HAS_SCARA_OFFSET
scara_home_offset.reset(); scara_home_offset.reset();
@ -3151,9 +3149,7 @@ void MarlinSettings::reset() {
CONFIG_ECHO_HEADING( CONFIG_ECHO_HEADING(
"Advanced: B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate>" "Advanced: B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate>"
#if HAS_JUNCTION_DEVIATION TERN_(HAS_JUNCTION_DEVIATION, " J<junc_dev>")
" J<junc_dev>"
#endif
#if HAS_CLASSIC_JERK #if HAS_CLASSIC_JERK
" X<max_x_jerk> Y<max_y_jerk> Z<max_z_jerk>" " X<max_x_jerk> Y<max_y_jerk> Z<max_z_jerk>"
TERN_(HAS_CLASSIC_E_JERK, " E<max_e_jerk>") TERN_(HAS_CLASSIC_E_JERK, " E<max_e_jerk>")

View File

@ -1428,14 +1428,10 @@ void Stepper::isr() {
// Get the interval to the next ISR call // Get the interval to the next ISR call
const uint32_t interval = _MIN( const uint32_t interval = _MIN(
uint32_t(HAL_TIMER_TYPE_MAX), // Come back in a very long time
nextMainISR // Time until the next Pulse / Block phase nextMainISR // Time until the next Pulse / Block phase
#if ENABLED(LIN_ADVANCE) OPTARG(LIN_ADVANCE, nextAdvanceISR) // Come back early for Linear Advance?
, nextAdvanceISR // Come back early for Linear Advance? OPTARG(INTEGRATED_BABYSTEPPING, nextBabystepISR) // Come back early for Babystepping?
#endif
#if ENABLED(INTEGRATED_BABYSTEPPING)
, nextBabystepISR // Come back early for Babystepping?
#endif
, uint32_t(HAL_TIMER_TYPE_MAX) // Come back in a very long time
); );
// //

View File

@ -121,7 +121,7 @@ void reset_trinamic_drivers();
#define X_ENABLE_READ() stepperX.isEnabled() #define X_ENABLE_READ() stepperX.isEnabled()
#endif #endif
#if AXIS_HAS_SQUARE_WAVE(X) #if AXIS_HAS_SQUARE_WAVE(X)
#define X_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(X_STEP_PIN); }while(0) #define X_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(X_STEP_PIN); }while(0)
#endif #endif
#endif #endif
@ -149,7 +149,7 @@ void reset_trinamic_drivers();
#define Z_ENABLE_READ() stepperZ.isEnabled() #define Z_ENABLE_READ() stepperZ.isEnabled()
#endif #endif
#if AXIS_HAS_SQUARE_WAVE(Z) #if AXIS_HAS_SQUARE_WAVE(Z)
#define Z_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(Z_STEP_PIN); }while(0) #define Z_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Z_STEP_PIN); }while(0)
#endif #endif
#endif #endif
@ -166,7 +166,7 @@ void reset_trinamic_drivers();
#define X2_ENABLE_READ() stepperX2.isEnabled() #define X2_ENABLE_READ() stepperX2.isEnabled()
#endif #endif
#if AXIS_HAS_SQUARE_WAVE(X2) #if AXIS_HAS_SQUARE_WAVE(X2)
#define X2_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(X2_STEP_PIN); }while(0) #define X2_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(X2_STEP_PIN); }while(0)
#endif #endif
#endif #endif
@ -183,7 +183,7 @@ void reset_trinamic_drivers();
#define Y2_ENABLE_READ() stepperY2.isEnabled() #define Y2_ENABLE_READ() stepperY2.isEnabled()
#endif #endif
#if AXIS_HAS_SQUARE_WAVE(Y2) #if AXIS_HAS_SQUARE_WAVE(Y2)
#define Y2_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(Y2_STEP_PIN); }while(0) #define Y2_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Y2_STEP_PIN); }while(0)
#endif #endif
#endif #endif
@ -200,7 +200,7 @@ void reset_trinamic_drivers();
#define Z2_ENABLE_READ() stepperZ2.isEnabled() #define Z2_ENABLE_READ() stepperZ2.isEnabled()
#endif #endif
#if AXIS_HAS_SQUARE_WAVE(Z2) #if AXIS_HAS_SQUARE_WAVE(Z2)
#define Z2_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(Z2_STEP_PIN); }while(0) #define Z2_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Z2_STEP_PIN); }while(0)
#endif #endif
#endif #endif
@ -217,7 +217,7 @@ void reset_trinamic_drivers();
#define Z3_ENABLE_READ() stepperZ3.isEnabled() #define Z3_ENABLE_READ() stepperZ3.isEnabled()
#endif #endif
#if AXIS_HAS_SQUARE_WAVE(Z3) #if AXIS_HAS_SQUARE_WAVE(Z3)
#define Z3_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(Z3_STEP_PIN); }while(0) #define Z3_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Z3_STEP_PIN); }while(0)
#endif #endif
#endif #endif
@ -234,7 +234,7 @@ void reset_trinamic_drivers();
#define Z4_ENABLE_READ() stepperZ4.isEnabled() #define Z4_ENABLE_READ() stepperZ4.isEnabled()
#endif #endif
#if AXIS_HAS_SQUARE_WAVE(Z4) #if AXIS_HAS_SQUARE_WAVE(Z4)
#define Z4_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(Z4_STEP_PIN); }while(0) #define Z4_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Z4_STEP_PIN); }while(0)
#endif #endif
#endif #endif
@ -293,7 +293,7 @@ void reset_trinamic_drivers();
#define E0_ENABLE_READ() stepperE0.isEnabled() #define E0_ENABLE_READ() stepperE0.isEnabled()
#endif #endif
#if AXIS_HAS_SQUARE_WAVE(E0) #if AXIS_HAS_SQUARE_WAVE(E0)
#define E0_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E0_STEP_PIN); }while(0) #define E0_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E0_STEP_PIN); }while(0)
#endif #endif
#endif #endif
@ -310,7 +310,7 @@ void reset_trinamic_drivers();
#define E1_ENABLE_READ() stepperE1.isEnabled() #define E1_ENABLE_READ() stepperE1.isEnabled()
#endif #endif
#if AXIS_HAS_SQUARE_WAVE(E1) #if AXIS_HAS_SQUARE_WAVE(E1)
#define E1_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E1_STEP_PIN); }while(0) #define E1_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E1_STEP_PIN); }while(0)
#endif #endif
#endif #endif
@ -327,7 +327,7 @@ void reset_trinamic_drivers();
#define E2_ENABLE_READ() stepperE2.isEnabled() #define E2_ENABLE_READ() stepperE2.isEnabled()
#endif #endif
#if AXIS_HAS_SQUARE_WAVE(E2) #if AXIS_HAS_SQUARE_WAVE(E2)
#define E2_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E2_STEP_PIN); }while(0) #define E2_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E2_STEP_PIN); }while(0)
#endif #endif
#endif #endif
@ -344,7 +344,7 @@ void reset_trinamic_drivers();
#define E3_ENABLE_READ() stepperE3.isEnabled() #define E3_ENABLE_READ() stepperE3.isEnabled()
#endif #endif
#if AXIS_HAS_SQUARE_WAVE(E3) #if AXIS_HAS_SQUARE_WAVE(E3)
#define E3_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E3_STEP_PIN); }while(0) #define E3_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E3_STEP_PIN); }while(0)
#endif #endif
#endif #endif
@ -361,7 +361,7 @@ void reset_trinamic_drivers();
#define E4_ENABLE_READ() stepperE4.isEnabled() #define E4_ENABLE_READ() stepperE4.isEnabled()
#endif #endif
#if AXIS_HAS_SQUARE_WAVE(E4) #if AXIS_HAS_SQUARE_WAVE(E4)
#define E4_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E4_STEP_PIN); }while(0) #define E4_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E4_STEP_PIN); }while(0)
#endif #endif
#endif #endif
@ -378,7 +378,7 @@ void reset_trinamic_drivers();
#define E5_ENABLE_READ() stepperE5.isEnabled() #define E5_ENABLE_READ() stepperE5.isEnabled()
#endif #endif
#if AXIS_HAS_SQUARE_WAVE(E5) #if AXIS_HAS_SQUARE_WAVE(E5)
#define E5_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E5_STEP_PIN); }while(0) #define E5_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E5_STEP_PIN); }while(0)
#endif #endif
#endif #endif
@ -395,7 +395,7 @@ void reset_trinamic_drivers();
#define E6_ENABLE_READ() stepperE6.isEnabled() #define E6_ENABLE_READ() stepperE6.isEnabled()
#endif #endif
#if AXIS_HAS_SQUARE_WAVE(E6) #if AXIS_HAS_SQUARE_WAVE(E6)
#define E6_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E6_STEP_PIN); }while(0) #define E6_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E6_STEP_PIN); }while(0)
#endif #endif
#endif #endif
@ -412,6 +412,6 @@ void reset_trinamic_drivers();
#define E7_ENABLE_READ() stepperE7.isEnabled() #define E7_ENABLE_READ() stepperE7.isEnabled()
#endif #endif
#if AXIS_HAS_SQUARE_WAVE(E7) #if AXIS_HAS_SQUARE_WAVE(E7)
#define E7_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E7_STEP_PIN); }while(0) #define E7_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E7_STEP_PIN); }while(0)
#endif #endif
#endif #endif

View File

@ -2288,9 +2288,7 @@ void Temperature::init() {
INIT_FAN_PIN(CONTROLLER_FAN_PIN); INIT_FAN_PIN(CONTROLLER_FAN_PIN);
#endif #endif
#if HAS_MAXTC_SW_SPI TERN_(HAS_MAXTC_SW_SPI, max_tc_spi.init());
max_tc_spi.init();
#endif
HAL_adc_init(); HAL_adc_init();
@ -3037,15 +3035,15 @@ void Temperature::isr() {
#endif #endif
#if HAS_HEATED_BED #if HAS_HEATED_BED
_PWM_MOD(BED,soft_pwm_bed,temp_bed); _PWM_MOD(BED, soft_pwm_bed, temp_bed);
#endif #endif
#if HAS_HEATED_CHAMBER #if HAS_HEATED_CHAMBER
_PWM_MOD(CHAMBER,soft_pwm_chamber,temp_chamber); _PWM_MOD(CHAMBER, soft_pwm_chamber, temp_chamber);
#endif #endif
#if HAS_COOLER #if HAS_COOLER
_PWM_MOD(COOLER,soft_pwm_cooler,temp_cooler); _PWM_MOD(COOLER, soft_pwm_cooler, temp_cooler);
#endif #endif
#if ENABLED(FAN_SOFT_PWM) #if ENABLED(FAN_SOFT_PWM)

View File

@ -918,9 +918,7 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.
if (ok) { if (ok) {
// Do a small lift to avoid the workpiece in the move back (below) // Do a small lift to avoid the workpiece in the move back (below)
current_position.z += toolchange_settings.z_raise; current_position.z += toolchange_settings.z_raise;
#if HAS_SOFTWARE_ENDSTOPS TERN_(HAS_SOFTWARE_ENDSTOPS, NOMORE(current_position.z, soft_endstop.max.z));
NOMORE(current_position.z, soft_endstop.max.z);
#endif
fast_line_to_current(Z_AXIS); fast_line_to_current(Z_AXIS);
planner.synchronize(); planner.synchronize();
} }
@ -1068,9 +1066,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
if (can_move_away && TERN1(TOOLCHANGE_PARK, toolchange_settings.enable_park)) { if (can_move_away && TERN1(TOOLCHANGE_PARK, toolchange_settings.enable_park)) {
// Do a small lift to avoid the workpiece in the move back (below) // Do a small lift to avoid the workpiece in the move back (below)
current_position.z += toolchange_settings.z_raise; current_position.z += toolchange_settings.z_raise;
#if HAS_SOFTWARE_ENDSTOPS TERN_(HAS_SOFTWARE_ENDSTOPS, NOMORE(current_position.z, soft_endstop.max.z));
NOMORE(current_position.z, soft_endstop.max.z);
#endif
fast_line_to_current(Z_AXIS); fast_line_to_current(Z_AXIS);
planner.synchronize(); planner.synchronize();
} }
@ -1117,9 +1113,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
if (can_move_away && TERN1(TOOLCHANGE_PARK, toolchange_settings.enable_park)) { if (can_move_away && TERN1(TOOLCHANGE_PARK, toolchange_settings.enable_park)) {
// Do a small lift to avoid the workpiece in the move back (below) // Do a small lift to avoid the workpiece in the move back (below)
current_position.z += toolchange_settings.z_raise; current_position.z += toolchange_settings.z_raise;
#if HAS_SOFTWARE_ENDSTOPS TERN_(HAS_SOFTWARE_ENDSTOPS, NOMORE(current_position.z, soft_endstop.max.z));
NOMORE(current_position.z, soft_endstop.max.z);
#endif
fast_line_to_current(Z_AXIS); fast_line_to_current(Z_AXIS);
} }
#endif #endif

View File

@ -67,7 +67,7 @@
#define rCPUCTL 0x80 //16<<3 #define rCPUCTL 0x80 //16<<3
/* CPUCTL Bits */ /* CPUCTL Bits */
#define bmPUSLEWID1 0x80 //b7 #define bmPULSEWID1 0x80 //b7
#define bmPULSEWID0 0x40 //b6 #define bmPULSEWID0 0x40 //b6
#define bmIE 0x01 //b0 #define bmIE 0x01 //b0

View File

@ -59,19 +59,19 @@ e-mail : support@circuitsathome.com
// (CPUCTL) // (CPUCTL)
#define rCPUCTL 0x80 //16<<3 #define rCPUCTL 0x80 //16<<3
#define bmPUSLEWID1 0x80 //b7 #define bmPULSEWID1 0x80 //b7
#define bmPULSEWID0 0x40 //b6 #define bmPULSEWID0 0x40 //b6
#define bmIE 0x01 //b0 #define bmIE 0x01 //b0
// bmPUSLEWID1 bmPULSEWID0 Pulse width // bmPULSEWID1 bmPULSEWID0 Pulse width
// 0 0 10.6uS // 0 0 10.6uS
// 0 1 5.3uS // 0 1 5.3uS
// 1 0 2.6uS // 1 0 2.6uS
// 1 1 1.3uS // 1 1 1.3uS
#define PUSLEWIDTH10_6 (0) #define PULSEWIDTH10_6 (0)
#define PUSLEWIDTH5_3 (bmPULSEWID0) #define PULSEWIDTH5_3 (bmPULSEWID0)
#define PUSLEWIDTH2_6 (bmPUSLEWID1) #define PULSEWIDTH2_6 (bmPULSEWID1)
#define PUSLEWIDTH1_3 (bmPULSEWID0 | bmPUSLEWID1) #define PULSEWIDTH1_3 (bmPULSEWID0 | bmPULSEWID1)
// (PINCTL) // (PINCTL)
#define rPINCTL 0x88 //17<<3 #define rPINCTL 0x88 //17<<3

View File

@ -272,11 +272,11 @@ e-mail : support@circuitsathome.com
// //
#define IRQ_SENSE FALLING #define IRQ_SENSE FALLING
#ifdef ARDUINO_ARCH_PIC32 #ifdef ARDUINO_ARCH_PIC32
//#define bmPULSEWIDTH PUSLEWIDTH10_6 //#define bmPULSEWIDTH PULSEWIDTH10_6
#define bmPULSEWIDTH 0 #define bmPULSEWIDTH 0
#define bmIRQ_SENSE 0 #define bmIRQ_SENSE 0
#else #else
#define bmPULSEWIDTH PUSLEWIDTH1_3 #define bmPULSEWIDTH PULSEWIDTH1_3
#define bmIRQ_SENSE 0 #define bmIRQ_SENSE 0
#endif #endif
#else #else