Skip to content

Commit

Permalink
Merge commit 'dabf3939209fd8ea7f6a6327d764c16743aa22aa' into look_at_201
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jan 31, 2020
2 parents 016e4c0 + dabf393 commit 1525c25
Show file tree
Hide file tree
Showing 51 changed files with 1,578 additions and 577 deletions.
3 changes: 2 additions & 1 deletion Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,8 @@
* 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
* 15 : 100k thermistor calibration for JGAurora A5 hotend
* 18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327
* 20 : Pt100 with circuit in the Ultimainboard V2.x
* 20 : Pt100 with circuit in the Ultimainboard V2.x with 5v excitation (AVR)
* 21 : Pt100 with circuit in the Ultimainboard V2.x with 3.3v excitation (STM32 \ LPC176x....)
* 201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x
* 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
* 61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup
Expand Down
2 changes: 1 addition & 1 deletion Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@
// probing on a screwhead or hollow washer, probe near the edges.
//#define CALIBRATION_MEASURE_AT_TOP_EDGES

// Define pin which is read during calibration
// Define the pin to read during calibration
#ifndef CALIBRATION_PIN
#define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop
#define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin
Expand Down
32 changes: 16 additions & 16 deletions Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,36 +291,36 @@ void quickstop_stepper() {
}

void enable_e_steppers() {
#define _ENA_E(N) enable_E##N();
#define _ENA_E(N) ENABLE_AXIS_E##N();
REPEAT(E_STEPPERS, _ENA_E)
}

void enable_all_steppers() {
#if ENABLED(AUTO_POWER_CONTROL)
powerManager.power_on();
#endif
enable_X();
enable_Y();
enable_Z();
ENABLE_AXIS_X();
ENABLE_AXIS_Y();
ENABLE_AXIS_Z();
enable_e_steppers();
}

void disable_e_steppers() {
#define _DIS_E(N) disable_E##N();
#define _DIS_E(N) DISABLE_AXIS_E##N();
REPEAT(E_STEPPERS, _DIS_E)
}

void disable_e_stepper(const uint8_t e) {
#define _CASE_DIS_E(N) case N: disable_E##N(); break;
#define _CASE_DIS_E(N) case N: DISABLE_AXIS_E##N(); break;
switch (e) {
REPEAT(EXTRUDERS, _CASE_DIS_E)
}
}

void disable_all_steppers() {
disable_X();
disable_Y();
disable_Z();
DISABLE_AXIS_X();
DISABLE_AXIS_Y();
DISABLE_AXIS_Z();
disable_e_steppers();
}

Expand Down Expand Up @@ -461,13 +461,13 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
if (!already_shutdown_steppers) {
already_shutdown_steppers = true; // L6470 SPI will consume 99% of free time without this
#if ENABLED(DISABLE_INACTIVE_X)
disable_X();
DISABLE_AXIS_X();
#endif
#if ENABLED(DISABLE_INACTIVE_Y)
disable_Y();
DISABLE_AXIS_Y();
#endif
#if ENABLED(DISABLE_INACTIVE_Z)
disable_Z();
DISABLE_AXIS_Z();
#endif
#if ENABLED(DISABLE_INACTIVE_E)
disable_e_steppers();
Expand Down Expand Up @@ -542,19 +542,19 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
#if ENABLED(SWITCHING_EXTRUDER)
bool oldstatus;
switch (active_extruder) {
default: oldstatus = E0_ENABLE_READ(); enable_E0(); break;
default: oldstatus = E0_ENABLE_READ(); ENABLE_AXIS_E0(); break;
#if E_STEPPERS > 1
case 2: case 3: oldstatus = E1_ENABLE_READ(); enable_E1(); break;
case 2: case 3: oldstatus = E1_ENABLE_READ(); ENABLE_AXIS_E1(); break;
#if E_STEPPERS > 2
case 4: case 5: oldstatus = E2_ENABLE_READ(); enable_E2(); break;
case 4: case 5: oldstatus = E2_ENABLE_READ(); ENABLE_AXIS_E2(); break;
#endif // E_STEPPERS > 2
#endif // E_STEPPERS > 1
}
#else // !SWITCHING_EXTRUDER
bool oldstatus;
switch (active_extruder) {
default:
#define _CASE_EN(N) case N: oldstatus = E##N##_ENABLE_READ(); enable_E##N(); break;
#define _CASE_EN(N) case N: oldstatus = E##N##_ENABLE_READ(); ENABLE_AXIS_E##N(); break;
REPEAT(E_STEPPERS, _CASE_EN);
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,10 @@
//
// Espressif ESP32 WiFi
//
#define BOARD_ESPRESSIF_ESP32 6000
#define BOARD_ESPRESSIF_ESP32 6000 // Generic ESP32
#define BOARD_MRR_ESPA 6001
#define BOARD_MRR_ESPE 6002
#define BOARD_E4D_BOX 6003 // E4d@BOX

//
// Simulations
Expand Down
23 changes: 17 additions & 6 deletions Marlin/src/core/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,23 @@

#define _AXIS(A) (A##_AXIS)

#define _XMIN_ 100
#define _YMIN_ 200
#define _ZMIN_ 300
#define _XMAX_ 101
#define _YMAX_ 201
#define _ZMAX_ 301
#define _XMIN_ 100
#define _YMIN_ 200
#define _ZMIN_ 300
#define _XMAX_ 101
#define _YMAX_ 201
#define _ZMAX_ 301
#define _XDIAG_ 102
#define _YDIAG_ 202
#define _ZDIAG_ 302
#define _E0DIAG_ 400
#define _E1DIAG_ 401
#define _E2DIAG_ 402
#define _E3DIAG_ 403
#define _E4DIAG_ 404
#define _E5DIAG_ 405
#define _E6DIAG_ 406
#define _E7DIAG_ 407

#define _FORCE_INLINE_ __attribute__((__always_inline__)) __inline__
#define FORCE_INLINE __attribute__((always_inline)) inline
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/babystep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void Babystep::add_steps(const AxisEnum axis, const int16_t distance) {
#endif

#if ENABLED(BABYSTEP_ALWAYS_AVAILABLE)
#define BSA_ENABLE(AXIS) do{ switch (AXIS) { case X_AXIS: enable_X(); break; case Y_AXIS: enable_Y(); break; case Z_AXIS: enable_Z(); break; default: break; } }while(0)
#define BSA_ENABLE(AXIS) do{ switch (AXIS) { case X_AXIS: ENABLE_AXIS_X(); break; case Y_AXIS: ENABLE_AXIS_Y(); break; case Z_AXIS: ENABLE_AXIS_Z(); break; default: break; } }while(0)
#else
#define BSA_ENABLE(AXIS) NOOP
#endif
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/binary_protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ class BinaryStream {
uint8_t protocol() { return (meta >> 4) & 0xF; }
uint8_t type() { return meta & 0xF; }
void reset() { token = 0; sync = 0; meta = 0; size = 0; checksum = 0; }
uint8_t data[1];
uint8_t data[2];
};

union Footer {
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/feature/pause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
#endif

// Re-enable the heaters if they timed out
HOTEND_LOOP() thermalManager.reset_heater_idle_timer(e);
HOTEND_LOOP() thermalManager.reset_hotend_idle_timer(e);

// Wait for the heaters to reach the target temperatures
ensure_safe_temperature();
Expand Down Expand Up @@ -633,7 +633,7 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le
bool nozzle_timed_out = false;
HOTEND_LOOP() {
nozzle_timed_out |= thermalManager.hotend_idle[e].timed_out;
thermalManager.reset_heater_idle_timer(e);
thermalManager.reset_hotend_idle_timer(e);
}

if (nozzle_timed_out || thermalManager.hotEnoughToExtrude(active_extruder)) // Load the new filament
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/feature/probe_temp_compensation.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ class ProbeTempComp {
public:

static constexpr temp_calib_t cali_info_init[TSI_COUNT] = {
{ 30, 10, 5, 30 + 10 * 5 }, // Probe
{ 60, 10, 5, 60 + 10 * 5 }, // Bed
{ 10, 5, 30, 30 + 10 * 5 }, // Probe
{ 10, 5, 60, 60 + 10 * 5 }, // Bed
#if ENABLED(USE_TEMP_EXT_COMPENSATION)
{ 180, 5, 20, 180 + 5 * 20 } // Extruder
{ 20, 5, 180, 180 + 5 * 20 } // Extruder
#endif
};
static const temp_calib_t cali_info[TSI_COUNT];
Expand Down
16 changes: 8 additions & 8 deletions Marlin/src/feature/prusa_MMU2/mmu2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ void MMU2::tool_change(uint8_t index) {

if (index != extruder) {

disable_E0();
DISABLE_AXIS_E0();
ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1));

command(MMU_CMD_T0 + index);
Expand All @@ -459,7 +459,7 @@ void MMU2::tool_change(uint8_t index) {
extruder = index; //filament change is finished
active_extruder = 0;

enable_E0();
ENABLE_AXIS_E0();

SERIAL_ECHO_START();
SERIAL_ECHOLNPAIR(MSG_ACTIVE_EXTRUDER, int(extruder));
Expand Down Expand Up @@ -497,13 +497,13 @@ void MMU2::tool_change(const char* special) {
case 'x': {
planner.synchronize();
uint8_t index = mmu2_choose_filament();
disable_E0();
DISABLE_AXIS_E0();
command(MMU_CMD_T0 + index);
manage_response(true, true);
command(MMU_CMD_C0);
mmu_loop();

enable_E0();
ENABLE_AXIS_E0();
extruder = index;
active_extruder = 0;
} break;
Expand Down Expand Up @@ -697,7 +697,7 @@ void MMU2::filament_runout() {

LCD_MESSAGEPGM(MSG_MMU2_EJECTING_FILAMENT);

enable_E0();
ENABLE_AXIS_E0();
current_position.e -= MMU2_FILAMENTCHANGE_EJECT_FEED;
line_to_current_position(2500 / 60);
planner.synchronize();
Expand Down Expand Up @@ -731,7 +731,7 @@ void MMU2::filament_runout() {

BUZZ(200, 404);

disable_E0();
DISABLE_AXIS_E0();

return true;
}
Expand Down Expand Up @@ -776,7 +776,7 @@ void MMU2::filament_runout() {
void MMU2::execute_extruder_sequence(const E_Step * sequence, int steps) {

planner.synchronize();
enable_E0();
ENABLE_AXIS_E0();

const E_Step* step = sequence;

Expand All @@ -794,7 +794,7 @@ void MMU2::filament_runout() {
step++;
}

disable_E0();
DISABLE_AXIS_E0();
}

#endif // HAS_LCD_MENU && MMU2_MENUS
Expand Down
4 changes: 1 addition & 3 deletions Marlin/src/gcode/calibrate/G33.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,6 @@ void GcodeSuite::G33() {
_opposite_results = (_4p_calibration && !towers_set) || probe_points >= 3,
_endstop_results = probe_points != 1 && probe_points != -1 && probe_points != 0,
_angle_results = probe_points >= 3 && towers_set;
static const char save_message[] PROGMEM = "Save with M500 and/or copy to Configuration.h";
int8_t iterations = 0;
float test_precision,
zero_std_dev = (verbose_level ? 999.0f : 0.0f), // 0.0 in dry-run mode : forced end
Expand Down Expand Up @@ -625,8 +624,7 @@ void GcodeSuite::G33() {
sprintf_P(&mess[15], PSTR("%03i.x"), (int)LROUND(zero_std_dev_min));
ui.set_status(mess);
print_calibration_settings(_endstop_results, _angle_results);
serialprintPGM(save_message);
SERIAL_EOL();
SERIAL_ECHOLNPGM("Save with M500 and/or copy to Configuration.h");
}
else { // !end iterations
char mess[15];
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/gcode/calibrate/G76_M871.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ void GcodeSuite::G76() {

// Initialize temperatures
uint16_t target_bed = temp_comp.probe_calib_bed_temp,
target_probe = temp_comp.cali_info_init[TSI_BED].start_temp;
target_probe = temp_comp.cali_info_init[TSI_PROBE].start_temp;
thermalManager.setTargetBed(target_bed);
SERIAL_ECHOLNPGM("Waiting for bed and probe temperature.");
while (fabs(thermalManager.degBed() - float(target_bed)) > 0.1f
Expand Down Expand Up @@ -332,13 +332,13 @@ void GcodeSuite::G76() {
else
SERIAL_ECHOLNPAIR_F("Measured: ", measured_z);

if (target_probe == temp_comp.cali_info_init[TSI_BED].start_temp)
if (target_probe == temp_comp.cali_info_init[TSI_PROBE].start_temp)
temp_comp.prepare_new_calibration(measured_z);
else
temp_comp.push_back_new_measurement(TSI_PROBE, measured_z);

target_probe += temp_comp.cali_info_init[TSI_BED].temp_res;
if (target_probe > temp_comp.cali_info_init[TSI_BED].end_temp) break;
target_probe += temp_comp.cali_info_init[TSI_PROBE].temp_res;
if (target_probe > temp_comp.cali_info_init[TSI_PROBE].end_temp) break;
}

SERIAL_ECHOLNPAIR("Retrieved measurements: ", temp_comp.get_index());
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/gcode/calibrate/M48.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
*
* This function requires the machine to be homed before invocation.
*/

extern const char SP_Y_STR[];

void GcodeSuite::M48() {

if (axis_unhomed_error()) return;
Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/gcode/control/M17_M18_M84.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
*/
void GcodeSuite::M17() {
if (parser.seen("XYZE")) {
if (parser.seen('X')) enable_X();
if (parser.seen('Y')) enable_Y();
if (parser.seen('Z')) enable_Z();
if (parser.seen('X')) ENABLE_AXIS_X();
if (parser.seen('Y')) ENABLE_AXIS_Y();
if (parser.seen('Z')) ENABLE_AXIS_Z();
#if HAS_E_STEPPER_ENABLE
if (parser.seen('E')) enable_e_steppers();
#endif
Expand All @@ -57,9 +57,9 @@ void GcodeSuite::M18_M84() {
else {
if (parser.seen("XYZE")) {
planner.synchronize();
if (parser.seen('X')) disable_X();
if (parser.seen('Y')) disable_Y();
if (parser.seen('Z')) disable_Z();
if (parser.seen('X')) DISABLE_AXIS_X();
if (parser.seen('Y')) DISABLE_AXIS_Y();
if (parser.seen('Z')) DISABLE_AXIS_Z();
#if HAS_E_STEPPER_ENABLE
if (parser.seen('E')) disable_e_steppers();
#endif
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/feature/pause/G60.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void GcodeSuite::G60() {
}

stored_position[slot] = current_position;
SBI(saved_slots, slot);
SBI(saved_slots[slot >> 3], slot & 0x07);

#if ENABLED(SAVED_POSITIONS_DEBUG)
const xyze_pos_t &pos = stored_position[slot];
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/feature/pause/G61.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#if SAVED_POSITIONS

#include "../../../core/language.h"
#include "../../module/planner.h"
#include "../../../module/planner.h"
#include "../../gcode.h"
#include "../../../module/motion.h"

Expand All @@ -48,7 +48,7 @@ void GcodeSuite::G61(void) {
#endif

// No saved position? No axes being restored?
if (!TEST(saved_slots, slot) || !parser.seen("XYZ")) return;
if (!TEST(saved_slots[slot >> 3], slot & 0x07) || !parser.seen("XYZ")) return;

// Apply any given feedrate over 0.0
const float fr = parser.linearval('F');
Expand Down
Loading

0 comments on commit 1525c25

Please sign in to comment.