Commit 29152ccf authored by MagoKimbra's avatar MagoKimbra

Update 4.1.2

parent 6a9edf74
......@@ -350,14 +350,21 @@
/**
* MAX_STEP_FREQUENCY differs for TOSHIBA
*/
#ifdef CONFIG_STEPPERS_TOSHIBA
#define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers
#define DOUBLE_STEP_FREQUENCY 10000
#elif defined (__SAM3X8E__)
#define MAX_STEP_FREQUENCY 320000
#define DOUBLE_STEP_FREQUENCY 90000 //96kHz is close to maximum for an Arduino Due
#ifdef __SAM3X8E__
#ifdef CONFIG_STEPPERS_TOSHIBA
#define MAX_STEP_FREQUENCY 120000 // Max step frequency for Toshiba Stepper Controllers
#define DOUBLE_STEP_FREQUENCY MAX_STEP_FREQUENCY
#else
#define MAX_STEP_FREQUENCY 480000
#define DOUBLE_STEP_FREQUENCY 120000 //96kHz is close to maximum for an Arduino Due
#endif
#else
#define MAX_STEP_FREQUENCY 40000 // Max step frequency for Arduino mega
#ifdef CONFIG_STEPPERS_TOSHIBA
#define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers
#define DOUBLE_STEP_FREQUENCY MAX_STEP_FREQUENCY
#else
#define MAX_STEP_FREQUENCY 40000 // Max step frequency for Arduino mega
#endif
#endif
// MS1 MS2 Stepper Driver Microstepping mode table
......
This diff is collapsed.
This diff is collapsed.
......@@ -4,11 +4,14 @@
#include "Configuration.h"
void Config_ResetDefault();
void ConfigSD_ResetDefault();
#ifndef DISABLE_M503
void Config_PrintSettings(bool forReplay=false);
void ConfigSD_PrintSettings(bool forReplay=false);
#else
FORCE_INLINE void Config_PrintSettings(bool forReplay=false) {}
FORCE_INLINE void ConfigSD_PrintSettings(bool forReplay=false) {}
#endif
#ifdef EEPROM_SETTINGS
......@@ -19,4 +22,27 @@ void Config_ResetDefault();
FORCE_INLINE void Config_RetrieveSettings() { Config_ResetDefault(); Config_PrintSettings(); }
#endif
#if defined(SDSUPPORT) && defined(SD_SETTINGS)
static const char *cfgSD_KEY[] = { //Keep this in lexicographical order for better search performance(O(Nlog2(N)) insted of O(N*N)) (if you don't keep this sorted, the algorithm for find the key index won't work, keep attention.)
#ifdef POWER_CONSUMPTION
"PWR",
#endif
"TME",
};
enum cfgSD_ENUM { //This need to be in the same order as cfgSD_KEY
#ifdef POWER_CONSUMPTION
SD_CFG_PWR,
#endif
SD_CFG_TME,
SD_CFG_END //Leave this always as the last
};
void ConfigSD_StoreSettings();
void ConfigSD_RetrieveSettings(bool addValue = false);
int ConfigSD_KeyIndex(char *key);
#else
FORCE_INLINE void ConfigSD_RetrieveSettings() { ConfigSD_ResetDefault(); ConfigSD_PrintSettings(); }
#endif
#endif //CONFIGURATIONSTORE_H
......@@ -36,13 +36,14 @@
// Z-Probe variables
// Start and end location values are used to deploy/retract the probe (will move from start to end and back again)
#define PROBING_FEEDRATE 500 // Speed for individual probe Use: G30 A F600
#define Z_PROBE_OFFSET {0,0,-1,0} // X, Y, Z, E distance between hotend nozzle and deployed bed leveling probe.
#define Z_PROBE_DEPLOY_START_LOCATION {0,0,30,0} // X, Y, Z, E start location for z-probe deployment sequence
#define Z_PROBE_DEPLOY_END_LOCATION {0,0,30,0} // X, Y, Z, E end location for z-probe deployment sequence
#define Z_PROBE_RETRACT_START_LOCATION {0,0,30,0}// X, Y, Z, E start location for z-probe retract sequence
#define Z_PROBE_RETRACT_END_LOCATION {0,0,30,0} // X, Y, Z, E end location for z-probe retract sequence
#define AUTOLEVEL_GRID 20 // Distance between autolevel Z probing points, should be less than print surface radius/3.
#define PROBING_FEEDRATE 500 // Speed for individual probe Use: G30 A F600
#define Z_PROBE_OFFSET {0, 0, -1, 0} // X, Y, Z, E distance between hotend nozzle and deployed bed leveling probe.
#define Z_PROBE_DEPLOY_START_LOCATION {0, 0, 30, 0} // X, Y, Z, E start location for z-probe deployment sequence
#define Z_PROBE_DEPLOY_END_LOCATION {0, 0, 30, 0} // X, Y, Z, E end location for z-probe deployment sequence
#define Z_PROBE_RETRACT_START_LOCATION {0, 0, 30, 0} // X, Y, Z, E start location for z-probe retract sequence
#define Z_PROBE_RETRACT_END_LOCATION {0, 0, 30, 0} // X, Y, Z, E end location for z-probe retract sequence
#define Z_RAISE_BETWEEN_PROBINGS 1 // How much the extruder will be raised when travelling from between next probing points
#define AUTOLEVEL_GRID 24 // Distance between autolevel Z probing points, should be less than print surface radius/3.
//===========================================================================
//=============================Mechanical Settings===========================
......
......@@ -46,9 +46,11 @@
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
// extruder idle oozing prevention
//if the extruder motor is idle for more than SECONDS, and the temperature over MINTEMP, some filament is retracted. The filament retracted is re-added before the next extrusion
//or when the target temperature is less than EXTRUDE_MINTEMP and the actual temperature is greater than IDLE_OOZING_MINTEMP and less than IDLE_OOZING_FEEDRATE
//extruder idle oozing prevention
//if the extruder motor is idle for more than SECONDS, and the temperature over MINTEMP,
//some filament is retracted. The filament retracted is re-added before the next extrusion
//or when the target temperature is less than EXTRUDE_MINTEMP and the actual temperature
//is greater than IDLE_OOZING_MINTEMP and less than IDLE_OOZING_FEEDRATE
//#define IDLE_OOZING_PREVENT
#define IDLE_OOZING_MINTEMP EXTRUDE_MINTEMP + 5
#define IDLE_OOZING_MAXTEMP IDLE_OOZING_MINTEMP + 5
......
......@@ -45,78 +45,7 @@ typedef unsigned long millis_t;
#define analogInputToDigitalPin(p) ((p) + 0xA0)
#endif
#ifdef AT90USB
#include "HardwareSerial.h"
#endif
#ifndef __SAM3X8E__
#include "MarlinSerial.h"
#endif
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
#ifndef sbi
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
#endif
#include "WString.h"
#ifdef AT90USB
#ifdef BTENABLED
#define MYSERIAL bt
#else
#define MYSERIAL Serial
#endif // BTENABLED
#else
#ifdef __SAM3X8E__
#define MYSERIAL Serial
#else
#define MYSERIAL MSerial
#endif
#endif
#define SERIAL_CHAR(x) MYSERIAL.write(x)
#define SERIAL_EOL SERIAL_CHAR('\n')
#define SERIAL_PROTOCOLCHAR(x) SERIAL_CHAR(x)
#define SERIAL_PROTOCOL(x) MYSERIAL.print(x)
#define SERIAL_PROTOCOL_F(x,y) MYSERIAL.print(x,y)
#define SERIAL_PROTOCOLPGM(x) serialprintPGM(PSTR(x))
#define SERIAL_PROTOCOLLN(x) do{ MYSERIAL.print(x),MYSERIAL.write('\n'); }while(0)
#define SERIAL_PROTOCOLLNPGM(x) do{ serialprintPGM(PSTR(x)),MYSERIAL.write('\n'); }while(0)
extern const char errormagic[] PROGMEM;
extern const char echomagic[] PROGMEM;
#define SERIAL_ERROR_START serialprintPGM(errormagic)
#define SERIAL_ERROR(x) SERIAL_PROTOCOL(x)
#define SERIAL_ERRORPGM(x) SERIAL_PROTOCOLPGM(x)
#define SERIAL_ERRORLN(x) SERIAL_PROTOCOLLN(x)
#define SERIAL_ERRORLNPGM(x) SERIAL_PROTOCOLLNPGM(x)
#define SERIAL_ECHO_START serialprintPGM(echomagic)
#define SERIAL_ECHO(x) SERIAL_PROTOCOL(x)
#define SERIAL_ECHOPGM(x) SERIAL_PROTOCOLPGM(x)
#define SERIAL_ECHOLN(x) SERIAL_PROTOCOLLN(x)
#define SERIAL_ECHOLNPGM(x) SERIAL_PROTOCOLLNPGM(x)
#define SERIAL_ECHOPAIR(name,value) do{ serial_echopair_P(PSTR(name),(value)); }while(0)
void serial_echopair_P(const char *s_P, float v);
void serial_echopair_P(const char *s_P, double v);
void serial_echopair_P(const char *s_P, unsigned long v);
// Things to write to serial from Program memory. Saves 400 to 2k of RAM.
FORCE_INLINE void serialprintPGM(const char *str) {
char ch;
while ((ch = pgm_read_byte(str))) {
MYSERIAL.write(ch);
str++;
}
}
#include "Comunication.h"
void get_command();
void process_commands();
......@@ -311,6 +240,8 @@ extern bool axis_known_position[3];
extern float lastpos[4];
extern float zprobe_zoffset;
extern unsigned long printer_usage_seconds; //this can old about 136 year before go overflow. If you belive that you can live more than this please contact me.
#ifdef PREVENT_DANGEROUS_EXTRUDE
extern float extrude_min_temp;
#endif
......@@ -362,6 +293,11 @@ extern int fanSpeed;
extern int laser_ttl_modulation;
#endif
#if defined(SDSUPPORT) && defined(SD_SETTINGS)
extern millis_t config_last_update;
extern bool config_readed;
#endif
extern millis_t print_job_start_ms;
extern millis_t print_job_stop_ms;
......
This diff is collapsed.
This diff is collapsed.
......@@ -18,17 +18,19 @@ public:
//this is to delay autostart and hence the initialisaiton of the sd card to some seconds after the normal init, so the device is available quick after a reset
void checkautostart(bool x);
void openFile(char* name,bool read,bool replace_current=true);
void openFile(char* name, bool read, bool replace_current = true, bool lcd_status = true);
void openLogFile(char* name);
void removeFile(char* name);
void closefile(bool store_location=false);
void closeFile(bool store_location = false);
void parseKeyLine(char *key, char *value, int &len_k, int &len_v);
void unparseKeyLine(const char *key, char *value);
void release();
void startFileprint();
void pauseSDPrint();
void getStatus();
void printingHasFinished();
void getfilename(uint16_t nr, const char* const match=NULL);
void getfilename(uint16_t nr, const char* const match = NULL);
uint16_t getnrfilenames();
void getAbsFilename(char *t);
......
......@@ -186,13 +186,13 @@ static void lcd_implementation_init() {
// digitalWrite(17, HIGH);
#ifdef LCD_SCREEN_ROT_90
u8g.setRot90(); // Rotate screen by 90
u8g.setRot90(); // Rotate screen by 90°
#elif defined(LCD_SCREEN_ROT_180)
u8g.setRot180(); // Rotate screen by 180
u8g.setRot180(); // Rotate screen by 180°
#elif defined(LCD_SCREEN_ROT_270)
u8g.setRot270(); // Rotate screen by 270
u8g.setRot270(); // Rotate screen by 270°
#endif
// Show splashscreen
int offx = (u8g.getWidth() - START_BMPWIDTH) / 2;
#ifdef START_BMPHIGH
......
This diff is collapsed.
......@@ -81,7 +81,7 @@
// Serial Console Messages (do not translate those!)
#define MSG_Enqueueing "enqueueing \""
#define MSG_ENQUEUEING "enqueueing \""
#define MSG_POWERUP "PowerUp"
#define MSG_EXTERNAL_RESET " External Reset"
#define MSG_BROWNOUT_RESET " Brown out Reset"
......@@ -116,9 +116,10 @@
#define MSG_COUNT_X " Count X: "
#define MSG_ERR_KILLED "Printer halted. kill() called!"
#define MSG_ERR_STOPPED "Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)"
#define MSG_RESEND "Resend: "
#define MSG_UNKNOWN_COMMAND "Unknown command: \""
#define MSG_ACTIVE_DRIVER "Active Driver: "
#define MSG_ACTIVE_EXTRUDER "Active Extruder: "
#define MSG_ACTIVE_COLOR "Active Color: "
#define MSG_INVALID_EXTRUDER "Invalid extruder"
#define MSG_INVALID_SOLENOID "Invalid solenoid"
#define MSG_X_MIN "x_min: "
......@@ -152,6 +153,10 @@
#define MSG_SD_NOT_PRINTING "Not SD printing"
#define MSG_SD_ERR_WRITE_TO_FILE "error writing to file"
#define MSG_SD_CANT_ENTER_SUBDIR "Cannot enter subdir: "
#define MSG_SD_FILE_DELETED "File deleted:"
#define MSG_SD_SLASH "/"
#define MSG_SD_FILE_DELETION_ERR "Deletion failed, File: "
#define MSG_SD_MAX_DEPTH "trying to call sub-gcode files with too many levels. MAX level is:"
#define MSG_STEPPER_TOO_HIGH "Steprate too high: "
#define MSG_ENDSTOPS_HIT "endstops hit: "
......@@ -161,6 +166,17 @@
#define MSG_BABYSTEPPING_Y "Babystepping Y"
#define MSG_BABYSTEPPING_Z "Babystepping Z"
#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Error in menu structure"
#define MSG_MICROSTEP_MS1_MS2 "MS1,MS2 Pins"
#define MSG_MICROSTEP_X "X:"
#define MSG_MICROSTEP_Y "Y:"
#define MSG_MICROSTEP_Z "Z:"
#define MSG_MICROSTEP_E0 "E0:"
#define MSG_MICROSTEP_E1 "E1:"
#define MSG_ENDSTOP_X " X:"
#define MSG_ENDSTOP_Y " Y:"
#define MSG_ENDSTOP_Z " Z:"
#define MSG_ENDSTOP_E " E:"
#define MSG_ENDSTOP_ZP " ZP:"
#define MSG_ERR_EEPROM_WRITE "Error writing to EEPROM!"
......@@ -181,26 +197,43 @@
#define MSG_KP " Kp: "
#define MSG_KI " Ki: "
#define MSG_KD " Kd: "
#define MSG_OK_B "ok B:"
#define MSG_OK_T "ok T:"
#define MSG_B " B:"
#define MSG_T " T:"
#define MSG_AT " @:"
#define MSG_PID_AUTOTUNE_FINISHED MSG_PID_AUTOTUNE " finished! Put the last Kp, Ki and Kd constants from above into Configuration.h or send command M500 for save in EEPROM the new value!"
#define MSG_PID_DEBUG " PID_DEBUG "
#define MSG_PID_DEBUG_INPUT ": Input "
#define MSG_PID_DEBUG_OUTPUT " Output "
#define MSG_PID_DEBUG_PTERM " pTerm "
#define MSG_PID_DEBUG_ITERM " iTerm "
#define MSG_PID_DEBUG_DTERM " dTerm "
#define MSG_HEATING_FAILED "Heating failed"
#define MSG_THERMAL_RUNAWAY_STOP "Thermal Runaway, system stopped! Heater_ID: "
#define MSG_THERMAL_RUNAWAY_BED "bed"
#define MSG_TEMP_READ_ERROR "Temp measurement error!"
#define MSG_TEMP_BED "bed"
#define MSG_EXTRUDER_SWITCHED_OFF "Extruder switched off. Temperature difference between temp sensors is too high !"
#define MSG_INVALID_EXTRUDER_NUM " - Invalid extruder number !"
#define MSG_THERMAL_RUNAWAY_STOP "Thermal Runaway, system stopped! Heater_ID: "
#define MSG_SWITCHED_OFF_MAX " switched off. MAXTEMP triggered !!"
#define MSG_MINTEMP_EXTRUDER_OFF ": Extruder switched off. MINTEMP triggered !"
#define MSG_MAXTEMP_EXTRUDER_OFF ": Extruder" MSG_SWITCHED_OFF_MAX
#define MSG_MAXTEMP_BED_OFF "Heated bed" MSG_SWITCHED_OFF_MAX
#define MSG_ENDSTOP_XS "X"
#define MSG_ENDSTOP_YS "Y"
#define MSG_ENDSTOP_ZS "Z"
#define MSG_ENDSTOP_ZPS "ZP"
#define MSG_ENDSTOP_ES "E"
//watchdog.cpp
#define MSG_WATCHDOG_RESET "Something is wrong, please turn off the printer."
//other
#define MSG_COMPILED "Compiled: "
#define MSG_ERR_HOMING_DIV "The Homing Bump Feedrate Divisor cannot be less than 1"
#define MSG_BED_LEVELLING_BED "Bed"
#define MSG_BED_LEVELLING_X " X: "
#define MSG_BED_LEVELLING_Y " Y: "
#define MSG_BED_LEVELLING_Z " Z: "
#define MSG_DRYRUN_ENABLED "DEBUG DRYRUN ENABLED"
// LCD Menu Messages
#if !(defined( DISPLAY_CHARSET_HD44780_JAPAN ) || defined( DISPLAY_CHARSET_HD44780_WESTERN ) || defined( DISPLAY_CHARSET_HD44780_CYRILLIC ))
......
......@@ -151,6 +151,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration"
#define MSG_E_BOWDEN_LENGTH "Extrude " STRINGIFY(BOWDEN_LENGTH) "mm"
......
......@@ -152,6 +152,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate"
......
......@@ -150,6 +150,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate"
......
......@@ -160,6 +160,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration"
#define MSG_E_BOWDEN_LENGTH "Extrude " STRINGIFY(BOWDEN_LENGTH) "mm"
......
......@@ -150,6 +150,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate"
......
......@@ -150,6 +150,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate"
......
......@@ -150,6 +150,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Kalibroi Center"
#endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate"
......
......@@ -151,6 +151,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate"
......
......@@ -160,6 +160,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibra Centro"
#endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configurazione"
#define MSG_E_BOWDEN_LENGTH "Extrude " STRINGIFY(BOWDEN_LENGTH) "mm"
......
......@@ -150,6 +150,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate"
......
......@@ -150,6 +150,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate"
......
......@@ -160,6 +160,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration"
#define MSG_E_BOWDEN_LENGTH "Extrude " STRINGIFY(BOWDEN_LENGTH) "mm"
......
......@@ -150,6 +150,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate"
......
......@@ -150,6 +150,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate"
......
......@@ -518,8 +518,8 @@ float junction_deviation = 0.1;
if (degHotend(extruder) < extrude_min_temp && !debugDryrun()) {
position[E_AXIS] = target[E_AXIS]; //behave as if the move really took place, but ignore E part
de = 0; // no difference
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
ECHO_S(OK);
ECHO_EM(MSG_ERR_COLD_EXTRUDE_STOP);
}
}
......@@ -530,8 +530,8 @@ float junction_deviation = 0.1;
#endif
position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
de = 0; // no difference
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP);
ECHO_S(OK);
ECHO_EM(MSG_ERR_LONG_EXTRUDE_STOP);
#ifdef EASY_LOAD
}
allow_lengthy_extrude_once = false;
......@@ -887,7 +887,7 @@ float junction_deviation = 0.1;
block->acceleration = acc_st / steps_per_mm;
#ifdef __SAM3X8E__
block->acceleration_rate = (long)(acc_st * ( 16777216.0 / HAL_TIMER_RATE));
block->acceleration_rate = (long)(acc_st * ( 4294967296.0 / (float)HAL_TIMER_RATE));
#else
block->acceleration_rate = (long)(acc_st * 16777216.0 / (F_CPU / 8.0));
#endif
......@@ -993,12 +993,12 @@ float junction_deviation = 0.1;
block->advance_rate = acc_dist ? advance / (float)acc_dist : 0;
}
/*
SERIAL_ECHO_START;
SERIAL_ECHOPGM("advance :");
SERIAL_ECHO(block->advance/256.0);
SERIAL_ECHOPGM("advance rate :");
SERIAL_ECHOLN(block->advance_rate/256.0);
*/
ECHO_S(OK);
ECHO_M("advance :");
ECHO_V(block->advance/256.0);
ECHO_M("advance rate :");
ECHO_EV(block->advance_rate/256.0);
*/
#endif // ADVANCE
calculate_trapezoid_for_block(block, block->entry_speed / block->nominal_speed, safe_speed / block->nominal_speed);
......
......@@ -276,39 +276,37 @@ void endstops_hit_on_purpose() {
void checkHitEndstops() {
if (endstop_x_hit || endstop_y_hit || endstop_z_hit || endstop_z_probe_hit || endstop_e_hit) {
SERIAL_ECHO_START;
SERIAL_ECHOPGM(MSG_ENDSTOPS_HIT);
ECHO_SM(OK, MSG_ENDSTOPS_HIT);
if(endstop_x_hit) {
SERIAL_ECHOPAIR(" X:", (float)endstops_trigsteps[X_AXIS] / axis_steps_per_unit[X_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "X");
ECHO_MV(MSG_ENDSTOP_X, (float)endstops_trigsteps[X_AXIS] / axis_steps_per_unit[X_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT MSG_ENDSTOP_XS);
}
if(endstop_y_hit) {
SERIAL_ECHOPAIR(" Y:", (float)endstops_trigsteps[Y_AXIS] / axis_steps_per_unit[Y_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Y");
ECHO_MV(MSG_ENDSTOP_Y, (float)endstops_trigsteps[Y_AXIS] / axis_steps_per_unit[Y_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT MSG_ENDSTOP_YS);
}
if(endstop_z_hit) {
SERIAL_ECHOPAIR(" Z:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Z");
ECHO_MV(MSG_ENDSTOP_Z, (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT MSG_ENDSTOP_ZS);
}
#ifdef Z_PROBE_ENDSTOP
if (endstop_z_probe_hit) {
SERIAL_ECHOPAIR(" Z_PROBE:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "ZP");
ECHO_MV(" Z_PROBE:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT MSG_ENDSTOP_ZPS);
}
#endif
if(endstop_e_hit) {
SERIAL_ECHOPAIR(" E:", (float)endstops_trigsteps[E_AXIS] / axis_steps_per_unit[E_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "E");
ECHO_MV(MSG_ENDSTOP_E, (float)endstops_trigsteps[E_AXIS] / axis_steps_per_unit[E_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT MSG_ENDSTOP_ES);
}
SERIAL_ECHOLN("");
ECHO_E;
endstops_hit_on_purpose();
#if defined(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) && defined(SDSUPPORT)
if (abort_on_endstop_hit) {
card.sdprinting = false;
card.closefile();
card.closeFile();
quickStop();
setTargetHotend0(0);
setTargetHotend1(0);
......@@ -327,34 +325,33 @@ void endstops_hit_on_purpose() {
void checkHitEndstops() {
if (endstop_x_hit || endstop_y_hit || endstop_z_hit || endstop_z_probe_hit) {
SERIAL_ECHO_START;
SERIAL_ECHOPGM(MSG_ENDSTOPS_HIT);
ECHO_SM(OK, MSG_ENDSTOPS_HIT);
if (endstop_x_hit) {
SERIAL_ECHOPAIR(" X:", (float)endstops_trigsteps[X_AXIS] / axis_steps_per_unit[X_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "X");
ECHO_MV(MSG_ENDSTOP_X, (float)endstops_trigsteps[X_AXIS] / axis_steps_per_unit[X_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT MSG_ENDSTOP_XS);
}
if (endstop_y_hit) {
SERIAL_ECHOPAIR(" Y:", (float)endstops_trigsteps[Y_AXIS] / axis_steps_per_unit[Y_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Y");
ECHO_MV(MSG_ENDSTOP_Y, (float)endstops_trigsteps[Y_AXIS] / axis_steps_per_unit[Y_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT MSG_ENDSTOP_YS);
}
if (endstop_z_hit) {
SERIAL_ECHOPAIR(" Z:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Z");
ECHO_MV(MSG_ENDSTOP_Z, (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT MSG_ENDSTOP_ZS);
}
#ifdef Z_PROBE_ENDSTOP
if (endstop_z_probe_hit) {
SERIAL_ECHOPAIR(" Z_PROBE:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "ZP");
ECHO_MV(MSG_ENDSTOP_ZPS, (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT MSG_ENDSTOP_ZPS);
}
#endif
SERIAL_EOL;
ECHO_E;
endstops_hit_on_purpose();
#if defined(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) && defined(SDSUPPORT)
if (abort_on_endstop_hit) {
card.sdprinting = false;
card.closefile();
card.closeFile();
quickStop();
setTargetHotend0(0);
setTargetHotend1(0);
......@@ -443,16 +440,6 @@ FORCE_INLINE void trapezoid_generator_reset() {
acc_step_rate = current_block->initial_rate;
acceleration_time = calc_timer(acc_step_rate);
OCR1A = acceleration_time;
// SERIAL_ECHO_START;
// SERIAL_ECHOPGM("advance :");
// SERIAL_ECHO(current_block->advance/256.0);
// SERIAL_ECHOPGM("advance rate :");
// SERIAL_ECHO(current_block->advance_rate/256.0);
// SERIAL_ECHOPGM("initial advance :");
// SERIAL_ECHO(current_block->initial_advance/256.0);
// SERIAL_ECHOPGM("final advance :");
// SERIAL_ECHOLN(current_block->final_advance/256.0);
}
// "The Stepper Driver Interrupt" - This timer interrupt is the workhorse.
......@@ -633,8 +620,6 @@ ISR(TIMER1_COMPA_vect) {
{
endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
endstop_z_probe_hit = true;
// if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true");
}
old_z_probe_endstop = z_probe_endstop;
#endif
......@@ -668,9 +653,6 @@ ISR(TIMER1_COMPA_vect) {
endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
endstop_z_hit = true;
// if (z_max_both) SERIAL_ECHOLN("z_max_endstop = true");
// if (z2_max_both) SERIAL_ECHOLN("z2_max_endstop = true");
if (!performing_homing || (performing_homing && z_max_both && z2_max_both)) //if not performing home or if both endstops were trigged during homing...
step_events_completed = current_block->step_event_count;
}
......@@ -1419,23 +1401,23 @@ void microstep_mode(uint8_t driver, uint8_t stepping_mode) {
}
void microstep_readings() {
SERIAL_PROTOCOLPGM("MS1,MS2 Pins\n");
SERIAL_PROTOCOLPGM("X: ");
SERIAL_PROTOCOL(digitalRead(X_MS1_PIN));
SERIAL_PROTOCOLLN(digitalRead(X_MS2_PIN));
SERIAL_PROTOCOLPGM("Y: ");
SERIAL_PROTOCOL(digitalRead(Y_MS1_PIN));
SERIAL_PROTOCOLLN(digitalRead(Y_MS2_PIN));
SERIAL_PROTOCOLPGM("Z: ");
SERIAL_PROTOCOL(digitalRead(Z_MS1_PIN));
SERIAL_PROTOCOLLN(digitalRead(Z_MS2_PIN));
SERIAL_PROTOCOLPGM("E0: ");
SERIAL_PROTOCOL(digitalRead(E0_MS1_PIN));
SERIAL_PROTOCOLLN(digitalRead(E0_MS2_PIN));
ECHO_SM(OK, MSG_MICROSTEP_MS1_MS2);
ECHO_M(MSG_MICROSTEP_X);
ECHO_V(digitalRead(X_MS1_PIN));
ECHO_EV(digitalRead(X_MS2_PIN));
ECHO_SM(OK, MSG_MICROSTEP_Y);
ECHO_V(digitalRead(Y_MS1_PIN));
ECHO_EV(digitalRead(Y_MS2_PIN));
ECHO_SM(OK, MSG_MICROSTEP_Z);
ECHO_V(digitalRead(Z_MS1_PIN));
ECHO_EV(digitalRead(Z_MS2_PIN));
ECHO_SM(OK, MSG_MICROSTEP_E0);
ECHO_V(digitalRead(E0_MS1_PIN));
ECHO_EV(digitalRead(E0_MS2_PIN));
#if HAS_MICROSTEPS_E1
SERIAL_PROTOCOLPGM("E1: ");
SERIAL_PROTOCOL(digitalRead(E1_MS1_PIN));
SERIAL_PROTOCOLLN(digitalRead(E1_MS2_PIN));
ECHO_SM(OK, MSG_MICROSTEP_E1);
ECHO_V(digitalRead(E1_MS1_PIN));
ECHO_EV(digitalRead(E1_MS2_PIN));
#endif
}
......
This diff is collapsed.
......@@ -311,12 +311,12 @@ static void lcd_status_screen() {
#if HAS_LCD_FILAMENT_SENSOR || HAS_LCD_POWER_SENSOR
#if HAS_LCD_FILAMENT_SENSOR && HAS_LCD_POWER_SENSOR
if (millis() > message_millis + 15000)
if (millis() > previous_lcd_status_ms + 15000)
#else
if (millis() > message_millis + 10000)
if (millis() > previous_lcd_status_ms + 10000)
#endif
{
message_millis = millis();
previous_lcd_status_ms = millis();
}
#endif
......@@ -389,7 +389,7 @@ static void lcd_sdcard_resume() { card.startFileprint(); }
static void lcd_sdcard_stop() {
quickStop();
card.sdprinting = false;
card.closefile();
card.closeFile();
autotempShutdown();
cancel_heatup = true;
lcd_setstatus(MSG_PRINT_ABORTED, true);
......@@ -675,7 +675,7 @@ void config_lcd_level_bed()
{
setTargetHotend(0,0);
SERIAL_ECHOLN("Leveling...");
ECHO_EM("Leveling...");
currentMenu = lcd_level_bed;
enqueuecommands_P(PSTR("G28 M"));
pageShowInfo = 0;
......@@ -1104,8 +1104,8 @@ static void lcd_control_motion_menu() {
MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &abort_on_endstop_hit);
#endif
#ifdef SCARA
MENU_ITEM_EDIT(float74, MSG_XSCALE, &axis_scaling[X_AXIS],0.5,2);
MENU_ITEM_EDIT(float74, MSG_YSCALE, &axis_scaling[Y_AXIS],0.5,2);
MENU_ITEM_EDIT(float52, MSG_XSCALE, &axis_scaling[X_AXIS],0.5,2);
MENU_ITEM_EDIT(float52, MSG_YSCALE, &axis_scaling[Y_AXIS],0.5,2);
#endif
END_MENU();
}
......@@ -1493,16 +1493,11 @@ void lcd_update() {
else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10;
#ifdef ENCODER_RATE_MULTIPLIER_DEBUG
SERIAL_ECHO_START;
SERIAL_ECHO("Enc Step Rate: ");
SERIAL_ECHO(encoderStepRate);
SERIAL_ECHO(" Multiplier: ");
SERIAL_ECHO(encoderMultiplier);
SERIAL_ECHO(" ENCODER_10X_STEPS_PER_SEC: ");
SERIAL_ECHO(ENCODER_10X_STEPS_PER_SEC);
SERIAL_ECHO(" ENCODER_100X_STEPS_PER_SEC: ");
SERIAL_ECHOLN(ENCODER_100X_STEPS_PER_SEC);
#endif //ENCODER_RATE_MULTIPLIER_DEBUG
ECHO_SMV(DB, "Enc Step Rate: ", encoderStepRate);
ECHO_MV(" Multiplier: ", encoderMultiplier);
ECHO_MV(" ENCODER_10X_STEPS_PER_SEC: ", ENCODER_10X_STEPS_PER_SEC);
ECHO_EMV(" ENCODER_100X_STEPS_PER_SEC: ", ENCODER_100X_STEPS_PER_SEC);
#endif
}
lastEncoderMovementMillis = ms;
......
......@@ -60,14 +60,10 @@ void vector_3::apply_rotation(matrix_3x3 matrix) {
}
void vector_3::debug(const char title[]) {
SERIAL_PROTOCOL(title);
SERIAL_PROTOCOLPGM(" x: ");
SERIAL_PROTOCOL_F(x, 6);
SERIAL_PROTOCOLPGM(" y: ");
SERIAL_PROTOCOL_F(y, 6);
SERIAL_PROTOCOLPGM(" z: ");
SERIAL_PROTOCOL_F(z, 6);
SERIAL_EOL;
ECHO_SV(DB, title);
ECHO_MV(" x: ", x, 6);
ECHO_MV(" y: ", y, 6);
ECHO_EMV(" z: ", z, 6);
}
void apply_rotation_xyz(matrix_3x3 matrix, float &x, float& y, float& z) {
......@@ -121,16 +117,16 @@ matrix_3x3 matrix_3x3::transpose(matrix_3x3 original) {
}
void matrix_3x3::debug(const char title[]) {
SERIAL_PROTOCOLLN(title);
ECHO_SV(DB, title);
int count = 0;
for(int i=0; i<3; i++) {
for(int j=0; j<3; j++) {
if (matrix[count] >= 0.0) SERIAL_PROTOCOLCHAR('+');
SERIAL_PROTOCOL_F(matrix[count], 6);
SERIAL_PROTOCOLCHAR(' ');
if (matrix[count] >= 0.0) ECHO_C('+');
ECHO_V(matrix[count], 6);
ECHO_C(' ');
count++;
}
SERIAL_EOL;
ECHO_E;
}
}
......
......@@ -43,11 +43,10 @@ void watchdog_reset()
#ifdef WATCHDOG_RESET_MANUAL
ISR(WDT_vect)
{
ECHO_LM(MSG_WATCHDOG_RESET);
//TODO: This message gets overwritten by the kill() call
LCD_ALERTMESSAGEPGM("ERR:Please Reset");//16 characters so it fits on a 16x2 display
lcd_update();
SERIAL_ERROR_START;
SERIAL_ERRORLNPGM("Something is wrong, please turn off the printer.");
kill(); //kill blocks
while(1); //wait for user or serial reset
}
......
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