Commit 82f65e4f authored by MagoKimbra's avatar MagoKimbra

Same fix

parent 5729de2f
......@@ -5873,7 +5873,7 @@ inline void gcode_T(uint8_t tmp_extruder) {
long csteps;
if (tmp_extruder >= EXTRUDERS) {
ECHO_SMV(DB, "T", tmp_extruder);
ECHO_EM(MSG_INVALID_EXTRUDER);
ECHO_EM(" " MSG_INVALID_EXTRUDER);
}
else {
target_extruder = tmp_extruder;
......@@ -6996,9 +6996,20 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
if (max_inactive_time && ms > previous_cmd_ms + max_inactive_time) kill(PSTR(MSG_KILLED));
if (stepper_inactive_time && ms > previous_cmd_ms + stepper_inactive_time
&& !ignore_stepper_queue && !blocks_queued())
disable_all_steppers();
if (stepper_inactive_time && ms > previous_cmd_ms + stepper_inactive_time && !ignore_stepper_queue && !blocks_queued()) {
#if DISABLE_X == true
disable_x();
#endif
#if DISABLE_Y == true
disable_y();
#endif
#if DISABLE_Z == true
disable_z();
#endif
#if DISABLE_E == true
disable_e();
#endif
}
#ifdef CHDK // Check if pin should be set to LOW after M240 set it to HIGH
if (chdkActive && ms > chdkHigh + CHDK_DELAY) {
......
......@@ -353,11 +353,11 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/,
if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) {
ECHO_MV(MSG_SD_OPEN_FILE_FAIL, fname);
ECHO_PGM(".\n");
if(lcd_status) lcd_setstatus(fname);
}
else {
saving = true;
ECHO_EMV(MSG_SD_WRITE_TO_FILE, name);
if(lcd_status) lcd_setstatus(fname);
}
}
}
......
......@@ -824,7 +824,7 @@ void Config_ResetDefault() {
}
char time[30];
int day = printer_usage_seconds / 60 / 60 / 24, hours = (printer_usage_seconds / 60 / 60) % 24, minutes = (printer_usage_seconds / 60) % 60;
sprintf_P(time, PSTR("%i " MSG_END_DAY " %i " MSG_END_HOUR " %i " MSG_END_MINUTE), day, hours, minutes);
sprintf_P(time, PSTR(" %i " MSG_END_DAY " %i " MSG_END_HOUR " %i " MSG_END_MINUTE), day, hours, minutes);
ECHO_LV(DB, time);
}
......
......@@ -104,7 +104,7 @@
#define MSG_FILE_PRINTED "Done printing file"
#define MSG_BEGIN_FILE_LIST "Begin file list"
#define MSG_END_FILE_LIST "End file list"
#define MSG_INVALID_EXTRUDER " Invalid extruder "
#define MSG_INVALID_EXTRUDER "Invalid extruder"
#define MSG_INVALID_SOLENOID "Invalid solenoid"
#define MSG_ERR_NO_THERMISTORS "No thermistors - no temperature"
#define MSG_HEATING "Heating..."
......
......@@ -76,6 +76,7 @@ unsigned char soft_pwm_bed;
#if defined(THERMAL_PROTECTION_HOTENDS) || defined(THERMAL_PROTECTION_BED)
enum TRState { TRReset, TRInactive, TRFirstHeating, TRStable, TRRunaway };
static float tr_target_temperature[HOTENDS + 1] = { 0.0 };
void thermal_runaway_protection(TRState *state, millis_t *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc);
#ifdef THERMAL_PROTECTION_HOTENDS
static TRState thermal_runaway_state_machine[4] = { TRReset, TRReset, TRReset, TRReset };
......@@ -312,12 +313,14 @@ void PID_autotune(float temp, int hotend, int ncycles) {
if (hotend < 0) {
p = soft_pwm_bed;
ECHO_SMV(OK, MSG_B, input);
ECHO_MV(" /", temp, 1);
ECHO_EMV(" " MSG_AT, p);
}
else {
p = soft_pwm[hotend];
ECHO_SMV(OK, MSG_T, input, 1);
ECHO_EMV(MSG_AT, p);
ECHO_MV(" /", temp, 1);
ECHO_EMV(" " MSG_AT, p);
}
temp_ms = ms;
......@@ -733,12 +736,7 @@ static float analog2temp(int raw, uint8_t e) {
return celsius;
}
#ifdef __SAM3X8E__
return ((raw * ((3.3 * 100) / 1024) / OVERSAMPLENR) * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET;
#else
return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET;
#endif
}
// Derived from RepRap FiveD extruder::getTemperature()
......@@ -763,12 +761,8 @@ static float analog2tempBed(int raw) {
return celsius;
#elif defined BED_USES_AD595
#ifdef __SAM3X8E__
return ((raw * ((3.3 * 100) / 1024) / OVERSAMPLENR) * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET;
#else
return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET;
#endif
#else //NO BED_USES_THERMISTOR
#else
return 0;
#endif
}
......@@ -916,12 +910,6 @@ void tp_init() {
#endif // HEATER_0_USES_MAX6675
#ifdef __SAM3X8E__
// Use timer0 for temperature measurement
// Interleave temperature interrupt with millies interrupt
HAL_temp_timer_start(TEMP_TIMER_NUM);
HAL_timer_enable_interrupt (TEMP_TIMER_NUM);
#else
#ifdef DIDR2
#define ANALOG_SELECT(pin) do{ if (pin < 8) DIDR0 |= BIT(pin); else DIDR2 |= BIT(pin - 8); }while(0)
#else
......@@ -960,7 +948,6 @@ void tp_init() {
// Interleave temperature interrupt with millies interrupt
OCR0B = 128;
TIMSK0 |= BIT(OCIE0B);
#endif
// Wait for temperature measurement to settle
delay(250);
......@@ -1015,7 +1002,6 @@ void tp_init() {
#endif // HOTENDS > 1
#ifdef BED_MINTEMP
/* No bed MINTEMP error implemented?!? */ /*
while(analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) {
#if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP
bed_minttemp_raw += OVERSAMPLENR;
......@@ -1023,7 +1009,6 @@ void tp_init() {
bed_minttemp_raw -= OVERSAMPLENR;
#endif
}
*/
#endif //BED_MINTEMP
#ifdef BED_MAXTEMP
while(analog2tempBed(bed_maxttemp_raw) > BED_MAXTEMP) {
......@@ -1056,8 +1041,6 @@ void tp_init() {
void thermal_runaway_protection(TRState *state, millis_t *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) {
static float tr_target_temperature[EXTRUDERS+1] = { 0.0 };
/*
ECHO_SM(DB, "Thermal Thermal Runaway Running. Heater ID: ");
if (heater_id < 0) ECHO_M("bed"); else ECHO_V(heater_id);
......@@ -1067,7 +1050,7 @@ void tp_init() {
ECHO_EMV(" ; Target Temp:", target_temperature);
*/
int heater_index = heater_id >= 0 ? heater_id : EXTRUDERS;
int heater_index = heater_id >= 0 ? heater_id : HOTENDS;
// If the target temperature changes, restart
if (tr_target_temperature[heater_index] != target_temperature)
......@@ -1168,8 +1151,8 @@ void disable_all_heaters() {
WRITE(MAX6675_SS, 0);
// ensure 100ns delay - a bit extra is fine
asm("nop");// 50ns on 20Mhz, 62.5ns on 16Mhz
asm("nop");// 50ns on 20Mhz, 62.5ns on 16Mhz
asm("nop");//50ns on 20Mhz, 62.5ns on 16Mhz
asm("nop");//50ns on 20Mhz, 62.5ns on 16Mhz
// read MSB
SPDR = 0;
......
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