Commit 749fc944 authored by MagoKimbra's avatar MagoKimbra

Revert "Da Annullare"

This reverts commit 1616d4c3.
parent 1616d4c3
This diff is collapsed.
...@@ -126,6 +126,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the log ...@@ -126,6 +126,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the log
#ifdef AUTO_BED_LEVELING_GRID #ifdef AUTO_BED_LEVELING_GRID
// Use one of these defines to specify the origin
// for a topographical map to be printed for your bed.
enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
#define TOPO_ORIGIN OriginFrontLeft
#define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this
// Set the number of grid points per dimension // Set the number of grid points per dimension
......
...@@ -126,6 +126,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo ...@@ -126,6 +126,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#ifdef AUTO_BED_LEVELING_GRID #ifdef AUTO_BED_LEVELING_GRID
// Use one of these defines to specify the origin
// for a topographical map to be printed for your bed.
enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
#define TOPO_ORIGIN OriginFrontLeft
#define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this
// Set the number of grid points per dimension // Set the number of grid points per dimension
......
...@@ -150,6 +150,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the log ...@@ -150,6 +150,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the log
#ifdef AUTO_BED_LEVELING_GRID #ifdef AUTO_BED_LEVELING_GRID
// Use one of these defines to specify the origin
// for a topographical map to be printed for your bed.
enum { OriginBackLeft, OriginFrontLeft, OriginBackRight, OriginFrontRight };
#define TOPO_ORIGIN OriginFrontLeft
#define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this
// Set the number of grid points per dimension // Set the number of grid points per dimension
......
...@@ -252,17 +252,19 @@ extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in m ...@@ -252,17 +252,19 @@ extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in m
extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
extern float current_position[NUM_AXIS]; extern float current_position[NUM_AXIS];
extern float destination[NUM_AXIS]; extern float destination[NUM_AXIS];
extern float home_offset[3]; extern float add_homing[3];
// Hotend offset // Extruder offset
#if HOTENDS > 1 #if EXTRUDERS > 1
#ifndef DUAL_X_CARRIAGE #ifndef SINGLENOZZLE
#define NUM_HOTEND_OFFSETS 2 // only in XY plane #ifndef DUAL_X_CARRIAGE
#else #define NUM_HOTEND_OFFSETS 2 // only in XY plane
#define NUM_HOTEND_OFFSETS 3 // supports offsets in XYZ plane #else
#endif #define NUM_HOTEND_OFFSETS 3 // supports offsets in XYZ plane
extern float hotend_offset[NUM_HOTEND_OFFSETS][HOTENDS]; #endif
#endif // HOTENDS > 1 extern float hotend_offset[NUM_HOTEND_OFFSETS][EXTRUDERS];
#endif // end SINGLENOZZLE
#endif // end EXTRUDERS
#ifdef NPR2 #ifdef NPR2
extern int old_color; // old color for system NPR2 extern int old_color; // old color for system NPR2
......
This diff is collapsed.
This diff is collapsed.
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
// the source g-code and may never actually be reached if acceleration management is active. // the source g-code and may never actually be reached if acceleration management is active.
typedef struct { typedef struct {
// Fields used by the bresenham algorithm for tracing the line // Fields used by the bresenham algorithm for tracing the line
long steps[NUM_AXIS]; // Step count along each axis long steps_x, steps_y, steps_z, steps_e; // Step count along each axis
unsigned long step_event_count; // The number of step events required to complete this block unsigned long step_event_count; // The number of step events required to complete this block
long accelerate_until; // The index of the step event on which to stop acceleration long accelerate_until; // The index of the step event on which to stop acceleration
long decelerate_after; // The index of the step event on which to start decelerating long decelerate_after; // The index of the step event on which to start decelerating
...@@ -49,7 +49,7 @@ typedef struct { ...@@ -49,7 +49,7 @@ typedef struct {
#endif #endif
// Fields used by the motion planner to manage acceleration // Fields used by the motion planner to manage acceleration
// float speed_x, speed_y, speed_z, speed_e; // Nominal mm/sec for each axis // float speed_x, speed_y, speed_z, speed_e; // Nominal mm/sec for each axis
float nominal_speed; // The nominal speed for this block in mm/sec float nominal_speed; // The nominal speed for this block in mm/sec
float entry_speed; // Entry speed at previous-current junction in mm/sec float entry_speed; // Entry speed at previous-current junction in mm/sec
float max_entry_speed; // Maximum allowable junction entry speed in mm/sec float max_entry_speed; // Maximum allowable junction entry speed in mm/sec
...@@ -74,8 +74,6 @@ typedef struct { ...@@ -74,8 +74,6 @@ typedef struct {
volatile char busy; volatile char busy;
} block_t; } block_t;
#define BLOCK_MOD(n) ((n)&(BLOCK_BUFFER_SIZE-1))
#ifdef ENABLE_AUTO_BED_LEVELING #ifdef ENABLE_AUTO_BED_LEVELING
// this holds the required transform to compensate for bed level // this holds the required transform to compensate for bed level
extern matrix_3x3 plan_bed_level_matrix; extern matrix_3x3 plan_bed_level_matrix;
......
...@@ -107,8 +107,11 @@ volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1 }; ...@@ -107,8 +107,11 @@ volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1 };
X_DIR_WRITE(v); \ X_DIR_WRITE(v); \
X2_DIR_WRITE(v); \ X2_DIR_WRITE(v); \
} \ } \
else { \ else{ \
if (current_block->active_driver) X2_DIR_WRITE(v); else X_DIR_WRITE(v); \ if (current_block->active_driver) \
X2_DIR_WRITE(v); \
else \
X_DIR_WRITE(v); \
} }
#define X_APPLY_STEP(v,ALWAYS) \ #define X_APPLY_STEP(v,ALWAYS) \
if (extruder_duplication_enabled || ALWAYS) { \ if (extruder_duplication_enabled || ALWAYS) { \
...@@ -116,7 +119,10 @@ volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1 }; ...@@ -116,7 +119,10 @@ volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1 };
X2_STEP_WRITE(v); \ X2_STEP_WRITE(v); \
} \ } \
else { \ else { \
if (current_block->active_driver != 0) X2_STEP_WRITE(v); else X_STEP_WRITE(v); \ if (current_block->active_driver != 0) \
X2_STEP_WRITE(v); \
else \
X_STEP_WRITE(v); \
} }
#else #else
#define X_APPLY_DIR(v,Q) X_DIR_WRITE(v) #define X_APPLY_DIR(v,Q) X_DIR_WRITE(v)
...@@ -124,16 +130,16 @@ volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1 }; ...@@ -124,16 +130,16 @@ volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1 };
#endif #endif
#ifdef Y_DUAL_STEPPER_DRIVERS #ifdef Y_DUAL_STEPPER_DRIVERS
#define Y_APPLY_DIR(v,Q) { Y_DIR_WRITE(v); Y2_DIR_WRITE((v) != INVERT_Y2_VS_Y_DIR); } #define Y_APPLY_DIR(v,Q) Y_DIR_WRITE(v), Y2_DIR_WRITE((v) != INVERT_Y2_VS_Y_DIR)
#define Y_APPLY_STEP(v,Q) { Y_STEP_WRITE(v); Y2_STEP_WRITE(v); } #define Y_APPLY_STEP(v,Q) Y_STEP_WRITE(v), Y2_STEP_WRITE(v)
#else #else
#define Y_APPLY_DIR(v,Q) Y_DIR_WRITE(v) #define Y_APPLY_DIR(v,Q) Y_DIR_WRITE(v)
#define Y_APPLY_STEP(v,Q) Y_STEP_WRITE(v) #define Y_APPLY_STEP(v,Q) Y_STEP_WRITE(v)
#endif #endif
#ifdef Z_DUAL_STEPPER_DRIVERS #ifdef Z_DUAL_STEPPER_DRIVERS
#define Z_APPLY_DIR(v,Q) { Z_DIR_WRITE(v); Z2_DIR_WRITE(v); } #define Z_APPLY_DIR(v,Q) Z_DIR_WRITE(v), Z2_DIR_WRITE(v)
#define Z_APPLY_STEP(v,Q) { Z_STEP_WRITE(v); Z2_STEP_WRITE(v); } #define Z_APPLY_STEP(v,Q) Z_STEP_WRITE(v), Z2_STEP_WRITE(v)
#else #else
#define Z_APPLY_DIR(v,Q) Z_DIR_WRITE(v) #define Z_APPLY_DIR(v,Q) Z_DIR_WRITE(v)
#define Z_APPLY_STEP(v,Q) Z_STEP_WRITE(v) #define Z_APPLY_STEP(v,Q) Z_STEP_WRITE(v)
...@@ -417,7 +423,7 @@ ISR(TIMER1_COMPA_vect) { ...@@ -417,7 +423,7 @@ ISR(TIMER1_COMPA_vect) {
step_events_completed = 0; step_events_completed = 0;
#ifdef Z_LATE_ENABLE #ifdef Z_LATE_ENABLE
if (current_block->steps[Z_AXIS] > 0) { if (current_block->steps_z > 0) {
enable_z(); enable_z();
OCR1A = 2000; //1ms wait OCR1A = 2000; //1ms wait
return; return;
...@@ -458,7 +464,7 @@ ISR(TIMER1_COMPA_vect) { ...@@ -458,7 +464,7 @@ ISR(TIMER1_COMPA_vect) {
#define UPDATE_ENDSTOP(axis,AXIS,minmax,MINMAX) \ #define UPDATE_ENDSTOP(axis,AXIS,minmax,MINMAX) \
bool axis ##_## minmax ##_endstop = (READ(AXIS ##_## MINMAX ##_PIN) != AXIS ##_## MINMAX ##_ENDSTOP_INVERTING); \ bool axis ##_## minmax ##_endstop = (READ(AXIS ##_## MINMAX ##_PIN) != AXIS ##_## MINMAX ##_ENDSTOP_INVERTING); \
if (axis ##_## minmax ##_endstop && old_## axis ##_## minmax ##_endstop && (current_block->steps[AXIS ##_AXIS] > 0)) { \ if (axis ##_## minmax ##_endstop && old_## axis ##_## minmax ##_endstop && (current_block->steps_## axis > 0)) { \
endstops_trigsteps[AXIS ##_AXIS] = count_position[AXIS ##_AXIS]; \ endstops_trigsteps[AXIS ##_AXIS] = count_position[AXIS ##_AXIS]; \
endstop_## axis ##_hit = true; \ endstop_## axis ##_hit = true; \
step_events_completed = current_block->step_event_count; \ step_events_completed = current_block->step_event_count; \
...@@ -467,54 +473,55 @@ ISR(TIMER1_COMPA_vect) { ...@@ -467,54 +473,55 @@ ISR(TIMER1_COMPA_vect) {
// Check X and Y endstops // Check X and Y endstops
if (check_endstops) { if (check_endstops) {
#ifdef COREXY #ifndef COREXY
if (TEST(out_bits, X_AXIS)) // stepping along -X axis (regular cartesians bot)
#else
// Head direction in -X axis for CoreXY bots. // Head direction in -X axis for CoreXY bots.
// If DeltaX == -DeltaY, the movement is only in Y axis // If DeltaX == -DeltaY, the movement is only in Y axis
if (current_block->steps[A_AXIS] != current_block->steps[B_AXIS] || (TEST(out_bits, A_AXIS) == TEST(out_bits, B_AXIS))) if (current_block->steps_x != current_block->steps_y || (TEST(out_bits, X_AXIS) == TEST(out_bits, Y_AXIS)))
if (TEST(out_bits, X_HEAD)) if (TEST(out_bits, X_HEAD))
#else
if (TEST(out_bits, X_AXIS)) // stepping along -X axis (regular cartesians bot)
#endif #endif
{ // -direction { // -direction
#ifdef DUAL_X_CARRIAGE #ifdef DUAL_X_CARRIAGE
// with 2 x-carriages, endstops are only checked in the homing direction for the active extruder // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
if ((current_block->active_extruder == 0 && X_HOME_DIR == -1) || (current_block->active_extruder != 0 && X2_HOME_DIR == -1)) if ((current_block->active_extruder == 0 && X_HOME_DIR == -1) || (current_block->active_extruder != 0 && X2_HOME_DIR == -1))
#endif #endif
{ {
#if defined(X_MIN_PIN) && X_MIN_PIN >= 0 #if defined(X_MIN_PIN) && X_MIN_PIN >= 0
UPDATE_ENDSTOP(x, X, min, MIN); UPDATE_ENDSTOP(x, X, min, MIN);
#endif #endif
} }
} }
else { // +direction else { // +direction
#ifdef DUAL_X_CARRIAGE #ifdef DUAL_X_CARRIAGE
// with 2 x-carriages, endstops are only checked in the homing direction for the active extruder // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
if ((current_block->active_driver == 0 && X_HOME_DIR == 1) || (current_block->active_extruder != 0 && X2_HOME_DIR == 1)) if ((current_block->active_driver == 0 && X_HOME_DIR == 1) || (current_block->active_extruder != 0 && X2_HOME_DIR == 1))
#endif #endif
{ {
#if defined(X_MAX_PIN) && X_MAX_PIN >= 0 #if defined(X_MAX_PIN) && X_MAX_PIN >= 0
UPDATE_ENDSTOP(x, X, max, MAX); UPDATE_ENDSTOP(x, X, max, MAX);
#endif #endif
} }
} }
#ifdef COREXY
// Head direction in -Y axis for CoreXY bots. #ifndef COREXY
// If DeltaX == DeltaY, the movement is only in X axis
if (current_block->steps[A_AXIS] != current_block->steps[B_AXIS] || (TEST(out_bits, A_AXIS) != TEST(out_bits, B_AXIS)))
if (TEST(out_bits, Y_HEAD))
#else
if (TEST(out_bits, Y_AXIS)) // -direction if (TEST(out_bits, Y_AXIS)) // -direction
#endif #else
{ // -direction // Head direction in -Y axis for CoreXY bots.
#if defined(Y_MIN_PIN) && Y_MIN_PIN >= 0 // If DeltaX == DeltaY, the movement is only in X axis
UPDATE_ENDSTOP(y, Y, min, MIN); if (current_block->steps_x != current_block->steps_y || (TEST(out_bits, X_AXIS) != TEST(out_bits, Y_AXIS)))
#endif if (TEST(out_bits, Y_HEAD))
} #endif
else { // +direction { // -direction
#if defined(Y_MAX_PIN) && Y_MAX_PIN >= 0 #if defined(Y_MIN_PIN) && Y_MIN_PIN >= 0
UPDATE_ENDSTOP(y, Y, max, MAX); UPDATE_ENDSTOP(y, Y, min, MIN);
#endif #endif
} }
else { // +direction
#if defined(Y_MAX_PIN) && Y_MAX_PIN >= 0
UPDATE_ENDSTOP(y, Y, max, MAX);
#endif
}
} }
if (TEST(out_bits, Z_AXIS)) { // -direction if (TEST(out_bits, Z_AXIS)) { // -direction
...@@ -552,7 +559,7 @@ ISR(TIMER1_COMPA_vect) { ...@@ -552,7 +559,7 @@ ISR(TIMER1_COMPA_vect) {
if (check_endstops) { if (check_endstops) {
#if defined(E_MIN_PIN) && E_MIN_PIN > -1 #if defined(E_MIN_PIN) && E_MIN_PIN > -1
bool e_min_endstop=(READ(E_MIN_PIN) != E_MIN_ENDSTOP_INVERTING); bool e_min_endstop=(READ(E_MIN_PIN) != E_MIN_ENDSTOP_INVERTING);
if (e_min_endstop && old_e_min_endstop && (current_block->steps[E_AXIS] > 0)) { if (e_min_endstop && old_e_min_endstop && (current_block->steps_e > 0)) {
endstops_trigsteps[E_AXIS] = count_position[E_AXIS]; endstops_trigsteps[E_AXIS] = count_position[E_AXIS];
endstop_e_hit=true; endstop_e_hit=true;
step_events_completed = current_block->step_event_count; step_events_completed = current_block->step_event_count;
...@@ -575,7 +582,7 @@ ISR(TIMER1_COMPA_vect) { ...@@ -575,7 +582,7 @@ ISR(TIMER1_COMPA_vect) {
#endif #endif
#ifdef ADVANCE #ifdef ADVANCE
counter_e += current_block->steps[E_AXIS]; counter_e += current_block->steps_e;
if (counter_e > 0) { if (counter_e > 0) {
counter_e -= current_block->step_event_count; counter_e -= current_block->step_event_count;
e_steps[current_block->active_driver] += TEST(out_bits, E_AXIS) ? -1 : 1; e_steps[current_block->active_driver] += TEST(out_bits, E_AXIS) ? -1 : 1;
...@@ -589,14 +596,15 @@ ISR(TIMER1_COMPA_vect) { ...@@ -589,14 +596,15 @@ ISR(TIMER1_COMPA_vect) {
* instead of doing each in turn. The extra tests add enough * instead of doing each in turn. The extra tests add enough
* lag to allow it work with without needing NOPs * lag to allow it work with without needing NOPs
*/ */
#define STEP_ADD(axis, AXIS) \ counter_x += current_block->steps_x;
counter_## axis += current_block->steps[AXIS ##_AXIS]; \ if (counter_x > 0) X_STEP_WRITE(HIGH);
if (counter_## axis > 0) { AXIS ##_STEP_WRITE(HIGH); } counter_y += current_block->steps_y;
STEP_ADD(x,X); if (counter_y > 0) Y_STEP_WRITE(HIGH);
STEP_ADD(y,Y); counter_z += current_block->steps_z;
STEP_ADD(z,Z); if (counter_z > 0) Z_STEP_WRITE(HIGH);
#ifndef ADVANCE #ifndef ADVANCE
STEP_ADD(e,E); counter_e += current_block->steps_e;
if (counter_e > 0) E_STEP_WRITE(HIGH);
#endif #endif
#define STEP_IF_COUNTER(axis, AXIS) \ #define STEP_IF_COUNTER(axis, AXIS) \
...@@ -616,7 +624,7 @@ ISR(TIMER1_COMPA_vect) { ...@@ -616,7 +624,7 @@ ISR(TIMER1_COMPA_vect) {
#else // !CONFIG_STEPPERS_TOSHIBA #else // !CONFIG_STEPPERS_TOSHIBA
#define APPLY_MOVEMENT(axis, AXIS) \ #define APPLY_MOVEMENT(axis, AXIS) \
counter_## axis += current_block->steps[AXIS ##_AXIS]; \ counter_## axis += current_block->steps_## axis; \
if (counter_## axis > 0) { \ if (counter_## axis > 0) { \
AXIS ##_APPLY_STEP(!INVERT_## AXIS ##_STEP_PIN,0); \ AXIS ##_APPLY_STEP(!INVERT_## AXIS ##_STEP_PIN,0); \
counter_## axis -= current_block->step_event_count; \ counter_## axis -= current_block->step_event_count; \
......
This diff is collapsed.
...@@ -45,12 +45,21 @@ void manage_heater(); //it is critical that this is called periodically. ...@@ -45,12 +45,21 @@ void manage_heater(); //it is critical that this is called periodically.
// low level conversion routines // low level conversion routines
// do not use these routines and variables outside of temperature.cpp // do not use these routines and variables outside of temperature.cpp
extern int target_temperature[HOTENDS]; #ifndef SINGLENOZZLE
extern float current_temperature[HOTENDS]; extern int target_temperature[EXTRUDERS];
#ifdef SHOW_TEMP_ADC_VALUES extern float current_temperature[EXTRUDERS];
extern int current_temperature_raw[HOTENDS]; #ifdef SHOW_TEMP_ADC_VALUES
extern int current_temperature_bed_raw; extern int current_temperature_raw[EXTRUDERS];
#endif extern int current_temperature_bed_raw;
#endif
#else
extern int target_temperature[1];
extern float current_temperature[1];
#ifdef SHOW_TEMP_ADC_VALUES
extern int current_temperature_raw[1];
extern int current_temperature_bed_raw;
#endif
#endif //SINGLENOZZLE
extern int target_temperature_bed; extern int target_temperature_bed;
extern float current_temperature_bed; extern float current_temperature_bed;
...@@ -63,7 +72,11 @@ extern float current_temperature_bed; ...@@ -63,7 +72,11 @@ extern float current_temperature_bed;
#endif #endif
#ifdef PIDTEMP #ifdef PIDTEMP
extern float Kp[HOTENDS],Ki[HOTENDS],Kd[HOTENDS]; #ifndef SINGLENOZZLE
extern float Kp[EXTRUDERS],Ki[EXTRUDERS],Kd[EXTRUDERS];
#else
extern float Kp[1],Ki[1],Kd[1];
#endif
float scalePID_i(float i); float scalePID_i(float i);
float scalePID_d(float d); float scalePID_d(float d);
float unscalePID_i(float i); float unscalePID_i(float i);
...@@ -81,33 +94,64 @@ extern float current_temperature_bed; ...@@ -81,33 +94,64 @@ extern float current_temperature_bed;
//high level conversion routines, for use outside of temperature.cpp //high level conversion routines, for use outside of temperature.cpp
//inline so that there is no performance decrease. //inline so that there is no performance decrease.
//deg=degreeCelsius //deg=degreeCelsius
#if HOTENDS <= 1
#define HOTEND_ARG 0 FORCE_INLINE float degHotend(uint8_t extruder) {
#ifndef SINGLENOZZLE
return current_temperature[extruder];
#else #else
#define HOTEND_ARG hotend return current_temperature[0];
#endif #endif
}
FORCE_INLINE float degHotend(uint8_t hotend) { return current_temperature[HOTEND_ARG]; }
FORCE_INLINE float degBed() { return current_temperature_bed; }
#ifdef SHOW_TEMP_ADC_VALUES #ifdef SHOW_TEMP_ADC_VALUES
FORCE_INLINE float rawHotendTemp(uint8_t hotend) { return current_temperature_raw[HOTEND_ARG]; } FORCE_INLINE float rawHotendTemp(uint8_t extruder) {
#ifndef SINGLENOZZLE
return current_temperature_raw[extruder];
#else
return current_temperature_raw[0];
#endif
}
FORCE_INLINE float rawBedTemp() { return current_temperature_bed_raw; } FORCE_INLINE float rawBedTemp() { return current_temperature_bed_raw; }
#endif //SHOW_TEMP_ADC_VALUES #endif //SHOW_TEMP_ADC_VALUES
FORCE_INLINE float degTargetHotend(uint8_t hotend) { return target_temperature[HOTEND_ARG]; } FORCE_INLINE float degBed() { return current_temperature_bed; }
FORCE_INLINE float degTargetHotend(uint8_t extruder) {
#ifndef SINGLENOZZLE
return target_temperature[extruder];
#else
return target_temperature[0];
#endif
}
FORCE_INLINE float degTargetBed() { return target_temperature_bed; } FORCE_INLINE float degTargetBed() { return target_temperature_bed; }
FORCE_INLINE void setTargetHotend(const float &celsius, uint8_t hotend) { target_temperature[HOTEND_ARG] = celsius; } FORCE_INLINE void setTargetHotend(const float &celsius, uint8_t extruder) {
#ifndef SINGLENOZZLE
target_temperature[extruder] = celsius;
#else
target_temperature[0] = celsius;
#endif
}
FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; } FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; }
FORCE_INLINE bool isHeatingHotend(uint8_t hotend) { return target_temperature[HOTEND_ARG] > current_temperature[HOTEND_ARG]; } FORCE_INLINE bool isHeatingHotend(uint8_t extruder) {
#ifndef SINGLENOZZLE
return target_temperature[extruder] > current_temperature[extruder];
#else
return target_temperature[0] > current_temperature[0];
#endif
}
FORCE_INLINE bool isHeatingBed() { return target_temperature_bed > current_temperature_bed; } FORCE_INLINE bool isHeatingBed() { return target_temperature_bed > current_temperature_bed; }
FORCE_INLINE bool isCoolingHotend(uint8_t hotend) { return target_temperature[HOTEND_ARG] < current_temperature[HOTEND_ARG]; } FORCE_INLINE bool isCoolingHotend(uint8_t extruder) {
#ifndef SINGLENOZZLE
return target_temperature[extruder] < current_temperature[extruder];
#else
return target_temperature[0] < current_temperature[0];
#endif
}
FORCE_INLINE bool isCoolingBed() { return target_temperature_bed < current_temperature_bed; } FORCE_INLINE bool isCoolingBed() { return target_temperature_bed < current_temperature_bed; }
...@@ -116,7 +160,7 @@ FORCE_INLINE bool isCoolingBed() { return target_temperature_bed < current_tempe ...@@ -116,7 +160,7 @@ FORCE_INLINE bool isCoolingBed() { return target_temperature_bed < current_tempe
#define setTargetHotend0(_celsius) setTargetHotend((_celsius), 0) #define setTargetHotend0(_celsius) setTargetHotend((_celsius), 0)
#define isHeatingHotend0() isHeatingHotend(0) #define isHeatingHotend0() isHeatingHotend(0)
#define isCoolingHotend0() isCoolingHotend(0) #define isCoolingHotend0() isCoolingHotend(0)
#if HOTENDS > 1 #if EXTRUDERS > 1 && !defined(SINGLENOZZLE)
#define degHotend1() degHotend(1) #define degHotend1() degHotend(1)
#define degTargetHotend1() degTargetHotend(1) #define degTargetHotend1() degTargetHotend(1)
#define setTargetHotend1(_celsius) setTargetHotend((_celsius), 1) #define setTargetHotend1(_celsius) setTargetHotend((_celsius), 1)
...@@ -125,7 +169,7 @@ FORCE_INLINE bool isCoolingBed() { return target_temperature_bed < current_tempe ...@@ -125,7 +169,7 @@ FORCE_INLINE bool isCoolingBed() { return target_temperature_bed < current_tempe
#else #else
#define setTargetHotend1(_celsius) do{}while(0) #define setTargetHotend1(_celsius) do{}while(0)
#endif #endif
#if HOTENDS > 2 #if EXTRUDERS > 2 && !defined(SINGLENOZZLE)
#define degHotend2() degHotend(2) #define degHotend2() degHotend(2)
#define degTargetHotend2() degTargetHotend(2) #define degTargetHotend2() degTargetHotend(2)
#define setTargetHotend2(_celsius) setTargetHotend((_celsius), 2) #define setTargetHotend2(_celsius) setTargetHotend((_celsius), 2)
...@@ -134,7 +178,7 @@ FORCE_INLINE bool isCoolingBed() { return target_temperature_bed < current_tempe ...@@ -134,7 +178,7 @@ FORCE_INLINE bool isCoolingBed() { return target_temperature_bed < current_tempe
#else #else
#define setTargetHotend2(_celsius) do{}while(0) #define setTargetHotend2(_celsius) do{}while(0)
#endif #endif
#if HOTENDS > 3 #if EXTRUDERS > 3 && !defined(SINGLENOZZLE)
#define degHotend3() degHotend(3) #define degHotend3() degHotend(3)
#define degTargetHotend3() degTargetHotend(3) #define degTargetHotend3() degTargetHotend(3)
#define setTargetHotend3(_celsius) setTargetHotend((_celsius), 3) #define setTargetHotend3(_celsius) setTargetHotend((_celsius), 3)
...@@ -143,8 +187,8 @@ FORCE_INLINE bool isCoolingBed() { return target_temperature_bed < current_tempe ...@@ -143,8 +187,8 @@ FORCE_INLINE bool isCoolingBed() { return target_temperature_bed < current_tempe
#else #else
#define setTargetHotend3(_celsius) do{}while(0) #define setTargetHotend3(_celsius) do{}while(0)
#endif #endif
#if HOTENDS > 4 #if EXTRUDERS > 4
#error Invalid number of hotend #error Invalid number of extruders
#endif #endif
int getHeaterPower(int heater); int getHeaterPower(int heater);
...@@ -173,7 +217,7 @@ FORCE_INLINE void autotempShutdown() { ...@@ -173,7 +217,7 @@ FORCE_INLINE void autotempShutdown() {
#endif #endif
} }
void PID_autotune(float temp, int hotend, int ncycles); void PID_autotune(float temp, int extruder, int ncycles);
void setExtruderAutoFanState(int pin, bool state); void setExtruderAutoFanState(int pin, bool state);
void checkExtruderAutoFans(); void checkExtruderAutoFans();
......
...@@ -215,8 +215,8 @@ static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned l ...@@ -215,8 +215,8 @@ static void menu_action_setting_edit_callback_long5(const char* pstr, unsigned l
#define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args) #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args)
#endif //!ENCODER_RATE_MULTIPLIER #endif //!ENCODER_RATE_MULTIPLIER
#define END_MENU() \ #define END_MENU() \
if (encoderLine >= _menuItemNr) encoderPosition = _menuItemNr * ENCODER_STEPS_PER_MENU_ITEM - 1; encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM;\ if (encoderPosition / ENCODER_STEPS_PER_MENU_ITEM >= _menuItemNr) encoderPosition = _menuItemNr * ENCODER_STEPS_PER_MENU_ITEM - 1; \
if (encoderLine >= currentMenuViewOffset + LCD_HEIGHT) { currentMenuViewOffset = encoderLine - LCD_HEIGHT + 1; lcdDrawUpdate = 1; _lineNr = currentMenuViewOffset - 1; _drawLineNr = -1; } \ if ((uint8_t)(encoderPosition / ENCODER_STEPS_PER_MENU_ITEM) >= currentMenuViewOffset + LCD_HEIGHT) { currentMenuViewOffset = (encoderPosition / ENCODER_STEPS_PER_MENU_ITEM) - LCD_HEIGHT + 1; lcdDrawUpdate = 1; _lineNr = currentMenuViewOffset - 1; _drawLineNr = -1; } \
} } while(0) } } while(0)
/** Used variables to keep track of the menu */ /** Used variables to keep track of the menu */
...@@ -450,7 +450,7 @@ static void lcd_main_menu() { ...@@ -450,7 +450,7 @@ static void lcd_main_menu() {
void lcd_set_home_offsets() { void lcd_set_home_offsets() {
for(int8_t i=0; i < NUM_AXIS; i++) { for(int8_t i=0; i < NUM_AXIS; i++) {
if (i != E_AXIS) { if (i != E_AXIS) {
home_offset[i] -= current_position[i]; add_homing[i] -= current_position[i];
current_position[i] = 0.0; current_position[i] = 0.0;
} }
} }
...@@ -758,7 +758,7 @@ void lcd_level_bed() ...@@ -758,7 +758,7 @@ void lcd_level_bed()
delay(1200); delay(1200);
encoderPosition = 0; encoderPosition = 0;
lcd.clear(); lcd.clear();
currentMenu = lcd_status_screen; currentMenu = lcd_status_screen;
lcd_status_screen(); lcd_status_screen();
pageShowInfo=0; pageShowInfo=0;
...@@ -975,21 +975,21 @@ static void lcd_control_temperature_menu() { ...@@ -975,21 +975,21 @@ static void lcd_control_temperature_menu() {
#if TEMP_SENSOR_0 != 0 #if TEMP_SENSOR_0 != 0
MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15); MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
#endif #endif
#if HOTENDS > 1 #if EXTRUDERS > 1
#if TEMP_SENSOR_1 != 0 #if TEMP_SENSOR_1 != 0
MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE " 2", &target_temperature[1], 0, HEATER_1_MAXTEMP - 15); MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE " 2", &target_temperature[1], 0, HEATER_1_MAXTEMP - 15);
#endif #endif
#if HOTENDS > 2 #if EXTRUDERS > 2
#if TEMP_SENSOR_2 != 0 #if TEMP_SENSOR_2 != 0
MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE " 3", &target_temperature[2], 0, HEATER_2_MAXTEMP - 15); MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE " 3", &target_temperature[2], 0, HEATER_2_MAXTEMP - 15);
#endif #endif
#if HOTENDS > 3 #if EXTRUDERS > 3
#if TEMP_SENSOR_3 != 0 #if TEMP_SENSOR_3 != 0
MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE " 4", &target_temperature[3], 0, HEATER_3_MAXTEMP - 15); MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE " 4", &target_temperature[3], 0, HEATER_3_MAXTEMP - 15);
#endif #endif
#endif //HOTENDS > 3 #endif //EXTRUDERS > 3
#endif //HOTENDS > 2 #endif //EXTRUDERS > 2
#endif //HOTENDS > 1 #endif //EXTRUDERS > 1
#if TEMP_SENSOR_BED != 0 #if TEMP_SENSOR_BED != 0
MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15); MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15);
#endif #endif
...@@ -1001,40 +1001,42 @@ static void lcd_control_temperature_menu() { ...@@ -1001,40 +1001,42 @@ static void lcd_control_temperature_menu() {
MENU_ITEM_EDIT(float32, MSG_FACTOR, &autotemp_factor, 0.0, 1.0); MENU_ITEM_EDIT(float32, MSG_FACTOR, &autotemp_factor, 0.0, 1.0);
#endif #endif
#ifdef PIDTEMP #ifdef PIDTEMP
// set up temp variables - undo the default scaling // set up temp variables - undo the default scaling
raw_Ki = unscalePID_i(Ki[0]); raw_Ki = unscalePID_i(Ki[0]);
raw_Kd = unscalePID_d(Kd[0]); raw_Kd = unscalePID_d(Kd[0]);
MENU_ITEM_EDIT(float52, MSG_PID_P, &Kp[0], 1, 9990); MENU_ITEM_EDIT(float52, MSG_PID_P, &Kp[0], 1, 9990);
// i is typically a small value so allows values below 1 // i is typically a small value so allows values below 1
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I, &raw_Ki, 0.01, 9990, copy_and_scalePID_i); MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I, &raw_Ki, 0.01, 9990, copy_and_scalePID_i);
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D, &raw_Kd, 1, 9990, copy_and_scalePID_d); MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D, &raw_Kd, 1, 9990, copy_and_scalePID_d);
#if HOTENDS > 1 #ifndef SINGLENOZZLE
// set up temp variables - undo the default scaling #if EXTRUDERS > 1
raw_Ki = unscalePID_i(Ki[1]); // set up temp variables - undo the default scaling
raw_Kd = unscalePID_d(Kd[1]); raw_Ki = unscalePID_i(Ki[1]);
MENU_ITEM_EDIT(float52, MSG_PID_P " E2", &Kp[1], 1, 9990); raw_Kd = unscalePID_d(Kd[1]);
// i is typically a small value so allows values below 1 MENU_ITEM_EDIT(float52, MSG_PID_P " E2", &Kp[1], 1, 9990);
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I " E2", &raw_Ki, 0.01, 9990, copy_and_scalePID_i); // i is typically a small value so allows values below 1
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D " E2", &raw_Kd, 1, 9990, copy_and_scalePID_d); MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I " E2", &raw_Ki, 0.01, 9990, copy_and_scalePID_i);
#endif //HOTENDS > 1 MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D " E2", &raw_Kd, 1, 9990, copy_and_scalePID_d);
#if HOTENDS > 2 #endif //EXTRUDERS > 1
// set up temp variables - undo the default scaling #if EXTRUDERS > 2
raw_Ki = unscalePID_i(Ki[2]); // set up temp variables - undo the default scaling
raw_Kd = unscalePID_d(Kd[2]); raw_Ki = unscalePID_i(Ki[2]);
MENU_ITEM_EDIT(float52, MSG_PID_P " E3", &Kp[2], 1, 9990); raw_Kd = unscalePID_d(Kd[2]);
// i is typically a small value so allows values below 1 MENU_ITEM_EDIT(float52, MSG_PID_P " E3", &Kp[2], 1, 9990);
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I " E3", &raw_Ki, 0.01, 9990, copy_and_scalePID_i); // i is typically a small value so allows values below 1
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D " E3", &raw_Kd, 1, 9990, copy_and_scalePID_d); MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I " E3", &raw_Ki, 0.01, 9990, copy_and_scalePID_i);
#endif //HOTENDS > 2 MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D " E3", &raw_Kd, 1, 9990, copy_and_scalePID_d);
#if HOTENDS > 3 #endif //EXTRUDERS > 2
// set up temp variables - undo the default scaling #if EXTRUDERS > 3
raw_Ki = unscalePID_i(Ki[3]); // set up temp variables - undo the default scaling
raw_Kd = unscalePID_d(Kd[3]); raw_Ki = unscalePID_i(Ki[3]);
MENU_ITEM_EDIT(float52, MSG_PID_P " E4", &Kp[3], 1, 9990); raw_Kd = unscalePID_d(Kd[3]);
// i is typically a small value so allows values below 1 MENU_ITEM_EDIT(float52, MSG_PID_P " E4", &Kp[3], 1, 9990);
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I " E4", &raw_Ki, 0.01, 9990, copy_and_scalePID_i); // i is typically a small value so allows values below 1
MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D " E4", &raw_Kd, 1, 9990, copy_and_scalePID_d); MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I " E4", &raw_Ki, 0.01, 9990, copy_and_scalePID_i);
#endif //HOTENDS > 2 MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D " E4", &raw_Kd, 1, 9990, copy_and_scalePID_d);
#endif //EXTRUDERS > 2
#endif //SINGLENOZZLE
#endif //PIDTEMP #endif //PIDTEMP
MENU_ITEM(submenu, MSG_PREHEAT_PLA_SETTINGS, lcd_control_temperature_preheat_pla_settings_menu); MENU_ITEM(submenu, MSG_PREHEAT_PLA_SETTINGS, lcd_control_temperature_preheat_pla_settings_menu);
MENU_ITEM(submenu, MSG_PREHEAT_ABS_SETTINGS, lcd_control_temperature_preheat_abs_settings_menu); MENU_ITEM(submenu, MSG_PREHEAT_ABS_SETTINGS, lcd_control_temperature_preheat_abs_settings_menu);
......
...@@ -468,10 +468,10 @@ static void lcd_implementation_status_screen() { ...@@ -468,10 +468,10 @@ static void lcd_implementation_status_screen() {
lcd.print('/'); lcd.print('/');
lcd.print(itostr3left(tTarget)); lcd.print(itostr3left(tTarget));
#if HOTENDS > 1 || TEMP_SENSOR_BED != 0 #if (EXTRUDERS > 1 && !defined(SINGLENOZZLE)) || TEMP_SENSOR_BED != 0
//If we have an 2nd extruder or heated bed, show that in the top right corner //If we have an 2nd extruder or heated bed, show that in the top right corner
lcd.setCursor(8, 0); lcd.setCursor(8, 0);
#if HOTENDS > 1 #if EXTRUDERS > 1 && !defined(SINGLENOZZLE)
tHotend = int(degHotend(1) + 0.5); tHotend = int(degHotend(1) + 0.5);
tTarget = int(degTargetHotend(1) + 0.5); tTarget = int(degTargetHotend(1) + 0.5);
lcd.print(LCD_STR_THERMOMETER[0]); lcd.print(LCD_STR_THERMOMETER[0]);
...@@ -483,7 +483,7 @@ static void lcd_implementation_status_screen() { ...@@ -483,7 +483,7 @@ static void lcd_implementation_status_screen() {
lcd.print(itostr3(tHotend)); lcd.print(itostr3(tHotend));
lcd.print('/'); lcd.print('/');
lcd.print(itostr3left(tTarget)); lcd.print(itostr3left(tTarget));
#endif //HOTENDS > 1 || TEMP_SENSOR_BED != 0 #endif //(EXTRUDERS > 1 && !defined(SINGLENOZZLE)) || TEMP_SENSOR_BED != 0
#else//LCD_WIDTH > 19 #else//LCD_WIDTH > 19
lcd.setCursor(0, 0); lcd.setCursor(0, 0);
...@@ -494,10 +494,10 @@ static void lcd_implementation_status_screen() { ...@@ -494,10 +494,10 @@ static void lcd_implementation_status_screen() {
lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
if (tTarget < 10) lcd.print(' '); if (tTarget < 10) lcd.print(' ');
#if HOTENDS > 1 || TEMP_SENSOR_BED != 0 #if (EXTRUDERS > 1 && !defined(SINGLENOZZLE)) || TEMP_SENSOR_BED != 0
//If we have an 2nd extruder or heated bed, show that in the top right corner //If we have an 2nd extruder or heated bed, show that in the top right corner
lcd.setCursor(10, 0); lcd.setCursor(10, 0);
#if HOTENDS > 1 #if EXTRUDERS > 1 && !defined(SINGLENOZZLE)
tHotend = int(degHotend(1) + 0.5); tHotend = int(degHotend(1) + 0.5);
tTarget = int(degTargetHotend(1) + 0.5); tTarget = int(degTargetHotend(1) + 0.5);
lcd.print(LCD_STR_THERMOMETER[0]); lcd.print(LCD_STR_THERMOMETER[0]);
...@@ -511,84 +511,83 @@ static void lcd_implementation_status_screen() { ...@@ -511,84 +511,83 @@ static void lcd_implementation_status_screen() {
lcd.print(itostr3left(tTarget)); lcd.print(itostr3left(tTarget));
lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
if (tTarget < 10) lcd.print(' '); if (tTarget < 10) lcd.print(' ');
#endif//HOTENDS > 1 || TEMP_SENSOR_BED != 0 #endif//(EXTRUDERS > 1 && !defined(SINGLENOZZLE)) || TEMP_SENSOR_BED != 0
#endif//LCD_WIDTH > 19 #endif//LCD_WIDTH > 19
#if LCD_HEIGHT > 2 #if LCD_HEIGHT > 2
//Lines 2 for 4 line LCD //Lines 2 for 4 line LCD
#if LCD_WIDTH < 20 # if LCD_WIDTH < 20
#ifdef SDSUPPORT # ifdef SDSUPPORT
lcd.setCursor(0, 2); lcd.setCursor(0, 2);
lcd_printPGM(PSTR("SD")); lcd_printPGM(PSTR("SD"));
if (IS_SD_PRINTING) if (IS_SD_PRINTING)
lcd.print(itostr3(card.percentDone())); lcd.print(itostr3(card.percentDone()));
else else
lcd_printPGM(PSTR("---")); lcd_printPGM(PSTR("---"));
lcd.print('%'); lcd.print('%');
#endif//SDSUPPORT # endif//SDSUPPORT
#else //LCD_WIDTH > 19 # else//LCD_WIDTH > 19
#if HOTENDS > 1 && TEMP_SENSOR_BED != 0 # if EXTRUDERS > 1 && TEMP_SENSOR_BED != 0 && !defined(SINGLENOZZLE)
//If we both have a 2nd extruder and a heated bed, show the heated bed temp on the 2nd line on the left, as the first line is filled with extruder temps //If we both have a 2nd extruder and a heated bed, show the heated bed temp on the 2nd line on the left, as the first line is filled with extruder temps
tHotend=int(degBed() + 0.5); tHotend=int(degBed() + 0.5);
tTarget=int(degTargetBed() + 0.5); tTarget=int(degTargetBed() + 0.5);
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
lcd.print(LCD_STR_BEDTEMP[0]); lcd.print(LCD_STR_BEDTEMP[0]);
lcd.print(itostr3(tHotend)); lcd.print(itostr3(tHotend));
lcd.print('/'); lcd.print('/');
lcd.print(itostr3left(tTarget)); lcd.print(itostr3left(tTarget));
lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
if (tTarget < 10) lcd.print(' '); if (tTarget < 10)
#else lcd.print(' ');
lcd.setCursor(0,1); # else
#ifdef DELTA lcd.setCursor(0,1);
lcd.print('X'); # ifdef DELTA
lcd.print(ftostr30(current_position[X_AXIS])); lcd.print('X');
lcd_printPGM(PSTR(" Y")); lcd.print(ftostr30(current_position[X_AXIS]));
lcd.print(ftostr30(current_position[Y_AXIS])); lcd_printPGM(PSTR(" Y"));
#else lcd.print(ftostr30(current_position[Y_AXIS]));
lcd.print('X'); # else
lcd.print(ftostr3(current_position[X_AXIS])); lcd.print('X');
lcd_printPGM(PSTR(" Y")); lcd.print(ftostr3(current_position[X_AXIS]));
lcd.print(ftostr3(current_position[Y_AXIS])); lcd_printPGM(PSTR(" Y"));
#endif // DELTA lcd.print(ftostr3(current_position[Y_AXIS]));
#endif //HOTENDS > 1 || TEMP_SENSOR_BED != 0 # endif // DELTA
#endif //LCD_WIDTH > 19 # endif//EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
lcd.setCursor(LCD_WIDTH - 8, 1); # endif//LCD_WIDTH > 19
lcd.print('Z'); lcd.setCursor(LCD_WIDTH - 8, 1);
lcd.print(ftostr32sp(current_position[Z_AXIS] + 0.00001)); lcd.print('Z');
#endif //LCD_HEIGHT > 2 lcd.print(ftostr32sp(current_position[Z_AXIS] + 0.00001));
#endif//LCD_HEIGHT > 2
#if LCD_HEIGHT > 3
#if LCD_HEIGHT > 3
lcd.setCursor(0, 2); lcd.setCursor(0, 2);
lcd.print(LCD_STR_FEEDRATE[0]); lcd.print(LCD_STR_FEEDRATE[0]);
lcd.print(itostr3(feedmultiply)); lcd.print(itostr3(feedmultiply));
lcd.print('%'); lcd.print('%');
#if LCD_WIDTH > 19 # if LCD_WIDTH > 19
#ifdef SDSUPPORT # ifdef SDSUPPORT
lcd.setCursor(7, 2); lcd.setCursor(7, 2);
lcd_printPGM(PSTR("SD")); lcd_printPGM(PSTR("SD"));
if (IS_SD_PRINTING) if (IS_SD_PRINTING)
lcd.print(itostr3(card.percentDone())); lcd.print(itostr3(card.percentDone()));
else else
lcd_printPGM(PSTR("---")); lcd_printPGM(PSTR("---"));
lcd.print('%'); lcd.print('%');
#endif //SDSUPPORT # endif//SDSUPPORT
#endif //LCD_WIDTH > 19 # endif//LCD_WIDTH > 19
lcd.setCursor(LCD_WIDTH - 6, 2); lcd.setCursor(LCD_WIDTH - 6, 2);
lcd.print(LCD_STR_CLOCK[0]); lcd.print(LCD_STR_CLOCK[0]);
if(starttime != 0) if(starttime != 0)
{ {
uint16_t time = millis()/60000 - starttime/60000; uint16_t time = millis()/60000 - starttime/60000;
lcd.print(itostr2(time/60)); lcd.print(itostr2(time/60));
lcd.print(':'); lcd.print(':');
lcd.print(itostr2(time%60)); lcd.print(itostr2(time%60));
}else{
lcd_printPGM(PSTR("--:--"));
} }
else #endif
{
lcd_printPGM(PSTR("--:--"));
}
#endif
// Status message line at the bottom // Status message line at the bottom
lcd.setCursor(0, LCD_HEIGHT - 1); lcd.setCursor(0, LCD_HEIGHT - 1);
...@@ -789,7 +788,7 @@ static void lcd_implementation_update_indicators() ...@@ -789,7 +788,7 @@ static void lcd_implementation_update_indicators()
if (target_temperature_bed > 0) leds |= LED_A; if (target_temperature_bed > 0) leds |= LED_A;
if (target_temperature[0] > 0) leds |= LED_B; if (target_temperature[0] > 0) leds |= LED_B;
if (fanSpeed) leds |= LED_C; if (fanSpeed) leds |= LED_C;
#if HOTENDS > 1 #if EXTRUDERS > 1 && !defined(SINGLENOZZLE)
if (target_temperature[1] > 0) leds |= LED_C; if (target_temperature[1] > 0) leds |= LED_C;
#endif #endif
if (leds != ledsprev) { if (leds != ledsprev) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment