Skip to content

Commit

Permalink
Merge upstream
Browse files Browse the repository at this point in the history
Merging upstream changes up to 35775395d9b5206e584b3734ab7e070e072603f8
  • Loading branch information
davidramiro committed Mar 30, 2019
1 parent a9274af commit 7e29a4d
Show file tree
Hide file tree
Showing 18 changed files with 300 additions and 296 deletions.
10 changes: 8 additions & 2 deletions Marlin/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,17 @@
* Safe Homing Options
*/
#if ENABLED(Z_SAFE_HOMING)
#if ENABLED(AUTO_BED_LEVELING_UBL)
// Home close to center so grid points have z heights very close to 0
#define _SAFE_POINT(A) (((GRID_MAX_POINTS_##A) / 2) * (A##_BED_SIZE - 2 * (MESH_INSET)) / (GRID_MAX_POINTS_##A - 1) + MESH_INSET)
#else
#define _SAFE_POINT(A) A##_CENTER
#endif
#ifndef Z_SAFE_HOMING_X_POINT
#define Z_SAFE_HOMING_X_POINT X_CENTER
#define Z_SAFE_HOMING_X_POINT _SAFE_POINT(X)
#endif
#ifndef Z_SAFE_HOMING_Y_POINT
#define Z_SAFE_HOMING_Y_POINT Y_CENTER
#define Z_SAFE_HOMING_Y_POINT _SAFE_POINT(Y)
#endif
#define X_TILT_FULCRUM Z_SAFE_HOMING_X_POINT
#define Y_TILT_FULCRUM Z_SAFE_HOMING_Y_POINT
Expand Down
4 changes: 2 additions & 2 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
*
* :{ 0:'No power switch', 1:'ATX', 2:'X-Box 360' }
*/
//#define POWER_SUPPLY 1
#define POWER_SUPPLY 0

#if POWER_SUPPLY > 0
// Enable this option to leave the PSU off at startup.
Expand Down Expand Up @@ -1245,7 +1245,7 @@
//
#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages
#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113.
//#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating
#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating

//
// M100 Free Memory Watcher
Expand Down
4 changes: 2 additions & 2 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
Expand Down Expand Up @@ -431,7 +431,7 @@
// @section extras

// minimum time in microseconds that a movement needs to take if the buffer is emptied.
#define DEFAULT_MINSEGMENTTIME 50000
#define DEFAULT_MINSEGMENTTIME 30000

// If defined the movements slow down when the look ahead buffer is only half full
#define SLOWDOWN
Expand Down
35 changes: 12 additions & 23 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,13 +609,7 @@ uint8_t target_extruder;
#endif

#if HAS_POWER_SWITCH
bool powersupply_on = (
#if ENABLED(PS_DEFAULT_OFF)
false
#else
true
#endif
);
bool powersupply_on;
#if ENABLED(AUTO_POWER_CONTROL)
#define PSU_ON() powerManager.power_on()
#define PSU_OFF() powerManager.power_off()
Expand Down Expand Up @@ -951,9 +945,9 @@ void setup_powerhold() {
#endif
#if HAS_POWER_SWITCH
#if ENABLED(PS_DEFAULT_OFF)
PSU_OFF();
powersupply_on = true; PSU_OFF();
#else
PSU_ON();
powersupply_on = false; PSU_ON();
#endif
#endif
}
Expand Down Expand Up @@ -7217,7 +7211,6 @@ inline void gcode_M17() {
* Used by M125 and M600
*/
static void wait_for_filament_reload(const int8_t max_beep_count=0) {
nozzle_timed_out = false;
nozzle_timed_out = false;
#ifdef ANYCUBIC_TFT_MODEL
AnycubicTFT.PausedByNozzleTimeout = false;
Expand Down Expand Up @@ -10138,7 +10131,7 @@ inline void gcode_M226() {
NOLESS(thermalManager.lpq_len, 0);
#endif

thermalManager.updatePID();
thermalManager.update_pid();
SERIAL_ECHO_START();
#if ENABLED(PID_PARAMS_PER_HOTEND)
SERIAL_ECHOPAIR(" e:", e); // specify extruder in serial output
Expand Down Expand Up @@ -10284,7 +10277,7 @@ inline void gcode_M303() {
KEEPALIVE_STATE(NOT_BUSY);
#endif

thermalManager.PID_autotune(temp, e, c, u);
thermalManager.pid_autotune(temp, e, c, u);

#if DISABLED(BUSY_WHILE_HEATING)
KEEPALIVE_STATE(IN_HANDLER);
Expand Down Expand Up @@ -14741,28 +14734,26 @@ void prepare_move_to_destination() {

#if ENABLED(TEMP_STAT_LEDS)

static bool red_led = false;
static uint8_t red_led = -1; // Invalid value to force leds initializzation on startup
static millis_t next_status_led_update_ms = 0;

void handle_status_leds(void) {
if (ELAPSED(millis(), next_status_led_update_ms)) {
next_status_led_update_ms += 500; // Update every 0.5s
float max_temp = 0.0;
#if HAS_HEATED_BED
max_temp = MAX3(max_temp, thermalManager.degTargetBed(), thermalManager.degBed());
max_temp = MAX(thermalManager.degTargetBed(), thermalManager.degBed());
#endif
HOTEND_LOOP()
max_temp = MAX3(max_temp, thermalManager.degHotend(e), thermalManager.degTargetHotend(e));
const bool new_led = (max_temp > 55.0) ? true : (max_temp < 54.0) ? false : red_led;
const uint8_t new_led = (max_temp > 55.0) ? HIGH : (max_temp < 54.0 || red_led == -1) ? LOW : red_led;
if (new_led != red_led) {
red_led = new_led;
#if PIN_EXISTS(STAT_LED_RED)
WRITE(STAT_LED_RED_PIN, new_led ? HIGH : LOW);
#if PIN_EXISTS(STAT_LED_BLUE)
WRITE(STAT_LED_BLUE_PIN, new_led ? LOW : HIGH);
#endif
#else
WRITE(STAT_LED_BLUE_PIN, new_led ? HIGH : LOW);
WRITE(STAT_LED_RED_PIN, new_led);
#endif
#if PIN_EXISTS(STAT_LED_BLUE)
WRITE(STAT_LED_BLUE_PIN, !new_led);
#endif
}
}
Expand Down Expand Up @@ -15170,7 +15161,6 @@ void stop() {
}
}


/**
* Marlin entry-point: Set up before the program loop
* - Set up the kill pin, filament runout, power hold
Expand Down Expand Up @@ -15445,7 +15435,6 @@ void setup() {
#endif
}


/**
* The main Marlin program loop
*
Expand Down
2 changes: 1 addition & 1 deletion Marlin/Version.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
Expand Down
2 changes: 1 addition & 1 deletion Marlin/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,6 @@
#define BOARD_TEENSY2 84 // Teensy++2.0 (AT90USB1286) - CLI compile: HARDWARE_MOTHERBOARD=84 make
#define BOARD_5DPRINT 88 // 5DPrint D8 Driver Board

#define MB(board) (MOTHERBOARD==BOARD_##board)
#define MB(board) (defined(BOARD_##board) && MOTHERBOARD==BOARD_##board)

#endif // __BOARDS_H
2 changes: 1 addition & 1 deletion Marlin/configuration_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ void MarlinSettings::postprocess() {
#endif

#if ENABLED(PIDTEMP)
thermalManager.updatePID();
thermalManager.update_pid();
#endif

#if DISABLED(NO_VOLUMETRICS)
Expand Down
Loading

0 comments on commit 7e29a4d

Please sign in to comment.