Skip to content

Commit

Permalink
Merge branch 'bugfix-2.0.x' into 2.0.x-Sapphire-Pro
Browse files Browse the repository at this point in the history
  • Loading branch information
petrzmax committed Mar 30, 2020
2 parents e8b840f + 747a4bb commit d36e6c1
Show file tree
Hide file tree
Showing 18 changed files with 99 additions and 97 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/HAL/LPC1768/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void HAL_init() {

//debug_frmwrk_init();
//_DBG("\n\nDebug running\n");
// Initialise the SD card chip select pins as soon as possible
// Initialize the SD card chip select pins as soon as possible
#if PIN_EXISTS(SS)
OUT_WRITE(SS_PIN, HIGH);
#endif
Expand Down
9 changes: 2 additions & 7 deletions Marlin/src/HAL/STM32/SoftwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@
* The latest version of this library can always be found at
* http://arduiniana.org.
*/

#ifndef SOFTWARESERIAL_H
#define SOFTWARESERIAL_H
#pragma once

#include <Arduino.h>

Expand Down Expand Up @@ -64,7 +62,6 @@ class SoftwareSerial : public Stream {
uint32_t delta_start = 0;

// static data
static bool initialised;
static HardwareTimer timer;
static const IRQn_Type timer_interrupt_number;
static uint32_t timer_interrupt_priority;
Expand All @@ -91,7 +88,7 @@ class SoftwareSerial : public Stream {
public:
// public methods

SoftwareSerial(uint16_t receivePin, uint16_t transmitPin, bool inverse_logic = false);
SoftwareSerial(uint16_t receivePin, uint16_t transmitPin, bool inverse_logic=false);
virtual ~SoftwareSerial();
void begin(long speed);
bool listen();
Expand All @@ -115,5 +112,3 @@ class SoftwareSerial : public Stream {

using Print::write;
};

#endif // SOFTWARESERIAL_H
31 changes: 11 additions & 20 deletions Marlin/src/feature/pause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,6 @@ static bool ensure_safe_temperature(const PauseMode mode=PAUSE_MODE_SAME) {
return thermalManager.wait_for_hotend(active_extruder);
}

void do_pause_e_move(const float &length, const feedRate_t &fr_mm_s) {
#if HAS_FILAMENT_SENSOR
runout.reset();
#endif
current_position.e += length / planner.e_factor[active_extruder];
line_to_current_position(fr_mm_s);
planner.synchronize();
}

/**
* Load filament into the hotend
*
Expand Down Expand Up @@ -217,7 +208,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
#endif

// Slow Load filament
if (slow_load_length) do_pause_e_move(slow_load_length, FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE);
if (slow_load_length) unscaled_e_move(slow_load_length, FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE);

// Fast Load Filament
if (fast_load_length) {
Expand All @@ -226,7 +217,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
planner.settings.retract_acceleration = FILAMENT_CHANGE_FAST_LOAD_ACCEL;
#endif

do_pause_e_move(fast_load_length, FILAMENT_CHANGE_FAST_LOAD_FEEDRATE);
unscaled_e_move(fast_load_length, FILAMENT_CHANGE_FAST_LOAD_FEEDRATE);

#if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0
planner.settings.retract_acceleration = saved_acceleration;
Expand All @@ -253,7 +244,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
#endif
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)
do_pause_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE);
unscaled_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE);
wait_for_user = false;

#else
Expand All @@ -266,7 +257,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
#endif

// Extrude filament to get into hotend
do_pause_e_move(purge_length, ADVANCED_PAUSE_PURGE_FEEDRATE);
unscaled_e_move(purge_length, ADVANCED_PAUSE_PURGE_FEEDRATE);
}

#if ENABLED(HOST_PROMPT_SUPPORT)
Expand Down Expand Up @@ -331,13 +322,13 @@ bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/,
#endif

// Retract filament
do_pause_e_move(-(FILAMENT_UNLOAD_PURGE_RETRACT) * mix_multiplier, (PAUSE_PARK_RETRACT_FEEDRATE) * mix_multiplier);
unscaled_e_move(-(FILAMENT_UNLOAD_PURGE_RETRACT) * mix_multiplier, (PAUSE_PARK_RETRACT_FEEDRATE) * mix_multiplier);

// Wait for filament to cool
safe_delay(FILAMENT_UNLOAD_PURGE_DELAY);

// Quickly purge
do_pause_e_move((FILAMENT_UNLOAD_PURGE_RETRACT + FILAMENT_UNLOAD_PURGE_LENGTH) * mix_multiplier,
unscaled_e_move((FILAMENT_UNLOAD_PURGE_RETRACT + FILAMENT_UNLOAD_PURGE_LENGTH) * mix_multiplier,
(FILAMENT_UNLOAD_PURGE_FEEDRATE) * mix_multiplier);

// Unload filament
Expand All @@ -346,7 +337,7 @@ bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/,
planner.settings.retract_acceleration = FILAMENT_CHANGE_UNLOAD_ACCEL;
#endif

do_pause_e_move(unload_length * mix_multiplier, (FILAMENT_CHANGE_UNLOAD_FEEDRATE) * mix_multiplier);
unscaled_e_move(unload_length * mix_multiplier, (FILAMENT_CHANGE_UNLOAD_FEEDRATE) * mix_multiplier);

#if FILAMENT_CHANGE_FAST_LOAD_ACCEL > 0
planner.settings.retract_acceleration = saved_acceleration;
Expand Down Expand Up @@ -436,7 +427,7 @@ bool pause_print(const float &retract, const xyz_pos_t &park_point, const float

// Initial retract before move to filament change position
if (retract && thermalManager.hotEnoughToExtrude(active_extruder))
do_pause_e_move(retract, PAUSE_PARK_RETRACT_FEEDRATE);
unscaled_e_move(retract, PAUSE_PARK_RETRACT_FEEDRATE);

// Park the nozzle by moving up by z_lift and then moving to (x_pos, y_pos)
if (!axes_need_homing())
Expand Down Expand Up @@ -631,11 +622,11 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le
#if ENABLED(FWRETRACT)
// If retracted before goto pause
if (fwretract.retracted[active_extruder])
do_pause_e_move(-fwretract.settings.retract_length, fwretract.settings.retract_feedrate_mm_s);
unscaled_e_move(-fwretract.settings.retract_length, fwretract.settings.retract_feedrate_mm_s);
#endif

// If resume_position is negative
if (resume_position.e < 0) do_pause_e_move(resume_position.e, feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE));
if (resume_position.e < 0) unscaled_e_move(resume_position.e, feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE));

// Move XY to starting position, then Z
do_blocking_move_to_xy(resume_position, feedRate_t(NOZZLE_PARK_XY_FEEDRATE));
Expand All @@ -644,7 +635,7 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le
do_blocking_move_to_z(resume_position.z, feedRate_t(NOZZLE_PARK_Z_FEEDRATE));

#if ADVANCED_PAUSE_RESUME_PRIME != 0
do_pause_e_move(ADVANCED_PAUSE_RESUME_PRIME, feedRate_t(ADVANCED_PAUSE_PURGE_FEEDRATE));
unscaled_e_move(ADVANCED_PAUSE_RESUME_PRIME, feedRate_t(ADVANCED_PAUSE_PURGE_FEEDRATE));
#endif

// Now all extrusion positions are resumed and ready to be confirmed
Expand Down
2 changes: 0 additions & 2 deletions Marlin/src/feature/pause.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ extern uint8_t did_pause_print;
#define DXC_PASS
#endif

void do_pause_e_move(const float &length, const feedRate_t &fr_mm_s);

bool pause_print(const float &retract, const xyz_pos_t &park_point, const float &unload_length=0, const bool show_lcd=false DXC_PARAMS);

void wait_for_confirmation(const bool is_reload=false, const int8_t max_beep_count=0 DXC_PARAMS);
Expand Down
10 changes: 2 additions & 8 deletions Marlin/src/gcode/feature/camera/M240.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,8 @@

#ifdef PHOTO_RETRACT_MM
inline void e_move_m240(const float length, const feedRate_t &fr_mm_s) {
if (length && thermalManager.hotEnoughToExtrude(active_extruder)) {
#if ENABLED(ADVANCED_PAUSE_FEATURE)
do_pause_e_move(length, fr_mm_s);
#else
current_position.e += length / planner.e_factor[active_extruder];
line_to_current_position(fr_mm_s);
#endif
}
if (length && thermalManager.hotEnoughToExtrude(active_extruder))
unscaled_e_move(length, fr_mm_s);
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2020-03-28"
#define STRING_DISTRIBUTION_DATE "2020-03-30"
#endif

/**
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/language/language_fr.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ namespace Language_fr {
PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Allumer alim.");
PROGMEM Language_Str MSG_SWITCH_PS_OFF = _UxGT("Eteindre alim.");
PROGMEM Language_Str MSG_EXTRUDE = _UxGT("Extrusion");
PROGMEM Language_Str MSG_RETRACT = _UxGT("Rétraction");
PROGMEM Language_Str MSG_RETRACT = _UxGT("Rétractation");
PROGMEM Language_Str MSG_MOVE_AXIS = _UxGT("Déplacer un axe");
PROGMEM Language_Str MSG_BED_LEVELING = _UxGT("Régler Niv. lit");
PROGMEM Language_Str MSG_LEVEL_BED = _UxGT("Niveau du lit");
Expand Down Expand Up @@ -317,7 +317,7 @@ namespace Language_fr {
PROGMEM Language_Str MSG_NO_MOVE = _UxGT("Moteurs bloqués");
PROGMEM Language_Str MSG_KILLED = _UxGT("KILLED");
PROGMEM Language_Str MSG_STOPPED = _UxGT("STOPPÉ");
PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Rétraction mm");
PROGMEM Language_Str MSG_CONTROL_RETRACT = _UxGT("Rétractation mm");
PROGMEM Language_Str MSG_CONTROL_RETRACT_SWAP = _UxGT("Ech. rétr. mm");
PROGMEM Language_Str MSG_CONTROL_RETRACTF = _UxGT("Vit. rétract°");
PROGMEM Language_Str MSG_CONTROL_RETRACT_ZHOP = _UxGT("Saut Z mm");
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/libs/numtostr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ const char* ftostr52sign(const float &f) {

// Convert signed float to string with +12.345 format
const char* ftostr53sign(const float &f) {
long i = (f * 1000 + (f < 0 ? -5: 5)) / 10;
long i = (f * 10000 + (f < 0 ? -5: 5)) / 10;
conv[0] = MINUSOR(i, '+');
conv[1] = DIGIMOD(i, 10000);
conv[2] = DIGIMOD(i, 1000);
Expand Down
15 changes: 15 additions & 0 deletions Marlin/src/module/motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
#include "../lcd/ultralcd.h"
#endif

#if HAS_FILAMENT_SENSOR
#include "../feature/runout.h"
#endif

#if ENABLED(SENSORLESS_HOMING)
#include "../feature/tmc_util.h"
#endif
Expand Down Expand Up @@ -332,6 +336,17 @@ void line_to_current_position(const feedRate_t &fr_mm_s/*=feedrate_mm_s*/) {
planner.buffer_line(current_position, fr_mm_s, active_extruder);
}

#if EXTRUDERS
void unscaled_e_move(const float &length, const feedRate_t &fr_mm_s) {
#if HAS_FILAMENT_SENSOR
runout.reset();
#endif
current_position.e += length / planner.e_factor[active_extruder];
line_to_current_position(fr_mm_s);
planner.synchronize();
}
#endif

#if IS_KINEMATIC

/**
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/module/motion.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ void sync_plan_position_e();
*/
void line_to_current_position(const feedRate_t &fr_mm_s=feedrate_mm_s);

#if EXTRUDERS
void unscaled_e_move(const float &length, const feedRate_t &fr_mm_s);
#endif

void prepare_line_to_destination();

void _internal_move_to_destination(const feedRate_t &fr_mm_s=0.0f
Expand Down
4 changes: 0 additions & 4 deletions Marlin/src/module/planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1519,10 +1519,6 @@ void Planner::check_axes_activity() {

#endif
}

#if ENABLED(SKEW_CORRECTION)
unskew(raw);
#endif
}

#endif // HAS_LEVELING
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/module/tool_change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
}
else {
#if ENABLED(ADVANCED_PAUSE_FEATURE)
do_pause_e_move(-toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.retract_speed));
unscaled_e_move(-toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.retract_speed));
#else
current_position.e -= toolchange_settings.swap_length / planner.e_factor[old_tool];
planner.buffer_line(current_position, MMM_TO_MMS(toolchange_settings.retract_speed), old_tool);
Expand Down Expand Up @@ -991,8 +991,8 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
if (should_swap && !too_cold) {
#if ENABLED(ADVANCED_PAUSE_FEATURE)
do_pause_e_move(toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.prime_speed));
do_pause_e_move(toolchange_settings.extra_prime, ADVANCED_PAUSE_PURGE_FEEDRATE);
unscaled_e_move(toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.prime_speed));
unscaled_e_move(toolchange_settings.extra_prime, ADVANCED_PAUSE_PURGE_FEEDRATE);
#else
current_position.e += toolchange_settings.swap_length / planner.e_factor[new_tool];
planner.buffer_line(current_position, MMM_TO_MMS(toolchange_settings.prime_speed), new_tool);
Expand Down
11 changes: 11 additions & 0 deletions Marlin/src/pins/rambo/pins_RAMBO.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@
#define Z_MIN_PROBE_PIN 30
#endif

#ifndef FIL_RUNOUT_PIN
#define FIL_RUNOUT_PIN 5
#endif

//
// Steppers
//
Expand Down Expand Up @@ -153,6 +157,13 @@
#define SPINDLE_LASER_ENA_PIN 31 // Pullup!
#define SPINDLE_DIR_PIN 32

//
// SPI for Max6675 or Max31855 Thermocouple
//
#ifndef MAX6675_SS_PIN
#define MAX6675_SS_PIN 32 // SPINDLE_DIR_PIN / STAT_LED_BLUE_PIN
#endif

//
// M7/M8/M9 - Coolant Control
//
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/pins/ramps/pins_RAMPS.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@
#define TEMP_BED_PIN 14 // Analog Input
#endif

//
// SPI for Max6675 or Max31855 Thermocouple
#if DISABLED(SDSUPPORT)
#define MAX6675_SS_PIN 66 // Don't use 53 if using Display/SD card
#else
#define MAX6675_SS_PIN 66 // Don't use 49 (SD_DETECT_PIN)
//
#ifndef MAX6675_SS_PIN
#define MAX6675_SS_PIN 66 // Don't use 53 if using Display/SD card (SDSS) or 49 (SD_DETECT_PIN)
#endif

//
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/pins/ramps/pins_TRIGORILLA_14.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@
#define RAMPS_D8_PIN TRIGORILLA_FAN0_PIN
#else
// EEB
#define RAMPS_D8_PINTRIGORILLA_HEATER_BED_PIN
#define RAMPS_D8_PIN TRIGORILLA_HEATER_BED_PIN
#define FAN_PIN TRIGORILLA_FAN0_PIN // Override pin 4 in pins_RAMPS.h
#endif
#elif TEMP_SENSOR_BED
// EFB (Anycubic Kossel default)
#define RAMPS_D9_PIN TRIGORILLA_FAN0_PIN
#define RAMPS_D8_PINTRIGORILLA_HEATER_BED_PIN
#define RAMPS_D8_PIN TRIGORILLA_HEATER_BED_PIN
#else
// EFF
#define RAMPS_D9_PIN TRIGORILLA_FAN1_PIN
Expand All @@ -83,7 +83,7 @@
#define FAN1_PIN TRIGORILLA_FAN1_PIN
#endif
#define FAN2_PIN TRIGORILLA_FAN2_PIN
#define ORIG_E0_AUTO_FAN_PINTRIGORILLA_FAN2_PIN // Used in Anycubic Kossel example config
#define ORIG_E0_AUTO_FAN_PIN TRIGORILLA_FAN2_PIN // Used in Anycubic Kossel example config

#include "pins_RAMPS.h"

Expand Down
37 changes: 0 additions & 37 deletions buildroot/share/tests/mega2560-tests
Original file line number Diff line number Diff line change
Expand Up @@ -12,43 +12,6 @@ set -e
#restore_configs
#exec_test $1 $2 "Default Configuration"

#
# Test 2 extruders (one MAX6675) and heated bed on basic RAMPS 1.4
# Test a "Fix Mounted" Probe with Safe Homing, some arc options,
# linear bed leveling, M48, leveling debug, and firmware retraction.
#
restore_configs
opt_set MOTHERBOARD BOARD_RAMPS_14_EEB
opt_set EXTRUDERS 2
opt_set TEMP_SENSOR_0 -2
opt_set TEMP_SENSOR_1 1
opt_set TEMP_SENSOR_BED 2
opt_set TEMP_SENSOR_PROBE 1
opt_add TEMP_PROBE_PIN 12
opt_set TEMP_SENSOR_CHAMBER 3
opt_add HEATER_CHAMBER_PIN 45
opt_set GRID_MAX_POINTS_X 16
opt_set FANMUX0_PIN 53
opt_disable USE_WATCHDOG
opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TEST \
FIX_MOUNTED_PROBE Z_SAFE_HOMING CODEPENDENT_XY_HOMING PIDTEMPBED \
PROBING_HEATERS_OFF PROBING_FANS_OFF PROBING_STEPPERS_OFF WAIT_FOR_BED_HEATER \
EEPROM_SETTINGS SDSUPPORT SD_REPRINT_LAST_SELECTED_FILE BINARY_FILE_TRANSFER \
BLINKM PCA9632 RGB_LED RGB_LED_R_PIN RGB_LED_G_PIN RGB_LED_B_PIN LED_CONTROL_MENU \
NEOPIXEL_LED CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CASE_LIGHT_MENU \
PID_PARAMS_PER_HOTEND PID_AUTOTUNE_MENU PID_EDIT_MENU LCD_SHOW_E_TOTAL \
PRINTCOUNTER SERVICE_NAME_1 SERVICE_INTERVAL_1 LEVEL_BED_CORNERS \
NOZZLE_PARK_FEATURE FILAMENT_RUNOUT_SENSOR FILAMENT_RUNOUT_DISTANCE_MM \
ADVANCED_PAUSE_FEATURE FILAMENT_LOAD_UNLOAD_GCODES FILAMENT_UNLOAD_ALL_EXTRUDERS \
AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DISTINCT_E_FACTORS \
SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE \
BACKLASH_COMPENSATION BACKLASH_GCODE BAUD_RATE_GCODE BEZIER_CURVE_SUPPORT \
FWRETRACT ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS \
PSU_CONTROL AUTO_POWER_CONTROL POWER_LOSS_RECOVERY POWER_LOSS_PIN POWER_LOSS_STATE \
SLOW_PWM_HEATERS THERMAL_PROTECTION_CHAMBER LIN_ADVANCE EXTRA_LIN_ADVANCE_K \
HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT PINS_DEBUGGING MAX7219_DEBUG M114_DETAIL
exec_test $1 $2 "RAMPS | EXTRUDERS 2 | CHAR LCD + SD | FIX Probe | ABL-Linear | Advanced Pause | PLR | LEDs ..."

#
# Test a probeless build of AUTO_BED_LEVELING_UBL, with lots of extruders
#
Expand Down
Loading

0 comments on commit d36e6c1

Please sign in to comment.