Commit 5d4c2d2b authored by MagoKimbra's avatar MagoKimbra

Update

parents 4756724e 93f4bbb8
### Version 4.1.2
* Serial message function standardized for a better code style
* Auto-Create configuration file if not exist
* FIX for sdcard crash problem during configuration file reading
* FIX for some undefined SCARA defines
### Version 4.1.1
* Add Power (Watt) Sensor
* Add Anti OOZING
* Add Power Consumation and Power On Time
* Configurations stored in the SD are updated in real-time (every SD_CFG_SECONDS seconds) also if you remove-insert the sd or you start your printer without the SD card.
* Reduced code size, maybe a lot depending on your configuration.
* Improved support for Delta, SCARA, and COREXY kinematics.
* Move parts of Configuration files to `Conditionals.h` and `SanityCheck.h`.
* Clean up of temperature code.
* Enhanced `G29` with improved grid bed leveling based on Roxy code. See documentation.
* EEPROM layout updated to `V21`.
* Added `M204` travel acceleration options.
* `M204` "`P`" parameter replaces "`S`." "`S`" retained for backward compatibility.
* `M404` "`N`" parameter replaced with "`W`." ("`N`" is for line numbers only).
* Much cleanup of the code.
* Improved support for Cyrillic and accented languages.
* LCD controller knob acceleration.
* Improved compatibility with various sensors, MAX6675 thermocouple.
* Filament runout sensor support.
* Filament width measurement support.
* Support for TMC and L6470 stepper drivers.
* Better support of G-Code `;` comments, `\`, `N` line numbers, and `*` checksums.
* Moved GCode handling code into individual functions per-code.
### Version 4.1.0
* Initial release
/**
* Comunication.h - serial messages functions
* Part of Marlin
*
* Author: Simone Primarosa
*/
#ifndef COMUNICATION_H
#define COMUNICATION_H
#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 START "start" //start for host
#define OK "ok " //ok answer for host
#define ER "Error:" //error for host
#define DB "echo: " //message for user
#define RS "Resend:" //resend for host
#define PAUSE "//action:pause" //command for host that support action
#define RESUME "//action:resume" //command for host that support action
#define DISCONNECT "//action:disconnect" //command for host that support action
#define SERIAL_INIT(baud) MYSERIAL.begin(baud), delay(1)
#define SERIAL_WRITE(x) MYSERIAL.write(x)
#define SERIAL_PRINT(msg, args...) MYSERIAL.print(msg, ##args)
#define SERIAL_ENDL MYSERIAL.println()
FORCE_INLINE void PS_PGM(const char *str) {
char ch;
while ((ch = pgm_read_byte(str++))) { SERIAL_WRITE(ch); }
}
#define ECHO_ENDL SERIAL_ENDL
#define ECHO_PGM(message) PS_PGM(PSTR(message))
#define ECHO_MV(msg, val, args...) ECHO_PGM(msg),ECHO_V(val, ##args)
#define ECHO_VM(val, msg, args...) ECHO_V(val, ##args),ECHO_PGM(msg)
#define ECHO_M(msg) ECHO_PGM(msg)
#define ECHO_V SERIAL_PRINT
#define ECHO_C SERIAL_WRITE
#define ECHO_S(srt) ECHO_PGM(srt)
#define ECHO_E ECHO_ENDL
#define ECHO_SM(srt, msg) ECHO_S(srt),ECHO_M(msg)
#define ECHO_SV(srt, val, args...) ECHO_S(srt),ECHO_V(val, ##args)
#define ECHO_SMV(srt, msg, val, args...) ECHO_S(srt),ECHO_MV(msg, val, ##args)
#define ECHO_SVM(srt, val, msg, args...) ECHO_S(srt),ECHO_VM(val, msg, ##args)
#define ECHO_EM(msg) ECHO_M(msg),ECHO_E
#define ECHO_EV(val, args...) ECHO_V(val, ##args),ECHO_E
#define ECHO_EMV(msg, val, args...) ECHO_MV(msg, val, ##args),ECHO_E
#define ECHO_EVM(val, msg, args...) ECHO_VM(val, msg, ##args),ECHO_E
#define ECHO_LM(srt, msg) ECHO_S(srt),ECHO_M(msg),ECHO_E
#define ECHO_LV(srt, val) ECHO_S(srt),ECHO_V(val),ECHO_E
#define ECHO_LMV(srt, msg, val, args...) ECHO_S(srt),ECHO_MV(msg, val, ##args),ECHO_E
#define ECHO_LVM(srt, val, msg, args...) ECHO_S(srt),ECHO_VM(val, msg, ##args),ECHO_E
#endif
...@@ -348,16 +348,23 @@ ...@@ -348,16 +348,23 @@
#define SERVO_LEVELING_DELAY (SERVO_LEVELING && PROBE_SERVO_DEACTIVATION_DELAY > 0) #define SERVO_LEVELING_DELAY (SERVO_LEVELING && PROBE_SERVO_DEACTIVATION_DELAY > 0)
/** /**
* MAX_STEP_FREQUENCY differs for TOSHIBA * MAX_STEP_FREQUENCY differs for TOSHIBA OR ARDUINO DUE OR ARDUINO MEGA
*/ */
#ifdef CONFIG_STEPPERS_TOSHIBA #ifdef __SAM3X8E__
#define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers #ifdef CONFIG_STEPPERS_TOSHIBA
#define DOUBLE_STEP_FREQUENCY 10000 #define MAX_STEP_FREQUENCY 120000 // Max step frequency for Toshiba Stepper Controllers
#elif defined (__SAM3X8E__) #define DOUBLE_STEP_FREQUENCY MAX_STEP_FREQUENCY
#define MAX_STEP_FREQUENCY 320000 #else
#define DOUBLE_STEP_FREQUENCY 90000 //96kHz is close to maximum for an Arduino Due #define MAX_STEP_FREQUENCY 320000 // Max step frequency for the Due is approx. 330kHz
#define DOUBLE_STEP_FREQUENCY 100000 //96kHz is close to maximum for an Arduino Due
#endif
#else #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 #endif
// MS1 MS2 Stepper Driver Microstepping mode table // MS1 MS2 Stepper Driver Microstepping mode table
...@@ -506,7 +513,7 @@ ...@@ -506,7 +513,7 @@
#define HAS_SERVO_3 (PIN_EXISTS(SERVO3)) #define HAS_SERVO_3 (PIN_EXISTS(SERVO3))
#define HAS_FILAMENT_SENSOR (defined(FILAMENT_SENSOR) && PIN_EXISTS(FILWIDTH)) #define HAS_FILAMENT_SENSOR (defined(FILAMENT_SENSOR) && PIN_EXISTS(FILWIDTH))
#define HAS_POWER_CONSUMPTION_SENSOR (defined(POWER_CONSUMPTION) && PIN_EXISTS(POWER_CONSUMPTION)) #define HAS_POWER_CONSUMPTION_SENSOR (defined(POWER_CONSUMPTION) && PIN_EXISTS(POWER_CONSUMPTION))
#define HAS_FILRUNOUT (PIN_EXISTS(FILRUNOUT)) #define HAS_FILRUNOUT (defined(FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FILRUNOUT))
#define HAS_HOME (PIN_EXISTS(HOME)) #define HAS_HOME (PIN_EXISTS(HOME))
#define HAS_KILL (PIN_EXISTS(KILL)) #define HAS_KILL (PIN_EXISTS(KILL))
#define HAS_SUICIDE (PIN_EXISTS(SUICIDE)) #define HAS_SUICIDE (PIN_EXISTS(SUICIDE))
......
...@@ -9,18 +9,22 @@ ...@@ -9,18 +9,22 @@
// Mechanisms-settings can be found in configuration_xxxxxx.h // Mechanisms-settings can be found in configuration_xxxxxx.h
// Advanced settings can be found in Configuration_adv.h // Advanced settings can be found in Configuration_adv.h
#include "boards.h"
// Choose your board type. // Choose your board type.
// Either an numeric ID or name defined in boards.h is valid. // Either an numeric ID or name defined in boards.h is valid.
// See: https://github.com/MagoKimbra/MarlinKimbra/blob/master/Documentation/Hardware.md // See: https://github.com/MagoKimbra/MarlinKimbra/blob/master/Documentation/Hardware.md
#include "boards.h"
#ifndef MOTHERBOARD #define MOTHERBOARD BOARD_RAMPS_13_EFB
#define MOTHERBOARD BOARD_RAMPS_13_EFB
#endif
// User-specified version info of this build to display in [Pronterface, etc] terminal window during // User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware. // build by the user have been successfully uploaded into firmware.
<<<<<<< HEAD
#define STRING_VERSION " 4.1.1" #define STRING_VERSION " 4.1.1"
=======
#define STRING_VERSION "4.1.2"
>>>>>>> origin/master
#define STRING_URL "reprap.org" #define STRING_URL "reprap.org"
#define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
...@@ -53,7 +57,11 @@ ...@@ -53,7 +57,11 @@
//#define COREXY //#define COREXY
//#define DELTA //#define DELTA
//#define SCARA //#define SCARA
/***********************************************************************\
/***********************************************************************\
********************** Do not touch this section **********************
***********************************************************************/
#if defined(CARTESIAN) #if defined(CARTESIAN)
#include "Configuration_Cartesian.h" #include "Configuration_Cartesian.h"
#elif defined(COREXY) #elif defined(COREXY)
...@@ -68,6 +76,9 @@ ...@@ -68,6 +76,9 @@
// This defines the number of extruder real or virtual // This defines the number of extruder real or virtual
#define EXTRUDERS 1 #define EXTRUDERS 1
// This defines the number of Driver extruder you have and use
#define DRIVER_EXTRUDERS 1
// This is used for single nozzle and multiple extrusion configuration // This is used for single nozzle and multiple extrusion configuration
// Uncomment below to enable (One Hotend) // Uncomment below to enable (One Hotend)
//#define SINGLENOZZLE //#define SINGLENOZZLE
...@@ -77,40 +88,29 @@ ...@@ -77,40 +88,29 @@
*********************************************************************** ***********************************************************************
* * * *
* Setting for more extruder width relay system * * Setting for more extruder width relay system *
* *
* Firmware by MagoKimbra magokimbra@hotmail.com *
* *
* See pins.h for pin command relay * * See pins.h for pin command relay *
* * * *
***********************************************************************/ ***********************************************************************/
//#define MKR4 //#define MKR4
#ifdef MKR4
#define DRIVER_EXTRUDERS 2 // This defines the number of Driver extruder
#endif // END MKR4
//********************************************************************** //**********************************************************************
/*********************************************************************** /***********************************************************************
*********************** Multiextruder NPr2 *************************** *********************** Multiextruder NPr2 ***************************
*********************************************************************** ***********************************************************************
* * * *
* Setting fot color meccanism NPr2 by NicolaP (www.3dmakerlab.it) * * Setting fot color meccanism NPr2 by NicolaP (www.3dmakerlab.it) *
* *
* Firmware by MagoKimbra magokimbra@hotmail.com *
* *
* Find angle setting by g-Code "M997 Cxxx" * * Find angle setting by g-Code "M997 Cxxx" *
* * * *
***********************************************************************/ ***********************************************************************/
//#define NPR2 //#define NPR2
#ifdef NPR2
#define COLOR_STEP {120,25,-65,-155} // CARTER ANGLE #define COLOR_STEP {120,25,-65,-155} // CARTER ANGLE
#define COLOR_SLOWRATE 170 // MICROSECOND delay for carter motor routine (Carter Motor Feedrate: upper value-slow feedrate) #define COLOR_SLOWRATE 170 // MICROSECOND delay for carter motor routine (Carter Motor Feedrate: upper value-slow feedrate)
#define COLOR_HOMERATE 4 // FEEDRATE for carter home #define COLOR_HOMERATE 4 // FEEDRATE for carter home
#define MOTOR_ANGLE 1.8 // Nema angle for single step #define MOTOR_ANGLE 1.8 // Nema angle for single step
#define DRIVER_MICROSTEP 4 // Microstep moltiplicator driver (set jumper MS1-2-3) off-on-off 1/4 microstepping. #define DRIVER_MICROSTEP 4 // Microstep moltiplicator driver (set jumper MS1-2-3) off-on-off 1/4 microstepping.
#define CARTER_MOLTIPLICATOR 14.22 // CARTER MOLTIPLICATOR (gear ratio 13/31-10/31) #define CARTER_MOLTIPLICATOR 14.22 // CARTER MOLTIPLICATOR (gear ratio 13/31-10/31)
#define DRIVER_EXTRUDERS 2 // This defines the number of Driver extruders
#endif
//********************************************************************** //**********************************************************************
...@@ -123,6 +123,7 @@ ...@@ -123,6 +123,7 @@
// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
//#define PS_DEFAULT_OFF //#define PS_DEFAULT_OFF
//=========================================================================== //===========================================================================
//============================= Thermal Settings ============================ //============================= Thermal Settings ============================
//=========================================================================== //===========================================================================
...@@ -207,32 +208,37 @@ ...@@ -207,32 +208,37 @@
// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all hotend) HOTEND_WATTS // If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all hotend) HOTEND_WATTS
//#define HOTEND_WATTS (12.0*12.0/6.7) // P=I^2/R //#define HOTEND_WATTS (12.0*12.0/6.7) // P=I^2/R
//#define BED_WATTS (12.0*12.0/1.1) // P=I^2/R //#define BED_WATTS (12.0*12.0/1.1) // P=I^2/R
//=========================================================================== //===========================================================================
//============================= PID Settings ================================ //============================= PID Settings ================================
//=========================================================================== //===========================================================================
// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning // PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning
// Comment the following line to disable PID and enable bang-bang. // Comment the following line to disable PID and enable bang-bang.
#define PIDTEMP #define PIDTEMP
#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
#ifdef PIDTEMP //#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_DEBUG // Sends debug data to the serial port. //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay // If the temperature difference between the target temperature and the actual temperature
// If the temperature difference between the target temperature and the actual temperature // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
// is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. #define PID_FUNCTIONAL_RANGE 10 // degC
#define PID_FUNCTIONAL_RANGE 10 // degC #define PID_INTEGRAL_DRIVE_MAX PID_MAX // Limit for the integral term
#define PID_INTEGRAL_DRIVE_MAX PID_MAX // Limit for the integral term #define K1 0.95 // Smoothing factor within the PID
#define K1 0.95 // Smoothing factor within the PID
// HotEnd{HE0,HE1,HE2,HE3} // HotEnd{HE0,HE1,HE2,HE3}
<<<<<<< HEAD
#define DEFAULT_Kp {40,40,40,40} // Kp for E0, E1, E2, E3 #define DEFAULT_Kp {40,40,40,40} // Kp for E0, E1, E2, E3
#define DEFAULT_Ki {07,07,07,07} // Ki for E0, E1, E2, E3 #define DEFAULT_Ki {07,07,07,07} // Ki for E0, E1, E2, E3
#define DEFAULT_Kd {60,60,60,60} // Kd for E0, E1, E2, E3 #define DEFAULT_Kd {60,60,60,60} // Kd for E0, E1, E2, E3
=======
#define DEFAULT_Kp {40, 40, 40, 40} // Kp for E0, E1, E2, E3
#define DEFAULT_Ki {07, 07, 07, 07} // Ki for E0, E1, E2, E3
#define DEFAULT_Kd {60, 60, 60, 60} // Kd for E0, E1, E2, E3
//===========================================================================
>>>>>>> origin/master
#endif // PIDTEMP
//=========================================================================== //===========================================================================
//============================= PID > Bed Temperature Control =============== //============================= PID > Bed Temperature Control ===============
...@@ -257,13 +263,11 @@ ...@@ -257,13 +263,11 @@
#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
//#define PID_BED_DEBUG // Sends debug data to the serial port. //#define PID_BED_DEBUG // Sends debug data to the serial port.
#ifdef PIDTEMPBED
//120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
#define DEFAULT_bedKp 10.00 #define DEFAULT_bedKp 10.00
#define DEFAULT_bedKi .023 #define DEFAULT_bedKi .023
#define DEFAULT_bedKd 305.4 #define DEFAULT_bedKd 305.4
//120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from pidautotune //from pidautotune
...@@ -272,7 +276,7 @@ ...@@ -272,7 +276,7 @@
// #define DEFAULT_bedKd 1675.16 // #define DEFAULT_bedKd 1675.16
// FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
#endif // PIDTEMPBED //===========================================================================
//this prevents dangerous Extruder moves, i.e. if the temperature is under the limit //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
...@@ -284,6 +288,7 @@ ...@@ -284,6 +288,7 @@
#define EXTRUDE_MINTEMP 170 // degC #define EXTRUDE_MINTEMP 170 // degC
#define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances. #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
//=========================================================================== //===========================================================================
//============================= Thermal Runaway Protection ================== //============================= Thermal Runaway Protection ==================
//=========================================================================== //===========================================================================
...@@ -347,10 +352,9 @@ your extruder heater takes 2 minutes to hit the target on heating. ...@@ -347,10 +352,9 @@ your extruder heater takes 2 minutes to hit the target on heating.
//#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
//#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store. //#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
//#define ULTIPANEL //the UltiPanel as on Thingiverse //#define ULTIPANEL //the UltiPanel as on Thingiverse
//#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click //#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
// 0 to disable buzzer feedback //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
// 0 to disable buzzer feedback. Test with M300 S<frequency Hz> P<duration ms>
// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) // PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
// http://reprap.org/wiki/PanelOne // http://reprap.org/wiki/PanelOne
//#define PANEL_ONE //#define PANEL_ONE
...@@ -389,10 +393,7 @@ your extruder heater takes 2 minutes to hit the target on heating. ...@@ -389,10 +393,7 @@ your extruder heater takes 2 minutes to hit the target on heating.
// REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARDUINO library folder: https://github.com/kiyoshigawa/LiquidCrystal_I2C // REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARDUINO library folder: https://github.com/kiyoshigawa/LiquidCrystal_I2C
//#define RA_CONTROL_PANEL //#define RA_CONTROL_PANEL
/** // I2C Panels
* I2C Panels
*/
//#define LCD_I2C_SAINSMART_YWROBOT //#define LCD_I2C_SAINSMART_YWROBOT
// PANELOLU2 LCD with status LEDs, separate encoder and click inputs // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
...@@ -421,9 +422,8 @@ your extruder heater takes 2 minutes to hit the target on heating. ...@@ -421,9 +422,8 @@ your extruder heater takes 2 minutes to hit the target on heating.
0 = Voltage level 3.3V 0 = Voltage level 3.3V
1 = Voltage level 5V 1 = Voltage level 5V
*/ */
#if MB(ALLIGATOR) #define UI_VOLTAGE_LEVEL 0 // Set 5 o 3.3 V
#define UI_VOLTAGE_LEVEL 0 // Set 5 o 3.3 V
#endif
//============================== Languages UI ========================= //============================== Languages UI =========================
// 1 English // 1 English
...@@ -459,7 +459,22 @@ your extruder heater takes 2 minutes to hit the target on heating. ...@@ -459,7 +459,22 @@ your extruder heater takes 2 minutes to hit the target on heating.
// to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out: // to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
// please keep turned on if you can. // please keep turned on if you can.
//#define DISABLE_M503 //#define DISABLE_M503
//===========================================================================
//====================== EXTRA SETTINGS ON SD ===============================
// Uncomment SD_SETTINGS to enable the firmware to write some configuration,
// that require frequent update, on the SD card.
//#define SD_SETTINGS
#define SD_CFG_SECONDS 60 //seconds between update
#define CFG_SD_FILE "info.cfg" //name of the configuration file
#define CFG_SD_MAX_KEY_LEN 3+1 //icrease this if you add key name longer than the actual value.
#define CFG_SD_MAX_VALUE_LEN 12+1 //this should be enought for int, long and float if you need to retrive strings increase this carefully
//===========================================================================
<<<<<<< HEAD
//=================================== EXTRA SETTINGS ON SD ================================ //=================================== EXTRA SETTINGS ON SD ================================
// Uncomment SD_SETTINGS to enable the firmware to write some configuration, that require frequent update, on the SD card. // Uncomment SD_SETTINGS to enable the firmware to write some configuration, that require frequent update, on the SD card.
#define SD_SETTINGS #define SD_SETTINGS
...@@ -469,19 +484,22 @@ your extruder heater takes 2 minutes to hit the target on heating. ...@@ -469,19 +484,22 @@ your extruder heater takes 2 minutes to hit the target on heating.
#define CFG_SD_MAX_VALUE_LEN 12+1 //this should be enought for int, long and float if you need to retrive strings increase this carefully #define CFG_SD_MAX_VALUE_LEN 12+1 //this should be enought for int, long and float if you need to retrive strings increase this carefully
//========================= Bowden Filament management ====================== //========================= Bowden Filament management ======================
=======
//==================== Bowden Filament management ===========================
>>>>>>> origin/master
//#define EASY_LOAD //#define EASY_LOAD
#ifdef EASY_LOAD
#define BOWDEN_LENGTH 250 // mm #define BOWDEN_LENGTH 250 // mm
#define LCD_PURGE_LENGTH 3 // mm #define LCD_PURGE_LENGTH 3 // mm
#define LCD_RETRACT_LENGTH 3 // mm #define LCD_RETRACT_LENGTH 3 // mm
#define LCD_PURGE_FEEDRATE 3 // mm/s #define LCD_PURGE_FEEDRATE 3 // mm/s
#define LCD_RETRACT_FEEDRATE 10 // mm/s #define LCD_RETRACT_FEEDRATE 10 // mm/s
#define LCD_LOAD_FEEDRATE 8 // mm/s #define LCD_LOAD_FEEDRATE 8 // mm/s
#define LCD_UNLOAD_FEEDRATE 8 // mm/s #define LCD_UNLOAD_FEEDRATE 8 // mm/s
#endif //EASY_LOAD //===========================================================================
//============================== Preheat Constants ========================== //====================== Preheat Constants ==================================
#define PLA_PREHEAT_HOTEND_TEMP 190 #define PLA_PREHEAT_HOTEND_TEMP 190
#define PLA_PREHEAT_HPB_TEMP 60 #define PLA_PREHEAT_HPB_TEMP 60
#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 #define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
...@@ -493,6 +511,7 @@ your extruder heater takes 2 minutes to hit the target on heating. ...@@ -493,6 +511,7 @@ your extruder heater takes 2 minutes to hit the target on heating.
#define GUM_PREHEAT_HOTEND_TEMP 230 #define GUM_PREHEAT_HOTEND_TEMP 230
#define GUM_PREHEAT_HPB_TEMP 60 #define GUM_PREHEAT_HPB_TEMP 60
#define GUM_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255 #define GUM_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
//===========================================================================
//============================= R/C Servo support =========================== //============================= R/C Servo support ===========================
...@@ -508,6 +527,7 @@ your extruder heater takes 2 minutes to hit the target on heating. ...@@ -508,6 +527,7 @@ your extruder heater takes 2 minutes to hit the target on heating.
// //
#define SERVO_ENDSTOPS {-1,-1,0} // Servo index for X, Y, Z. Disable with -1 #define SERVO_ENDSTOPS {-1,-1,0} // Servo index for X, Y, Z. Disable with -1
#define SERVO_ENDSTOP_ANGLES {0,0,0,0,90,0} // X,Y,Z Axis Extend and Retract angles #define SERVO_ENDSTOP_ANGLES {0,0,0,0,90,0} // X,Y,Z Axis Extend and Retract angles
//===========================================================================
/**********************************************************************\ /**********************************************************************\
...@@ -537,6 +557,7 @@ your extruder heater takes 2 minutes to hit the target on heating. ...@@ -537,6 +557,7 @@ your extruder heater takes 2 minutes to hit the target on heating.
//When using an LCD, uncomment the line below to display the Filament sensor data on the last line instead of status. Status will appear for 5 sec. //When using an LCD, uncomment the line below to display the Filament sensor data on the last line instead of status. Status will appear for 5 sec.
//#define FILAMENT_LCD_DISPLAY //#define FILAMENT_LCD_DISPLAY
//===========================================================================
/**********************************************************************\ /**********************************************************************\
...@@ -563,6 +584,8 @@ your extruder heater takes 2 minutes to hit the target on heating. ...@@ -563,6 +584,8 @@ your extruder heater takes 2 minutes to hit the target on heating.
//When using an LCD, uncomment the line below to display the Power consumption sensor data on the last line instead of status. Status will appear for 5 sec. //When using an LCD, uncomment the line below to display the Power consumption sensor data on the last line instead of status. Status will appear for 5 sec.
//#define POWER_CONSUMPTION_LCD_DISPLAY //#define POWER_CONSUMPTION_LCD_DISPLAY
//===========================================================================
//=================================== Misc ================================= //=================================== Misc =================================
...@@ -601,6 +624,7 @@ your extruder heater takes 2 minutes to hit the target on heating. ...@@ -601,6 +624,7 @@ your extruder heater takes 2 minutes to hit the target on heating.
// Enable this option for Toshiba steppers // Enable this option for Toshiba steppers
//#define CONFIG_STEPPERS_TOSHIBA //#define CONFIG_STEPPERS_TOSHIBA
//=========================================================================== //===========================================================================
//============================= Filament Runout Sensor ====================== //============================= Filament Runout Sensor ======================
//=========================================================================== //===========================================================================
...@@ -615,8 +639,8 @@ your extruder heater takes 2 minutes to hit the target on heating. ...@@ -615,8 +639,8 @@ your extruder heater takes 2 minutes to hit the target on heating.
//=========================================================================== //===========================================================================
//============================= Laser Beam Support ========================== //============================= Laser Beam Support ==========================
//=========================================================================== //===========================================================================
// define laser beam support
//#define LASERBEAM //#define LASERBEAM
//===========================================================================
#include "Configuration_adv.h" #include "Configuration_adv.h"
......
...@@ -109,8 +109,7 @@ void _EEPROM_writeData(int &pos, uint8_t* value, uint8_t size) { ...@@ -109,8 +109,7 @@ void _EEPROM_writeData(int &pos, uint8_t* value, uint8_t size) {
eeprom_write_byte((unsigned char*)pos, *value); eeprom_write_byte((unsigned char*)pos, *value);
c = eeprom_read_byte((unsigned char*)pos); c = eeprom_read_byte((unsigned char*)pos);
if (c != *value) { if (c != *value) {
SERIAL_ECHO_START; ECHO_LM(ER, MSG_ERR_EEPROM_WRITE);
SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE);
} }
pos++; pos++;
value++; value++;
...@@ -265,9 +264,8 @@ void Config_StoreSettings() { ...@@ -265,9 +264,8 @@ void Config_StoreSettings() {
EEPROM_WRITE_VAR(j, ver2); // validate data EEPROM_WRITE_VAR(j, ver2); // validate data
// Report storage size // Report storage size
SERIAL_ECHO_START; ECHO_SMV(DB, "Settings Stored (", i);
SERIAL_ECHOPAIR("Settings Stored (", (unsigned long)i); ECHO_EM(" bytes)");
SERIAL_ECHOLNPGM(" bytes)");
} }
void Config_RetrieveSettings() { void Config_RetrieveSettings() {
...@@ -276,7 +274,6 @@ void Config_RetrieveSettings() { ...@@ -276,7 +274,6 @@ void Config_RetrieveSettings() {
char stored_ver[4]; char stored_ver[4];
char ver[4] = EEPROM_VERSION; char ver[4] = EEPROM_VERSION;
EEPROM_READ_VAR(i, stored_ver); //read stored version EEPROM_READ_VAR(i, stored_ver); //read stored version
// SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << stored_ver << "]");
if (strncmp(ver, stored_ver, 3) != 0) { if (strncmp(ver, stored_ver, 3) != 0) {
Config_ResetDefault(); Config_ResetDefault();
...@@ -419,10 +416,9 @@ void Config_RetrieveSettings() { ...@@ -419,10 +416,9 @@ void Config_RetrieveSettings() {
updatePID(); updatePID();
// Report settings retrieved and length // Report settings retrieved and length
SERIAL_ECHO_START; ECHO_SV(DB, ver);
SERIAL_ECHO(ver); ECHO_MV(" stored settings retrieved (", i);
SERIAL_ECHOPAIR(" stored settings retrieved (", (unsigned long)i); ECHO_EM(" bytes)");
SERIAL_ECHOLNPGM(" bytes)");
} }
#ifdef EEPROM_CHITCHAT #ifdef EEPROM_CHITCHAT
...@@ -559,8 +555,20 @@ void Config_ResetDefault() { ...@@ -559,8 +555,20 @@ void Config_ResetDefault() {
idleoozing_enabled = true; idleoozing_enabled = true;
#endif #endif
<<<<<<< HEAD
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded"); SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded");
=======
ECHO_LM(DB, "Hardcoded Default Settings Loaded");
}
void ConfigSD_ResetDefault() {
#ifdef POWER_CONSUMPTION
power_consumption_hour = 0;
#endif
printer_usage_seconds = 0;
ECHO_LM(DB, "Hardcoded SD Default Settings Loaded");
>>>>>>> origin/master
} }
void ConfigSD_ResetDefault() { void ConfigSD_ResetDefault() {
...@@ -578,299 +586,242 @@ void Config_PrintSettings(bool forReplay) { ...@@ -578,299 +586,242 @@ void Config_PrintSettings(bool forReplay) {
// Always have this function, even with EEPROM_SETTINGS disabled, the current values will be shown // Always have this function, even with EEPROM_SETTINGS disabled, the current values will be shown
if (!forReplay) { if (!forReplay) {
SERIAL_ECHOLNPGM("Steps per unit:"); ECHO_LM(DB, "Steps per unit:");
SERIAL_ECHO_START;
} }
SERIAL_ECHOPAIR(" M92 X", axis_steps_per_unit[X_AXIS]); ECHO_SMV(DB, " M92 X", axis_steps_per_unit[X_AXIS]);
SERIAL_ECHOPAIR(" Y", axis_steps_per_unit[Y_AXIS]); ECHO_MV(" Y", axis_steps_per_unit[Y_AXIS]);
SERIAL_ECHOPAIR(" Z", axis_steps_per_unit[Z_AXIS]); ECHO_MV(" Z", axis_steps_per_unit[Z_AXIS]);
SERIAL_ECHOPAIR(" E0 S", axis_steps_per_unit[E_AXIS + 0]); ECHO_MV(" E0 S", axis_steps_per_unit[E_AXIS + 0]);
#if EXTRUDERS > 1 #if EXTRUDERS > 1
SERIAL_ECHOPAIR(" E1 S", axis_steps_per_unit[E_AXIS + 1]); ECHO_MV(" E1 S", axis_steps_per_unit[E_AXIS + 1]);
#if EXTRUDERS > 2 #if EXTRUDERS > 2
SERIAL_ECHOPAIR(" E2 S", axis_steps_per_unit[E_AXIS + 2]); ECHO_MV(" E2 S", axis_steps_per_unit[E_AXIS + 2]);
#if EXTRUDERS > 3 #if EXTRUDERS > 3
SERIAL_ECHOPAIR(" E3 S", axis_steps_per_unit[E_AXIS + 3]); ECHO_MV(" E3 S", axis_steps_per_unit[E_AXIS + 3]);
#endif //EXTRUDERS > 3 #endif //EXTRUDERS > 3
#endif //EXTRUDERS > 2 #endif //EXTRUDERS > 2
#endif //EXTRUDERS > 1 #endif //EXTRUDERS > 1
SERIAL_EOL; ECHO_E;
SERIAL_ECHO_START;
#ifdef SCARA #ifdef SCARA
if (!forReplay) { if (!forReplay) {
SERIAL_ECHOLNPGM("Scaling factors:"); ECHO_LM(DB, "Scaling factors:");
SERIAL_ECHO_START;
} }
SERIAL_ECHOPAIR(" M365 X", axis_scaling[X_AXIS]); ECHO_SMV(DB, " M365 X", axis_scaling[X_AXIS]);
SERIAL_ECHOPAIR(" Y", axis_scaling[Y_AXIS]); ECHO_MV(" Y", axis_scaling[Y_AXIS]);
SERIAL_ECHOPAIR(" Z", axis_scaling[Z_AXIS]); ECHO_EMV(" Z", axis_scaling[Z_AXIS]);
SERIAL_EOL;
SERIAL_ECHO_START;
#endif // SCARA #endif // SCARA
if (!forReplay) { if (!forReplay) {
SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):"); ECHO_LM(DB, "Maximum feedrates (mm/s):");
SERIAL_ECHO_START;
} }
SERIAL_ECHOPAIR(" M203 X", max_feedrate[X_AXIS]); ECHO_SMV(DB, " M203 X", max_feedrate[X_AXIS]);
SERIAL_ECHOPAIR(" Y", max_feedrate[Y_AXIS] ); ECHO_MV(" Y", max_feedrate[Y_AXIS] );
SERIAL_ECHOPAIR(" Z", max_feedrate[Z_AXIS] ); ECHO_MV(" Z", max_feedrate[Z_AXIS] );
SERIAL_ECHOPAIR(" E0 S", max_feedrate[E_AXIS + 0]); ECHO_MV(" E0 S", max_feedrate[E_AXIS + 0]);
#if EXTRUDERS > 1 #if EXTRUDERS > 1
SERIAL_ECHOPAIR(" E1 S", max_feedrate[E_AXIS + 1]); ECHO_MV(" E1 S", max_feedrate[E_AXIS + 1]);
#if EXTRUDERS > 2 #if EXTRUDERS > 2
SERIAL_ECHOPAIR(" E2 S", max_feedrate[E_AXIS + 2]); ECHO_MV(" E2 S", max_feedrate[E_AXIS + 2]);
#if EXTRUDERS > 3 #if EXTRUDERS > 3
SERIAL_ECHOPAIR(" E3 S", max_feedrate[E_AXIS + 3]); ECHO_MV(" E3 S", max_feedrate[E_AXIS + 3]);
#endif //EXTRUDERS > 3 #endif //EXTRUDERS > 3
#endif //EXTRUDERS > 2 #endif //EXTRUDERS > 2
#endif //EXTRUDERS > 1 #endif //EXTRUDERS > 1
SERIAL_EOL; ECHO_E;
SERIAL_ECHO_START;
if (!forReplay) { if (!forReplay) {
SERIAL_ECHOLNPGM("Retraction Steps per unit:"); ECHO_LM(DB, "Retraction Steps per unit:");
SERIAL_ECHO_START;
} }
SERIAL_ECHOPAIR(" E0 ",max_retraction_feedrate[0]); ECHO_SMV(DB, " E0 ",max_retraction_feedrate[0]);
#if EXTRUDERS > 1 #if EXTRUDERS > 1
SERIAL_ECHOPAIR(" E1 ", max_retraction_feedrate[1]); ECHO_MV(" E1 ", max_retraction_feedrate[1]);
#if EXTRUDERS > 2 #if EXTRUDERS > 2
SERIAL_ECHOPAIR(" E2 ", max_retraction_feedrate[2]); ECHO_MV(" E2 ", max_retraction_feedrate[2]);
#if EXTRUDERS > 3 #if EXTRUDERS > 3
SERIAL_ECHOPAIR(" E3 ", max_retraction_feedrate[3]); ECHO_MV(" E3 ", max_retraction_feedrate[3]);
#endif //EXTRUDERS > 3 #endif //EXTRUDERS > 3
#endif //EXTRUDERS > 2 #endif //EXTRUDERS > 2
#endif //EXTRUDERS > 1 #endif //EXTRUDERS > 1
SERIAL_EOL; ECHO_E;
SERIAL_ECHO_START;
if (!forReplay) { if (!forReplay) {
SERIAL_ECHOLNPGM("Maximum Acceleration (mm/s2):"); ECHO_LM(DB, "Maximum Acceleration (mm/s2):");
SERIAL_ECHO_START;
} }
SERIAL_ECHOPAIR(" M201 X", max_acceleration_units_per_sq_second[X_AXIS] ); ECHO_SMV(DB, " M201 X", max_acceleration_units_per_sq_second[X_AXIS] );
SERIAL_ECHOPAIR(" Y", max_acceleration_units_per_sq_second[Y_AXIS] ); ECHO_MV(" Y", max_acceleration_units_per_sq_second[Y_AXIS] );
SERIAL_ECHOPAIR(" Z", max_acceleration_units_per_sq_second[Z_AXIS] ); ECHO_MV(" Z", max_acceleration_units_per_sq_second[Z_AXIS] );
SERIAL_ECHOPAIR(" E0 S", max_acceleration_units_per_sq_second[E_AXIS]); ECHO_MV(" E0 S", max_acceleration_units_per_sq_second[E_AXIS]);
#if EXTRUDERS > 1 #if EXTRUDERS > 1
SERIAL_ECHOPAIR(" E1 S", max_acceleration_units_per_sq_second[E_AXIS+1]); ECHO_MV(" E1 S", max_acceleration_units_per_sq_second[E_AXIS+1]);
#if EXTRUDERS > 2 #if EXTRUDERS > 2
SERIAL_ECHOPAIR(" E2 S", max_acceleration_units_per_sq_second[E_AXIS+2]); ECHO_MV(" E2 S", max_acceleration_units_per_sq_second[E_AXIS+2]);
#if EXTRUDERS > 3 #if EXTRUDERS > 3
SERIAL_ECHOPAIR(" E3 S", max_acceleration_units_per_sq_second[E_AXIS+3]); ECHO_MV(" E3 S", max_acceleration_units_per_sq_second[E_AXIS+3]);
#endif //EXTRUDERS > 3 #endif //EXTRUDERS > 3
#endif //EXTRUDERS > 2 #endif //EXTRUDERS > 2
#endif //EXTRUDERS > 1 #endif //EXTRUDERS > 1
ECHO_E;
SERIAL_EOL;
SERIAL_ECHO_START;
if (!forReplay) { if (!forReplay) {
SERIAL_ECHOLNPGM("Accelerations: P=printing, R=retract and T=travel"); ECHO_LM(DB, "Accelerations: P=printing, R=retract and T=travel");
SERIAL_ECHO_START;
} }
SERIAL_ECHOPAIR(" M204 P", acceleration ); ECHO_SMV(DB," M204 P", acceleration );
SERIAL_ECHOPAIR(" R", retract_acceleration); ECHO_MV(" R", retract_acceleration);
SERIAL_ECHOPAIR(" T", travel_acceleration); ECHO_EMV(" T", travel_acceleration);
SERIAL_EOL;
SERIAL_ECHO_START;
if (!forReplay) { if (!forReplay) {
SERIAL_ECHOLNPGM("Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s)"); ECHO_LM(DB, "Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s)");
SERIAL_ECHO_START;
} }
SERIAL_ECHOPAIR(" M205 S", minimumfeedrate ); ECHO_SMV(DB, " M205 S", minimumfeedrate );
SERIAL_ECHOPAIR(" T", mintravelfeedrate ); ECHO_MV(" T", mintravelfeedrate );
SERIAL_ECHOPAIR(" B", minsegmenttime ); ECHO_MV(" B", minsegmenttime );
SERIAL_ECHOPAIR(" X", max_xy_jerk ); ECHO_MV(" X", max_xy_jerk );
SERIAL_ECHOPAIR(" Z", max_z_jerk); ECHO_MV(" Z", max_z_jerk);
SERIAL_ECHOPAIR(" E", max_e_jerk); ECHO_EMV(" E", max_e_jerk);
SERIAL_EOL;
SERIAL_ECHO_START;
if (!forReplay) { if (!forReplay) {
SERIAL_ECHOLNPGM("Home offset (mm):"); ECHO_LM(DB, "Home offset (mm):");
SERIAL_ECHO_START;
} }
SERIAL_ECHOPAIR(" M206 X", home_offset[X_AXIS] ); ECHO_SMV(DB, " M206 X", home_offset[X_AXIS] );
SERIAL_ECHOPAIR(" Y", home_offset[Y_AXIS] ); ECHO_MV(" Y", home_offset[Y_AXIS] );
SERIAL_ECHOPAIR(" Z", home_offset[Z_AXIS] ); ECHO_EMV(" Z", home_offset[Z_AXIS] );
SERIAL_EOL;
SERIAL_ECHO_START;
#if HOTENDS > 1 #if HOTENDS > 1
if (!forReplay) { if (!forReplay) {
SERIAL_ECHOLNPGM("Hotend offset (mm):"); ECHO_LM(DB, "Hotend offset (mm):");
SERIAL_ECHO_START;
} }
for (int e = 0; e < HOTENDS; e++) { for (int e = 0; e < HOTENDS; e++) {
SERIAL_ECHO_START; ECHO_SMV(DB, " M218 T", e);
SERIAL_ECHOPAIR(" M218 T", (long unsigned int)e); ECHO_MV(" X", hotend_offset[X_AXIS][e]);
SERIAL_ECHOPAIR(" X", hotend_offset[X_AXIS][e]); ECHO_EMV(" Y" ,hotend_offset[Y_AXIS][e]);
SERIAL_ECHOPAIR(" Y" ,hotend_offset[Y_AXIS][e]);
SERIAL_EOL;
} }
#endif //HOTENDS > 1 #endif //HOTENDS > 1
#ifdef DELTA #ifdef DELTA
SERIAL_ECHO_START;
if (!forReplay) { if (!forReplay) {
SERIAL_ECHOLNPGM("Endstop adjustement (mm):"); ECHO_LM(DB, "Endstop adjustement (mm):");
SERIAL_ECHO_START;
} }
SERIAL_ECHOPAIR(" M666 X", endstop_adj[X_AXIS] ); ECHO_SMV(DB, " M666 X", endstop_adj[X_AXIS] );
SERIAL_ECHOPAIR(" Y", endstop_adj[Y_AXIS] ); ECHO_MV(" Y", endstop_adj[Y_AXIS] );
SERIAL_ECHOPAIR(" Z", endstop_adj[Z_AXIS] ); ECHO_EMV(" Z", endstop_adj[Z_AXIS] );
SERIAL_EOL;
SERIAL_ECHO_START; if (!forReplay) {
SERIAL_ECHOLNPGM("Delta Geometry adjustment:"); ECHO_LM(DB, "Delta Geometry adjustment:");
SERIAL_ECHO_START; }
SERIAL_ECHOPAIR(" M666 A", tower_adj[0]); ECHO_SMV(DB, " M666 A", tower_adj[0]);
SERIAL_ECHOPAIR(" B", tower_adj[1]); ECHO_MV(" B", tower_adj[1]);
SERIAL_ECHOPAIR(" C", tower_adj[2]); ECHO_MV(" C", tower_adj[2]);
SERIAL_ECHOPAIR(" E", tower_adj[3]); ECHO_MV(" E", tower_adj[3]);
SERIAL_ECHOPAIR(" F", tower_adj[4]); ECHO_MV(" F", tower_adj[4]);
SERIAL_ECHOPAIR(" G", tower_adj[5]); ECHO_MV(" G", tower_adj[5]);
SERIAL_ECHOPAIR(" R", delta_radius); ECHO_MV(" R", delta_radius);
SERIAL_ECHOPAIR(" D", delta_diagonal_rod); ECHO_MV(" D", delta_diagonal_rod);
SERIAL_ECHOPAIR(" H", max_pos[2]); ECHO_MV(" H", max_pos[2]);
SERIAL_ECHOPAIR(" P", z_probe_offset[3]); ECHO_EMV(" P", z_probe_offset[3]);
SERIAL_EOL;
SERIAL_ECHOLN("Tower Positions"); if (!forReplay) {
SERIAL_ECHOPAIR("Tower1 X:", delta_tower1_x); ECHO_LM(DB, "Tower Positions:");
SERIAL_ECHOPAIR(" Y:", delta_tower1_y); }
SERIAL_EOL; ECHO_SMV(DB, " Tower1 X:", delta_tower1_x);
SERIAL_ECHOPAIR("Tower2 X:", delta_tower2_x); ECHO_MV(" Y:", delta_tower1_y);
SERIAL_ECHOPAIR(" Y:", delta_tower2_y); ECHO_MV(" Tower2 X:", delta_tower2_x);
SERIAL_EOL; ECHO_MV(" Y:", delta_tower2_y);
SERIAL_ECHOPAIR("Tower3 X:", delta_tower3_x); ECHO_MV(" Tower3 X:", delta_tower3_x);
SERIAL_ECHOPAIR(" Y:", delta_tower3_y); ECHO_EMV(" Y:", delta_tower3_y);
SERIAL_EOL;
#elif defined(Z_DUAL_ENDSTOPS) #elif defined(Z_DUAL_ENDSTOPS)
SERIAL_ECHO_START;
if (!forReplay) { if (!forReplay) {
SERIAL_ECHOLNPGM("Z2 Endstop adjustement (mm):"); ECHO_LM(DB, "Z2 Endstop adjustement (mm):");
SERIAL_ECHO_START;
} }
SERIAL_ECHOPAIR(" M666 Z", z_endstop_adj ); ECHO_LMV(DB, " M666 Z", z_endstop_adj );
SERIAL_EOL;
#elif defined(ENABLE_AUTO_BED_LEVELING) #elif defined(ENABLE_AUTO_BED_LEVELING)
SERIAL_ECHO_START;
if (!forReplay) { if (!forReplay) {
SERIAL_ECHOLNPGM("Z Probe offset (mm)"); ECHO_LM(DB, "Z Probe offset (mm)");
SERIAL_ECHO_START;
} }
SERIAL_ECHOPAIR(" M666 P", zprobe_zoffset); ECHO_LMV(DB, " M666 P", zprobe_zoffset);
SERIAL_EOL;
#endif // DELTA #endif // DELTA
#if defined(PIDTEMP) || defined(PIDTEMPBED) #if defined(PIDTEMP) || defined(PIDTEMPBED)
SERIAL_ECHO_START;
if (!forReplay) { if (!forReplay) {
SERIAL_ECHOLNPGM("PID settings:"); ECHO_LM(DB, "PID settings:");
SERIAL_ECHO_START;
} }
#if defined(PIDTEMP) && defined(PIDTEMPBED)
SERIAL_EOL;
#endif
#ifdef PIDTEMP #ifdef PIDTEMP
for (int e = 0; e < HOTENDS; e++) { for (int e = 0; e < HOTENDS; e++) {
SERIAL_ECHO_START; ECHO_SMV(DB, " M301 E", e);
SERIAL_ECHOPAIR(" M301 E", (long unsigned int)e); ECHO_MV(" P", PID_PARAM(Kp, e));
SERIAL_ECHOPAIR(" P", PID_PARAM(Kp, e)); ECHO_MV(" I", unscalePID_i(PID_PARAM(Ki, e)));
SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, e))); ECHO_EMV(" D", unscalePID_d(PID_PARAM(Kd, e)));
SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, e)));
SERIAL_EOL;
} }
#endif #endif
#ifdef PIDTEMPBED #ifdef PIDTEMPBED
SERIAL_ECHOPAIR(" M304 P", bedKp); // for compatibility with hosts, only echos values for E0 ECHO_SMV(DB, " M304 P", bedKp); // for compatibility with hosts, only echos values for E0
SERIAL_ECHOPAIR(" I", unscalePID_i(bedKi)); ECHO_MV(" I", unscalePID_i(bedKi));
SERIAL_ECHOPAIR(" D", unscalePID_d(bedKd)); ECHO_EMV(" D", unscalePID_d(bedKd));
SERIAL_EOL;
#endif #endif
#endif #endif
#ifdef FWRETRACT #ifdef FWRETRACT
SERIAL_ECHO_START;
if (!forReplay) { if (!forReplay) {
SERIAL_ECHOLNPGM("Retract: S=Length (mm) F:Speed (mm/m) Z: ZLift (mm)"); ECHO_LM(DB,"Retract: S=Length (mm) F:Speed (mm/m) Z: ZLift (mm)");
SERIAL_ECHO_START;
} }
SERIAL_ECHOPAIR(" M207 S", retract_length); ECHO_SMV(DB, " M207 S", retract_length);
SERIAL_ECHOPAIR(" F", retract_feedrate*60); ECHO_MV(" F", retract_feedrate*60);
SERIAL_ECHOPAIR(" Z", retract_zlift); ECHO_EMV(" Z", retract_zlift);
SERIAL_EOL;
SERIAL_ECHO_START;
if (!forReplay) { if (!forReplay) {
SERIAL_ECHOLNPGM("Recover: S=Extra length (mm) F:Speed (mm/m)"); ECHO_LM(DB, "Recover: S=Extra length (mm) F:Speed (mm/m)");
SERIAL_ECHO_START;
} }
SERIAL_ECHOPAIR(" M208 S", retract_recover_length); ECHO_SMV(DB, " M208 S", retract_recover_length);
SERIAL_ECHOPAIR(" F", retract_recover_feedrate*60); ECHO_MV(" F", retract_recover_feedrate*60);
SERIAL_EOL;
SERIAL_ECHO_START;
if (!forReplay) { if (!forReplay) {
SERIAL_ECHOLNPGM("Auto-Retract: S=0 to disable, 1 to interpret extrude-only moves as retracts or recoveries"); ECHO_LM(DB,"Auto-Retract: S=0 to disable, 1 to interpret extrude-only moves as retracts or recoveries");
SERIAL_ECHO_START;
} }
SERIAL_ECHOPAIR(" M209 S", (unsigned long)(autoretract_enabled ? 1 : 0)); ECHO_LMV(DB," M209 S", autoretract_enabled);
SERIAL_EOL;
#if EXTRUDERS > 1 #if EXTRUDERS > 1
if (!forReplay) { if (!forReplay) {
SERIAL_ECHO_START; ECHO_LM(DB,"Multi-extruder settings:");
SERIAL_ECHOLNPGM("Multi-extruder settings:"); ECHO_LMV(DB, " Swap retract length (mm): ", retract_length_swap);
SERIAL_ECHO_START; ECHO_LMV(DB, " Swap rec. addl. length (mm): ", retract_recover_length_swap);
SERIAL_ECHOPAIR(" Swap retract length (mm): ", retract_length_swap);
SERIAL_EOL;
SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" Swap rec. addl. length (mm): ", retract_recover_length_swap);
SERIAL_EOL;
} }
#endif // EXTRUDERS > 1 #endif // EXTRUDERS > 1
#endif // FWRETRACT #endif // FWRETRACT
SERIAL_ECHO_START;
if (volumetric_enabled) { if (volumetric_enabled) {
if (!forReplay) { if (!forReplay) {
SERIAL_ECHOLNPGM("Filament settings:"); ECHO_LM(DB, "Filament settings:");
SERIAL_ECHO_START;
} }
SERIAL_ECHOPAIR(" M200 D", filament_size[0]); ECHO_LMV(DB, " M200 D", filament_size[0]);
SERIAL_EOL;
#if EXTRUDERS > 1 #if EXTRUDERS > 1
SERIAL_ECHO_START; ECHO_LMV(DB, " M200 T1 D", filament_size[1]);
SERIAL_ECHOPAIR(" M200 T1 D", filament_size[1]);
SERIAL_EOL;
#if EXTRUDERS > 2 #if EXTRUDERS > 2
SERIAL_ECHO_START; ECHO_LMV(DB, " M200 T2 D", filament_size[2]);
SERIAL_ECHOPAIR(" M200 T2 D", filament_size[2]);
SERIAL_EOL;
#if EXTRUDERS > 3 #if EXTRUDERS > 3
SERIAL_ECHO_START; ECHO_LMV(DB, " M200 T3 D", filament_size[3]);
SERIAL_ECHOPAIR(" M200 T3 D", filament_size[3]);
SERIAL_EOL;
#endif #endif
#endif #endif
#endif #endif
} else { } else {
if (!forReplay) { if (!forReplay) {
SERIAL_ECHOLNPGM("Filament settings: Disabled"); ECHO_LM(DB, "Filament settings: Disabled");
} }
} }
<<<<<<< HEAD
=======
if (printer_usage_seconds > 0) ConfigSD_PrintSettings(forReplay);
>>>>>>> origin/master
} }
void ConfigSD_PrintSettings(bool forReplay) { void ConfigSD_PrintSettings(bool forReplay) {
// Always have this function, even with SD_SETTINGS disabled, the current values will be shown // Always have this function, even with SD_SETTINGS disabled, the current values will be shown
#ifdef POWER_CONSUMPTION #ifdef POWER_CONSUMPTION
if (!forReplay) { if (!forReplay) {
<<<<<<< HEAD
SERIAL_ECHOLNPGM("Watt/h consumed:"); SERIAL_ECHOLNPGM("Watt/h consumed:");
SERIAL_ECHO_START; SERIAL_ECHO_START;
} }
...@@ -883,10 +834,33 @@ void ConfigSD_PrintSettings(bool forReplay) { ...@@ -883,10 +834,33 @@ void ConfigSD_PrintSettings(bool forReplay) {
} }
SERIAL_ECHOPAIR(" s", printer_usage_seconds); SERIAL_ECHOPAIR(" s", printer_usage_seconds);
SERIAL_EOL; SERIAL_EOL;
=======
ECHO_LM(DB, "Watt/h consumed:");
}
ECHO_LVM(DB, power_consumption_hour," W/h");
#endif
if (!forReplay) {
ECHO_LM(DB, "Power on time:");
}
char time[30];
int hours = printer_usage_seconds / 60 / 60, minutes = (printer_usage_seconds / 60) % 60;
sprintf_P(time, PSTR("%i " MSG_END_HOUR " %i " MSG_END_MINUTE), hours, minutes);
ECHO_LV(DB, time);
>>>>>>> origin/master
} }
#endif //!DISABLE_M503 #endif //!DISABLE_M503
<<<<<<< HEAD
=======
/**
* Configuration on SD card
*
* Author: Simone Primarosa
*
*/
>>>>>>> origin/master
#if defined(SDSUPPORT) && defined(SD_SETTINGS) #if defined(SDSUPPORT) && defined(SD_SETTINGS)
void ConfigSD_StoreSettings() { void ConfigSD_StoreSettings() {
if(!IS_SD_INSERTED || card.isFileOpen() || card.sdprinting) return; if(!IS_SD_INSERTED || card.isFileOpen() || card.sdprinting) return;
...@@ -903,7 +877,11 @@ void ConfigSD_PrintSettings(bool forReplay) { ...@@ -903,7 +877,11 @@ void ConfigSD_PrintSettings(bool forReplay) {
config_last_update = millis(); config_last_update = millis();
} }
void ConfigSD_RetrieveSettings(bool addValue) { void ConfigSD_RetrieveSettings(bool addValue) {
<<<<<<< HEAD
if(!IS_SD_INSERTED || card.isFileOpen() || card.sdprinting) return; if(!IS_SD_INSERTED || card.isFileOpen() || card.sdprinting) return;
=======
if(!IS_SD_INSERTED || card.isFileOpen() || card.sdprinting || !card.cardOK) return;
>>>>>>> origin/master
char key[CFG_SD_MAX_KEY_LEN], value[CFG_SD_MAX_VALUE_LEN]; char key[CFG_SD_MAX_KEY_LEN], value[CFG_SD_MAX_VALUE_LEN];
int k_idx; int k_idx;
int k_len, v_len; int k_len, v_len;
...@@ -933,7 +911,11 @@ void ConfigSD_PrintSettings(bool forReplay) { ...@@ -933,7 +911,11 @@ void ConfigSD_PrintSettings(bool forReplay) {
} }
card.closeFile(false); card.closeFile(false);
config_readed = true; config_readed = true;
<<<<<<< HEAD
config_last_update = millis(); config_last_update = millis();
=======
ConfigSD_PrintSettings(true);
>>>>>>> origin/master
} }
int ConfigSD_KeyIndex(char *key) { //At the moment a binary search algorithm is used for simplicity, if it will be necessary (Eg. tons of key), an hash search algorithm will be implemented. int ConfigSD_KeyIndex(char *key) { //At the moment a binary search algorithm is used for simplicity, if it will be necessary (Eg. tons of key), an hash search algorithm will be implemented.
......
...@@ -29,7 +29,11 @@ void ConfigSD_ResetDefault(); ...@@ -29,7 +29,11 @@ void ConfigSD_ResetDefault();
#endif #endif
"TME", "TME",
}; };
<<<<<<< HEAD
=======
>>>>>>> origin/master
enum cfgSD_ENUM { //This need to be in the same order as cfgSD_KEY enum cfgSD_ENUM { //This need to be in the same order as cfgSD_KEY
#ifdef POWER_CONSUMPTION #ifdef POWER_CONSUMPTION
SD_CFG_PWR, SD_CFG_PWR,
...@@ -37,7 +41,11 @@ void ConfigSD_ResetDefault(); ...@@ -37,7 +41,11 @@ void ConfigSD_ResetDefault();
SD_CFG_TME, SD_CFG_TME,
SD_CFG_END //Leave this always as the last SD_CFG_END //Leave this always as the last
}; };
<<<<<<< HEAD
=======
>>>>>>> origin/master
void ConfigSD_StoreSettings(); void ConfigSD_StoreSettings();
void ConfigSD_RetrieveSettings(bool addValue = false); void ConfigSD_RetrieveSettings(bool addValue = false);
int ConfigSD_KeyIndex(char *key); int ConfigSD_KeyIndex(char *key);
......
...@@ -36,13 +36,14 @@ ...@@ -36,13 +36,14 @@
// Z-Probe variables // Z-Probe variables
// Start and end location values are used to deploy/retract the probe (will move from start to end and back again) // 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 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_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_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_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_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_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 Z_RAISE_BETWEEN_PROBINGS 2 // 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=========================== //=============================Mechanical Settings===========================
......
...@@ -46,9 +46,17 @@ ...@@ -46,9 +46,17 @@
//The M105 command return, besides traditional information, the ADC value read from temperature sensors. //The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES //#define SHOW_TEMP_ADC_VALUES
<<<<<<< HEAD
// extruder idle oozing prevention // 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 //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. //or when the target temperature is less than EXTRUDE_MINTEMP.
=======
//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
>>>>>>> origin/master
//#define IDLE_OOZING_PREVENT //#define IDLE_OOZING_PREVENT
#define IDLE_OOZING_MINTEMP EXTRUDE_MINTEMP + 25 #define IDLE_OOZING_MINTEMP EXTRUDE_MINTEMP + 25
#define IDLE_OOZING_FEEDRATE 45 //default feedrate for retracting (mm/s) #define IDLE_OOZING_FEEDRATE 45 //default feedrate for retracting (mm/s)
...@@ -381,6 +389,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st ...@@ -381,6 +389,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#define FILAMENTCHANGE_ZADD 10 #define FILAMENTCHANGE_ZADD 10
#define FILAMENTCHANGE_FIRSTRETRACT -2 #define FILAMENTCHANGE_FIRSTRETRACT -2
#define FILAMENTCHANGE_FINALRETRACT -100 #define FILAMENTCHANGE_FINALRETRACT -100
#define FILAMENTCHANGE_PRINTEROFF 5 // Minutes
#endif #endif
#endif #endif
......
...@@ -45,78 +45,7 @@ typedef unsigned long millis_t; ...@@ -45,78 +45,7 @@ typedef unsigned long millis_t;
#define analogInputToDigitalPin(p) ((p) + 0xA0) #define analogInputToDigitalPin(p) ((p) + 0xA0)
#endif #endif
#ifdef AT90USB #include "Comunication.h"
#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++;
}
}
void get_command(); void get_command();
void process_commands(); void process_commands();
...@@ -365,7 +294,11 @@ extern int fanSpeed; ...@@ -365,7 +294,11 @@ extern int fanSpeed;
#endif #endif
#if defined(SDSUPPORT) && defined(SD_SETTINGS) #if defined(SDSUPPORT) && defined(SD_SETTINGS)
<<<<<<< HEAD
extern unsigned long config_last_update; extern unsigned long config_last_update;
=======
extern millis_t config_last_update;
>>>>>>> origin/master
extern bool config_readed; extern bool config_readed;
#endif #endif
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -111,8 +111,8 @@ ...@@ -111,8 +111,8 @@
/** /**
* Required LCD language * Required LCD language
*/ */
#if !defined(DOGLCD) && defined(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780_JAPAN) && !defined(DISPLAY_CHARSET_HD44780_WESTERN) #if !defined(DOGLCD) && defined(ULTRA_LCD) && !defined(DISPLAY_CHARSET_HD44780_JAPAN) && !defined(DISPLAY_CHARSET_HD44780_WESTERN)&& !defined(DISPLAY_CHARSET_HD44780_CYRILLIC)
#error You must enable either DISPLAY_CHARSET_HD44780_JAPAN or DISPLAY_CHARSET_HD44780_WESTERN for your LCD controller. #error You must enable either DISPLAY_CHARSET_HD44780_JAPAN or DISPLAY_CHARSET_HD44780_WESTERN or DISPLAY_CHARSET_HD44780_CYRILLIC for your LCD controller.
#endif #endif
/** /**
......
...@@ -60,9 +60,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m ...@@ -60,9 +60,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
SdFile dir; SdFile dir;
if (!dir.open(parent, lfilename, O_READ)) { if (!dir.open(parent, lfilename, O_READ)) {
if (lsAction == LS_SerialPrint) { if (lsAction == LS_SerialPrint) {
SERIAL_ECHO_START; ECHO_LMV(ER, MSG_SD_CANT_OPEN_SUBDIR, lfilename);
SERIAL_ECHOLN(MSG_SD_CANT_OPEN_SUBDIR);
SERIAL_ECHOLN(lfilename);
} }
} }
lsDive(path, dir); lsDive(path, dir);
...@@ -84,8 +82,8 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m ...@@ -84,8 +82,8 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
//if (cnt++ != nr) continue; //if (cnt++ != nr) continue;
createFilename(filename, p); createFilename(filename, p);
if (lsAction == LS_SerialPrint) { if (lsAction == LS_SerialPrint) {
SERIAL_PROTOCOL(prepend); ECHO_V(prepend);
SERIAL_PROTOCOLLN(filename); ECHO_EV(filename);
} }
else if (lsAction == LS_Count) { else if (lsAction == LS_Count) {
nrFiles++; nrFiles++;
...@@ -122,35 +120,29 @@ void CardReader::initsd() { ...@@ -122,35 +120,29 @@ void CardReader::initsd() {
&& !card.init(SPI_SPEED, LCD_SDSS) && !card.init(SPI_SPEED, LCD_SDSS)
#endif #endif
) { ) {
//if (!card.init(SPI_HALF_SPEED,SDSS)) ECHO_LM(ER, MSG_SD_INIT_FAIL);
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM(MSG_SD_INIT_FAIL);
} }
else if (!volume.init(&card)) { else if (!volume.init(&card)) {
SERIAL_ERROR_START; ECHO_LM(ER, MSG_SD_VOL_INIT_FAIL);
SERIAL_ERRORLNPGM(MSG_SD_VOL_INIT_FAIL);
} }
else if (!root.openRoot(&volume)) { else if (!root.openRoot(&volume)) {
SERIAL_ERROR_START; ECHO_LM(ER, MSG_SD_OPENROOT_FAIL);
SERIAL_ERRORLNPGM(MSG_SD_OPENROOT_FAIL);
} }
else { else {
cardOK = true; cardOK = true;
SERIAL_ECHO_START; ECHO_LM(OK, MSG_SD_CARD_OK);
SERIAL_ECHOLNPGM(MSG_SD_CARD_OK);
} }
workDir = root; workDir = root;
curDir = &root; curDir = &root;
/*
if (!workDir.openRoot(&volume)) { /*if (!workDir.openRoot(&volume)) {
SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL); ECHO_EM(MSG_SD_WORKDIR_FAIL);
} }*/
*/
} }
void CardReader::setroot() { void CardReader::setroot() {
/*if (!workDir.openRoot(&volume)) { /*if (!workDir.openRoot(&volume)) {
SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL); ECHO_EM(MSG_SD_WORKDIR_FAIL);
}*/ }*/
workDir = root; workDir = root;
curDir = &workDir; curDir = &workDir;
...@@ -194,6 +186,7 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/, ...@@ -194,6 +186,7 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/,
if (file.isOpen()) { //replacing current file by new file, or subfile call if (file.isOpen()) { //replacing current file by new file, or subfile call
if (!replace_current) { if (!replace_current) {
if (file_subcall_ctr > SD_PROCEDURE_DEPTH - 1) { if (file_subcall_ctr > SD_PROCEDURE_DEPTH - 1) {
<<<<<<< HEAD
SERIAL_ERROR_START; SERIAL_ERROR_START;
SERIAL_ERRORPGM("trying to call sub-gcode files with too many levels. MAX level is:"); SERIAL_ERRORPGM("trying to call sub-gcode files with too many levels. MAX level is:");
SERIAL_ERRORLN(SD_PROCEDURE_DEPTH); SERIAL_ERRORLN(SD_PROCEDURE_DEPTH);
...@@ -218,14 +211,22 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/, ...@@ -218,14 +211,22 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/,
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOPGM("Now doing file: "); SERIAL_ECHOPGM("Now doing file: ");
SERIAL_ECHOLN(name); SERIAL_ECHOLN(name);
=======
ECHO_LMV(ER, MSG_SD_MAX_DEPTH, SD_PROCEDURE_DEPTH);
kill();
return;
}
//store current filename and position
getAbsFilename(filenames[file_subcall_ctr]);
filespos[file_subcall_ctr] = sdpos;
file_subcall_ctr++;
>>>>>>> origin/master
} }
file.close(); file.close();
} }
else { //opening fresh file else { //opening fresh file
file_subcall_ctr = 0; //resetting procedure depth in case user cancels print while in procedure file_subcall_ctr = 0; //resetting procedure depth in case user cancels print while in procedure
SERIAL_ECHO_START;
SERIAL_ECHOPGM("Now fresh file: ");
SERIAL_ECHOLN(name);
} }
sdprinting = false; sdprinting = false;
...@@ -238,30 +239,20 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/, ...@@ -238,30 +239,20 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/,
dirname_start = &name[1]; dirname_start = &name[1];
while(dirname_start > 0) { while(dirname_start > 0) {
dirname_end = strchr(dirname_start, '/'); dirname_end = strchr(dirname_start, '/');
//SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name));
//SERIAL_ECHO("end :");SERIAL_ECHOLN((int)(dirname_end - name));
if (dirname_end > 0 && dirname_end > dirname_start) { if (dirname_end > 0 && dirname_end > dirname_start) {
char subdirname[FILENAME_LENGTH]; char subdirname[FILENAME_LENGTH];
strncpy(subdirname, dirname_start, dirname_end - dirname_start); strncpy(subdirname, dirname_start, dirname_end - dirname_start);
subdirname[dirname_end - dirname_start] = 0; subdirname[dirname_end - dirname_start] = 0;
SERIAL_ECHOLN(subdirname);
if (!myDir.open(curDir, subdirname, O_READ)) { if (!myDir.open(curDir, subdirname, O_READ)) {
SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL); ECHO_LMV(ER, MSG_SD_OPEN_FILE_FAIL, subdirname);
SERIAL_PROTOCOL(subdirname);
SERIAL_PROTOCOLCHAR('.');
return; return;
} }
else {
//SERIAL_ECHOLN("dive ok");
}
curDir = &myDir; curDir = &myDir;
dirname_start = dirname_end + 1; dirname_start = dirname_end + 1;
} }
else { // the remainder after all /fsa/fdsa/ is the filename else { // the remainder after all /fsa/fdsa/ is the filename
fname = dirname_start; fname = dirname_start;
//SERIAL_ECHOLN("remainder");
//SERIAL_ECHOLN(fname);
break; break;
} }
} }
...@@ -273,25 +264,20 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/, ...@@ -273,25 +264,20 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/,
if (read) { if (read) {
if (file.open(curDir, fname, O_READ)) { if (file.open(curDir, fname, O_READ)) {
filesize = file.fileSize(); filesize = file.fileSize();
SERIAL_PROTOCOLPGM(MSG_SD_FILE_OPENED); ECHO_SMV(OK,MSG_SD_FILE_OPENED, fname);
SERIAL_PROTOCOL(fname); ECHO_EMV(MSG_SD_SIZE, filesize);
SERIAL_PROTOCOLPGM(MSG_SD_SIZE);
SERIAL_PROTOCOLLN(filesize);
sdpos = 0; sdpos = 0;
SERIAL_PROTOCOLLNPGM(MSG_SD_FILE_SELECTED);
getfilename(0, fname); getfilename(0, fname);
if(lcd_status) lcd_setstatus(longFilename[0] ? longFilename : fname); if(lcd_status) lcd_setstatus(longFilename[0] ? longFilename : fname);
} }
else { else {
SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL); ECHO_LMV(ER,MSG_SD_OPEN_FILE_FAIL,fname);
SERIAL_PROTOCOL(fname);
SERIAL_PROTOCOLCHAR('.');
} }
} }
else { //write else { //write
if (file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) { if (file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) {
saving = true; saving = true;
<<<<<<< HEAD
SERIAL_PROTOCOLPGM(MSG_SD_WRITE_TO_FILE); SERIAL_PROTOCOLPGM(MSG_SD_WRITE_TO_FILE);
SERIAL_PROTOCOLLN(name); SERIAL_PROTOCOLLN(name);
if(lcd_status) lcd_setstatus(fname); if(lcd_status) lcd_setstatus(fname);
...@@ -300,6 +286,13 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/, ...@@ -300,6 +286,13 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/,
SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL);
SERIAL_PROTOCOL(fname); SERIAL_PROTOCOL(fname);
SERIAL_PROTOCOLCHAR('.'); SERIAL_PROTOCOLCHAR('.');
=======
ECHO_LMV(OK, MSG_SD_WRITE_TO_FILE, name);
if(lcd_status) lcd_setstatus(fname);
}
else {
ECHO_LMV(ER, MSG_SD_OPEN_FILE_FAIL,fname);
>>>>>>> origin/master
} }
} }
} }
...@@ -319,30 +312,20 @@ void CardReader::removeFile(char* name) { ...@@ -319,30 +312,20 @@ void CardReader::removeFile(char* name) {
dirname_start = strchr(name, '/') + 1; dirname_start = strchr(name, '/') + 1;
while (dirname_start > 0) { while (dirname_start > 0) {
dirname_end = strchr(dirname_start, '/'); dirname_end = strchr(dirname_start, '/');
//SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name));
//SERIAL_ECHO("end :");SERIAL_ECHOLN((int)(dirname_end - name));
if (dirname_end > 0 && dirname_end > dirname_start) { if (dirname_end > 0 && dirname_end > dirname_start) {
char subdirname[FILENAME_LENGTH]; char subdirname[FILENAME_LENGTH];
strncpy(subdirname, dirname_start, dirname_end - dirname_start); strncpy(subdirname, dirname_start, dirname_end - dirname_start);
subdirname[dirname_end - dirname_start] = 0; subdirname[dirname_end - dirname_start] = 0;
SERIAL_ECHOLN(subdirname);
if (!myDir.open(curDir, subdirname, O_READ)) { if (!myDir.open(curDir, subdirname, O_READ)) {
SERIAL_PROTOCOLPGM("open failed, File: "); ECHO_LMV(ER, MSG_SD_OPEN_FILE_FAIL, subdirname);
SERIAL_PROTOCOL(subdirname);
SERIAL_PROTOCOLCHAR('.');
return; return;
} }
else {
//SERIAL_ECHOLN("dive ok");
}
curDir = &myDir; curDir = &myDir;
dirname_start = dirname_end + 1; dirname_start = dirname_end + 1;
} }
else { // the remainder after all /fsa/fdsa/ is the filename else { // the remainder after all /fsa/fdsa/ is the filename
fname = dirname_start; fname = dirname_start;
//SERIAL_ECHOLN("remainder");
//SERIAL_ECHOLN(fname);
break; break;
} }
} }
...@@ -352,26 +335,21 @@ void CardReader::removeFile(char* name) { ...@@ -352,26 +335,21 @@ void CardReader::removeFile(char* name) {
} }
if (file.remove(curDir, fname)) { if (file.remove(curDir, fname)) {
SERIAL_PROTOCOLPGM("File deleted:"); ECHO_LMV(OK, MSG_SD_FILE_DELETED, fname);
SERIAL_PROTOCOLLN(fname);
sdpos = 0; sdpos = 0;
} }
else { else {
SERIAL_PROTOCOLPGM("Deletion failed, File: "); ECHO_LMV(ER, MSG_SD_FILE_DELETION_ERR,fname);
SERIAL_PROTOCOL(fname);
SERIAL_PROTOCOLCHAR('.');
} }
} }
void CardReader::getStatus() { void CardReader::getStatus() {
if (cardOK) { if (cardOK) {
SERIAL_PROTOCOLPGM(MSG_SD_PRINTING_BYTE); ECHO_SMV(OK, MSG_SD_PRINTING_BYTE, sdpos);
SERIAL_PROTOCOL(sdpos); ECHO_EMV(MSG_SD_SLASH, filesize);
SERIAL_PROTOCOLCHAR('/');
SERIAL_PROTOCOLLN(filesize);
} }
else { else {
SERIAL_PROTOCOLLNPGM(MSG_SD_NOT_PRINTING); ECHO_LM(OK, MSG_SD_NOT_PRINTING);
} }
} }
...@@ -390,8 +368,7 @@ void CardReader::write_command(char *buf) { ...@@ -390,8 +368,7 @@ void CardReader::write_command(char *buf) {
end[3] = '\0'; end[3] = '\0';
file.write(begin); file.write(begin);
if (file.writeError) { if (file.writeError) {
SERIAL_ERROR_START; ECHO_LM(ER, MSG_SD_ERR_WRITE_TO_FILE);
SERIAL_ERRORLNPGM(MSG_SD_ERR_WRITE_TO_FILE);
} }
} }
...@@ -530,6 +507,103 @@ void CardReader::unparseKeyLine(const char *key, char *value) { ...@@ -530,6 +507,103 @@ void CardReader::unparseKeyLine(const char *key, char *value) {
} }
} }
/**
* File parser for KEY->VALUE format from files
*
* Author: Simone Primarosa
*
*/
void CardReader::parseKeyLine(char *key, char *value, int &len_k, int &len_v) {
if (!cardOK || !isFileOpen()) {
key[0] = value[0] = '\0';
len_k = len_v = 0;
return;
}
int ln_buf = 0;
char ln_char;
bool ln_space = false, ln_ignore = false, key_found = false;
while(!eof()) { //READ KEY
ln_char = (char)get();
if(ln_char == '\n') {
ln_buf = 0;
ln_ignore = false; //We've reached a new line try to find a key again
continue;
}
if(ln_ignore) continue;
if(ln_char == ' ') {
ln_space = true;
continue;
}
if(ln_char == '=') {
key[ln_buf] = '\0';
len_k = ln_buf;
key_found = true;
break; //key finded and buffered
}
if(ln_char == ';' || ln_buf+1 >= len_k || ln_space && ln_buf > 0) { //comments on key is not allowd. Also key len can't be longer than len_k or contain spaces. Stop buffering and try the next line
ln_ignore = true;
continue;
}
ln_space = false;
key[ln_buf] = ln_char;
ln_buf++;
}
if(!key_found) { //definitly there isn't no more key that can be readed in the file
key[0] = value[0] = '\0';
len_k = len_v = 0;
return;
}
ln_buf = 0;
ln_ignore = false;
while(!eof()) { //READ VALUE
ln_char = (char)get();
if(ln_char == '\n') {
value[ln_buf] = '\0';
len_v = ln_buf;
break; //new line reached, we can stop
}
if(ln_ignore|| ln_char == ' ' && ln_buf == 0) continue; //ignore also initial spaces of the value
if(ln_char == ';' || ln_buf+1 >= len_v) { //comments reached or value len longer than len_v. Stop buffering and go to the next line.
ln_ignore = true;
continue;
}
value[ln_buf] = ln_char;
ln_buf++;
}
}
void CardReader::unparseKeyLine(const char *key, char *value) {
if (!cardOK || !isFileOpen()) return;
file.writeError = false;
file.write(key);
if (file.writeError) {
ECHO_LM(ER, MSG_SD_ERR_WRITE_TO_FILE);
return;
}
file.writeError = false;
file.write("=");
if (file.writeError) {
ECHO_LM(ER, MSG_SD_ERR_WRITE_TO_FILE);
return;
}
file.writeError = false;
file.write(value);
if (file.writeError) {
ECHO_LM(ER, MSG_SD_ERR_WRITE_TO_FILE);
return;
}
file.writeError = false;
file.write("\n");
if (file.writeError) {
ECHO_LM(ER, MSG_SD_ERR_WRITE_TO_FILE);
return;
}
}
/** /**
* Get the name of a file in the current directory by index * Get the name of a file in the current directory by index
*/ */
...@@ -547,7 +621,6 @@ uint16_t CardReader::getnrfilenames() { ...@@ -547,7 +621,6 @@ uint16_t CardReader::getnrfilenames() {
nrFiles = 0; nrFiles = 0;
curDir->rewind(); curDir->rewind();
lsDive("", *curDir); lsDive("", *curDir);
//SERIAL_ECHOLN(nrFiles);
return nrFiles; return nrFiles;
} }
...@@ -557,24 +630,22 @@ void CardReader::chdir(const char * relpath) { ...@@ -557,24 +630,22 @@ void CardReader::chdir(const char * relpath) {
if (workDir.isOpen()) parent = &workDir; if (workDir.isOpen()) parent = &workDir;
if (!newfile.open(*parent, relpath, O_READ)) { if (newfile.open(*parent, relpath, O_READ)) {
SERIAL_ECHO_START;
SERIAL_ECHOPGM(MSG_SD_CANT_ENTER_SUBDIR);
SERIAL_ECHOLN(relpath);
}
else {
if (workDirDepth < MAX_DIR_DEPTH) { if (workDirDepth < MAX_DIR_DEPTH) {
++workDirDepth; workDirDepth++;
for (int d = workDirDepth; d--;) workDirParents[d + 1] = workDirParents[d]; for (int d = workDirDepth; d--;) workDirParents[d + 1] = workDirParents[d];
workDirParents[0] = *parent; workDirParents[0] = *parent;
} }
workDir = newfile; workDir = newfile;
} }
else {
ECHO_LMV(ER, MSG_SD_CANT_ENTER_SUBDIR, relpath);
}
} }
void CardReader::updir() { void CardReader::updir() {
if (workDirDepth > 0) { if (workDirDepth > 0) {
--workDirDepth; workDirDepth--;
workDir = workDirParents[0]; workDir = workDirParents[0];
for (uint16_t d = 0; d < workDirDepth; d++) for (uint16_t d = 0; d < workDirDepth; d++)
workDirParents[d] = workDirParents[d+1]; workDirParents[d] = workDirParents[d+1];
......
...@@ -18,10 +18,17 @@ public: ...@@ -18,10 +18,17 @@ 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 //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 checkautostart(bool x);
<<<<<<< HEAD
void openFile(char* name,bool read,bool replace_current=true, bool lcd_status=true); void openFile(char* name,bool read,bool replace_current=true, bool lcd_status=true);
void openLogFile(char* name); void openLogFile(char* name);
void removeFile(char* name); void removeFile(char* name);
void closeFile(bool store_location=false); void closeFile(bool store_location=false);
=======
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);
>>>>>>> origin/master
void parseKeyLine(char *key, char *value, int &len_k, int &len_v); void parseKeyLine(char *key, char *value, int &len_k, int &len_v);
void unparseKeyLine(const char *key, char *value); void unparseKeyLine(const char *key, char *value);
void release(); void release();
...@@ -30,7 +37,7 @@ public: ...@@ -30,7 +37,7 @@ public:
void getStatus(); void getStatus();
void printingHasFinished(); 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(); uint16_t getnrfilenames();
void getAbsFilename(char *t); void getAbsFilename(char *t);
......
...@@ -192,7 +192,7 @@ static void lcd_implementation_init() { ...@@ -192,7 +192,7 @@ static void lcd_implementation_init() {
#elif defined(LCD_SCREEN_ROT_270) #elif defined(LCD_SCREEN_ROT_270)
u8g.setRot270(); // Rotate screen by 270° u8g.setRot270(); // Rotate screen by 270°
#endif #endif
// Show splashscreen // Show splashscreen
int offx = (u8g.getWidth() - START_BMPWIDTH) / 2; int offx = (u8g.getWidth() - START_BMPWIDTH) / 2;
#ifdef START_BMPHIGH #ifdef START_BMPHIGH
......
...@@ -14,225 +14,224 @@ static char serial_answer; ...@@ -14,225 +14,224 @@ static char serial_answer;
void FirmwareTest() void FirmwareTest()
{ {
SERIAL_ECHOLN("---------- FIRMWARE TEST --------------"); ECHO_EM("---------- FIRMWARE TEST --------------");
SERIAL_ECHOLN("--------- by MarlinKimbra -------------"); ECHO_EM("--------- by MarlinKimbra -------------");
SERIAL_ECHOLN(" "); ECHO_EV(MSG_FWTEST_01);
SERIAL_ECHOLN(MSG_FWTEST_01); ECHO_EV(MSG_FWTEST_02);
SERIAL_ECHOLN(MSG_FWTEST_02); ECHO_EV(MSG_FWTEST_YES_NO);
SERIAL_ECHOLN(MSG_FWTEST_YES_NO);
serial_answer = ' '; serial_answer = ' ';
while(serial_answer!='y' && serial_answer!='Y' && serial_answer!='n' && serial_answer!='N') { while(serial_answer!='y' && serial_answer!='Y' && serial_answer!='n' && serial_answer!='N') {
serial_answer = MYSERIAL.read(); serial_answer = MYSERIAL.read();
} }
if (serial_answer=='y' || serial_answer=='Y') { if (serial_answer=='y' || serial_answer=='Y') {
SERIAL_ECHOLN(MSG_FWTEST_03); ECHO_EV(MSG_FWTEST_03);
SERIAL_ECHOLN(" "); ECHO_EM(" ");
SERIAL_ECHOLN("***** ENDSTOP X *****"); ECHO_EM("***** ENDSTOP X *****");
#if defined(X_MIN_PIN) && X_MIN_PIN > -1 && X_HOME_DIR == -1 #if defined(X_MIN_PIN) && X_MIN_PIN > -1 && X_HOME_DIR == -1
if (!READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING) { if (!READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING) {
SERIAL_ECHO("MIN ENDSTOP X: "); ECHO_M("MIN ENDSTOP X: ");
SERIAL_ECHOLN(MSG_ENDSTOP_OPEN); ECHO_EV(MSG_ENDSTOP_OPEN);
} }
else else
{ {
SERIAL_ECHOLN("X ENDSTOP ERROR"); ECHO_EM("X ENDSTOP ERROR");
SERIAL_ECHO(MSG_FWTEST_INVERT); ECHO_V(MSG_FWTEST_INVERT);
SERIAL_ECHOLN("#define X_MIN_ENDSTOP_INVERTING"); ECHO_EM("#define X_MIN_ENDSTOP_INVERTING");
return; return;
} }
SERIAL_ECHO(MSG_FWTEST_PRESS); ECHO_V(MSG_FWTEST_PRESS);
SERIAL_ECHOLN("X"); ECHO_EM("X");
SERIAL_ECHOLN(MSG_FWTEST_YES); ECHO_EV(MSG_FWTEST_YES);
serial_answer = ' '; serial_answer = ' ';
while(serial_answer!='y' && serial_answer!='Y' && !(READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING)){ while(serial_answer!='y' && serial_answer!='Y' && !(READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING)){
serial_answer = MYSERIAL.read(); serial_answer = MYSERIAL.read();
} }
if (READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING) { if (READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING) {
SERIAL_ECHO("MIN ENDSTOP X: "); ECHO_M("MIN ENDSTOP X: ");
SERIAL_ECHOLN(MSG_ENDSTOP_HIT); ECHO_EV(MSG_ENDSTOP_HIT);
} }
else else
{ {
SERIAL_ECHO("X "); ECHO_M("X ");
SERIAL_ECHOLN(MSG_FWTEST_ENDSTOP_ERR); ECHO_EV(MSG_FWTEST_ENDSTOP_ERR);
return; return;
} }
#elif defined(X_MAX_PIN) && X_MAX_PIN > -1 && X_HOME_DIR == 1 #elif defined(X_MAX_PIN) && X_MAX_PIN > -1 && X_HOME_DIR == 1
if (!READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING) { if (!READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING) {
SERIAL_ECHO("MAX ENDSTOP X: "); ECHO_M("MAX ENDSTOP X: ");
SERIAL_ECHOLN(MSG_ENDSTOP_OPEN); ECHO_EV(MSG_ENDSTOP_OPEN);
} }
else else
{ {
SERIAL_ECHOLN("X ENDSTOP ERROR"); ECHO_EM("X ENDSTOP ERROR");
SERIAL_ECHO(MSG_FWTEST_INVERT); ECHO_V(MSG_FWTEST_INVERT);
SERIAL_ECHOLN("#define X_MAX_ENDSTOP_INVERTING"); ECHO_EM("#define X_MAX_ENDSTOP_INVERTING");
return; return;
} }
SERIAL_ECHO(MSG_FWTEST_PRESS); ECHO_V(MSG_FWTEST_PRESS);
SERIAL_ECHOLN("X"); ECHO_EM("X");
SERIAL_ECHOLN(MSG_FWTEST_YES); ECHO_EV(MSG_FWTEST_YES);
serial_answer = ' '; serial_answer = ' ';
while(serial_answer!='y' && serial_answer!='Y' && !(READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING)) { while(serial_answer!='y' && serial_answer!='Y' && !(READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING)) {
serial_answer = MYSERIAL.read(); serial_answer = MYSERIAL.read();
} }
if (READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING) { if (READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING) {
SERIAL_ECHO("MAX ENDSTOP X: "); ECHO_M("MAX ENDSTOP X: ");
SERIAL_ECHOLN(MSG_ENDSTOP_HIT); ECHO_EV(MSG_ENDSTOP_HIT);
} }
else else
{ {
SERIAL_ECHO("X "); ECHO_M("X ");
SERIAL_ECHOLN(MSG_FWTEST_ENDSTOP_ERR); ECHO_EV(MSG_FWTEST_ENDSTOP_ERR);
return; return;
} }
#elif X_HOME_DIR == -1 #elif X_HOME_DIR == -1
SERIAL_ECHOLN("ERROR!!! X_MIN_PIN not defined"); ECHO_EM("ERROR!!! X_MIN_PIN not defined");
return; return;
#elif X_HOME_DIR == 1 #elif X_HOME_DIR == 1
SERIAL_ECHOLN("ERROR!!! X_MAX_PIN not defined"); ECHO_EM("ERROR!!! X_MAX_PIN not defined");
return; return;
#endif #endif
SERIAL_ECHOLN(" "); ECHO_EM(" ");
SERIAL_ECHOLN("***** ENDSTOP Y *****"); ECHO_EM("***** ENDSTOP Y *****");
#if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 && Y_HOME_DIR == -1 #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 && Y_HOME_DIR == -1
if (!READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ if (!READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){
SERIAL_ECHO("MIN ENDSTOP Y: "); ECHO_M("MIN ENDSTOP Y: ");
SERIAL_ECHOLN(MSG_ENDSTOP_OPEN); ECHO_EV(MSG_ENDSTOP_OPEN);
} }
else else
{ {
SERIAL_ECHOLN("Y ENDSTOP ERROR"); ECHO_EM("Y ENDSTOP ERROR");
SERIAL_ECHO(MSG_FWTEST_INVERT); ECHO_V(MSG_FWTEST_INVERT);
SERIAL_ECHOLN("#define Y_MIN_ENDSTOP_INVERTING"); ECHO_EM("#define Y_MIN_ENDSTOP_INVERTING");
return; return;
} }
SERIAL_ECHO(MSG_FWTEST_PRESS); ECHO_V(MSG_FWTEST_PRESS);
SERIAL_ECHOLN("Y"); ECHO_EM("Y");
SERIAL_ECHOLN(MSG_FWTEST_YES); ECHO_EV(MSG_FWTEST_YES);
serial_answer = ' '; serial_answer = ' ';
while(serial_answer!='y' && serial_answer!='Y' && !(READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING)){ while(serial_answer!='y' && serial_answer!='Y' && !(READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING)){
serial_answer = MYSERIAL.read(); serial_answer = MYSERIAL.read();
} }
if (READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ if (READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){
SERIAL_ECHO("MIN ENDSTOP Y: "); ECHO_M("MIN ENDSTOP Y: ");
SERIAL_ECHOLN(MSG_ENDSTOP_HIT); ECHO_EV(MSG_ENDSTOP_HIT);
} }
else else
{ {
SERIAL_ECHO("Y "); ECHO_M("Y ");
SERIAL_ECHOLN(MSG_FWTEST_ENDSTOP_ERR); ECHO_EV(MSG_FWTEST_ENDSTOP_ERR);
return; return;
} }
#elif defined(Y_MAX_PIN) && Y_MAX_PIN > -1 && Y_HOME_DIR == 1 #elif defined(Y_MAX_PIN) && Y_MAX_PIN > -1 && Y_HOME_DIR == 1
if (!READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING){ if (!READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING){
SERIAL_ECHO("MAX ENDSTOP Y: "); ECHO_M("MAX ENDSTOP Y: ");
SERIAL_ECHOLN(MSG_ENDSTOP_OPEN); ECHO_EV(MSG_ENDSTOP_OPEN);
} }
else else
{ {
SERIAL_ECHOLN("Y ENDSTOP ERROR"); ECHO_EM("Y ENDSTOP ERROR");
SERIAL_ECHO(MSG_FWTEST_INVERT); ECHO_V(MSG_FWTEST_INVERT);
SERIAL_ECHOLN("#define Y_MAX_ENDSTOP_INVERTING"); ECHO_EM("#define Y_MAX_ENDSTOP_INVERTING");
return; return;
} }
SERIAL_ECHO(MSG_FWTEST_PRESS); ECHO_V(MSG_FWTEST_PRESS);
SERIAL_ECHOLN("Y"); ECHO_EM("Y");
SERIAL_ECHOLN(MSG_FWTEST_YES); ECHO_EV(MSG_FWTEST_YES);
serial_answer = ' '; serial_answer = ' ';
while(serial_answer!='y' && serial_answer!='Y' && !(READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING)){ while(serial_answer!='y' && serial_answer!='Y' && !(READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING)){
serial_answer = MYSERIAL.read(); serial_answer = MYSERIAL.read();
} }
if (READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING){ if (READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING){
SERIAL_ECHO("MAX ENDSTOP Y: "); ECHO_M("MAX ENDSTOP Y: ");
SERIAL_ECHOLN(MSG_ENDSTOP_HIT); ECHO_EV(MSG_ENDSTOP_HIT);
} }
else else
{ {
SERIAL_ECHO("Y "); ECHO_M("Y ");
SERIAL_ECHOLN(MSG_FWTEST_ENDSTOP_ERR); ECHO_EV(MSG_FWTEST_ENDSTOP_ERR);
return; return;
} }
#elif Y_HOME_DIR == -1 #elif Y_HOME_DIR == -1
SERIAL_ECHOLN("ERROR!!! Y_MIN_PIN not defined"); ECHO_EM("ERROR!!! Y_MIN_PIN not defined");
return; return;
#elif Y_HOME_DIR == 1 #elif Y_HOME_DIR == 1
SERIAL_ECHOLN("ERROR!!! Y_MAX_PIN not defined"); ECHO_EM("ERROR!!! Y_MAX_PIN not defined");
return; return;
#endif #endif
SERIAL_ECHOLN(" "); ECHO_EM(" ");
SERIAL_ECHOLN("***** ENDSTOP Z *****"); ECHO_EM("***** ENDSTOP Z *****");
#if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 && Z_HOME_DIR == -1 #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 && Z_HOME_DIR == -1
if (!READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ if (!READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){
SERIAL_ECHO("MIN ENDSTOP Z: "); ECHO_M("MIN ENDSTOP Z: ");
SERIAL_ECHOLN(MSG_ENDSTOP_OPEN); ECHO_EV(MSG_ENDSTOP_OPEN);
} }
else else
{ {
SERIAL_ECHOLN("Z ENDSTOP ERROR"); ECHO_EM("Z ENDSTOP ERROR");
SERIAL_ECHO(MSG_FWTEST_INVERT); ECHO_V(MSG_FWTEST_INVERT);
SERIAL_ECHOLN("#define Z_MIN_ENDSTOP_INVERTING"); ECHO_EM("#define Z_MIN_ENDSTOP_INVERTING");
return; return;
} }
SERIAL_ECHO(MSG_FWTEST_PRESS); ECHO_V(MSG_FWTEST_PRESS);
SERIAL_ECHOLN("Z"); ECHO_EM("Z");
SERIAL_ECHOLN(MSG_FWTEST_YES); ECHO_EV(MSG_FWTEST_YES);
serial_answer = ' '; serial_answer = ' ';
while(serial_answer!='y' && serial_answer!='Y' && !(READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING)){ while(serial_answer!='y' && serial_answer!='Y' && !(READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING)){
serial_answer = MYSERIAL.read(); serial_answer = MYSERIAL.read();
} }
if (READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ if (READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){
SERIAL_ECHO("MIN ENDSTOP Z: "); ECHO_M("MIN ENDSTOP Z: ");
SERIAL_ECHOLN(MSG_ENDSTOP_HIT); ECHO_EV(MSG_ENDSTOP_HIT);
} }
else else
{ {
SERIAL_ECHO("Z "); ECHO_M("Z ");
SERIAL_ECHOLN(MSG_FWTEST_ENDSTOP_ERR); ECHO_EV(MSG_FWTEST_ENDSTOP_ERR);
return; return;
} }
#elif defined(Z_MAX_PIN) && Z_MAX_PIN > -1 && Z_HOME_DIR == 1 #elif defined(Z_MAX_PIN) && Z_MAX_PIN > -1 && Z_HOME_DIR == 1
if (!READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ if (!READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){
SERIAL_ECHO("MAX ENDSTOP Z: "); ECHO_M("MAX ENDSTOP Z: ");
SERIAL_ECHOLN(MSG_ENDSTOP_OPEN); ECHO_EV(MSG_ENDSTOP_OPEN);
} }
else else
{ {
SERIAL_ECHOLN("Z ENDSTOP ERROR"); ECHO_EM("Z ENDSTOP ERROR");
SERIAL_ECHO(MSG_FWTEST_INVERT); ECHO_V(MSG_FWTEST_INVERT);
SERIAL_ECHOLN("#define Z_MAX_ENDSTOP_INVERTING"); ECHO_EM("#define Z_MAX_ENDSTOP_INVERTING");
return; return;
} }
SERIAL_ECHO(MSG_FWTEST_PRESS); ECHO_V(MSG_FWTEST_PRESS);
SERIAL_ECHOLN("Z"); ECHO_EM("Z");
SERIAL_ECHOLN(MSG_FWTEST_YES); ECHO_EV(MSG_FWTEST_YES);
serial_answer = ' '; serial_answer = ' ';
while(serial_answer!='y' && serial_answer!='Y' && !(READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING)){ while(serial_answer!='y' && serial_answer!='Y' && !(READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING)){
serial_answer = MYSERIAL.read(); serial_answer = MYSERIAL.read();
} }
if (READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ if (READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){
SERIAL_ECHO("MAX ENDSTOP Z: "); ECHO_M("MAX ENDSTOP Z: ");
SERIAL_ECHOLN(MSG_ENDSTOP_HIT); ECHO_EV(MSG_ENDSTOP_HIT);
} }
else else
{ {
SERIAL_ECHO("Z "); ECHO_M("Z ");
SERIAL_ECHOLN(MSG_FWTEST_ENDSTOP_ERR); ECHO_EV(MSG_FWTEST_ENDSTOP_ERR);
return; return;
} }
#elif Z_HOME_DIR == -1 #elif Z_HOME_DIR == -1
SERIAL_ECHOLN("ERROR!!! Z_MIN_PIN not defined"); ECHO_EM("ERROR!!! Z_MIN_PIN not defined");
return; return;
#elif Z_HOME_DIR == 1 #elif Z_HOME_DIR == 1
SERIAL_ECHOLN("ERROR!!! Z_MAX_PIN not defined"); ECHO_EM("ERROR!!! Z_MAX_PIN not defined");
return; return;
#endif #endif
SERIAL_ECHOLN("ENDSTOP OK"); ECHO_EM("ENDSTOP OK");
SERIAL_ECHOLN(" "); ECHO_EM(" ");
} }
#if HAS_POWER_SWITCH #if HAS_POWER_SWITCH
...@@ -245,76 +244,76 @@ void FirmwareTest() ...@@ -245,76 +244,76 @@ void FirmwareTest()
for(int8_t i=0; i < NUM_AXIS; i++) current_position[i] = 0; for(int8_t i=0; i < NUM_AXIS; i++) current_position[i] = 0;
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
SERIAL_ECHOLN("***** TEST MOTOR *****"); ECHO_EM("***** TEST MOTOR *****");
SERIAL_ECHOLN(MSG_FWTEST_ATTENTION); ECHO_EV(MSG_FWTEST_ATTENTION);
SERIAL_ECHOLN(MSG_FWTEST_YES); ECHO_EV(MSG_FWTEST_YES);
serial_answer = ' '; serial_answer = ' ';
while(serial_answer!='y' && serial_answer!='Y'){ while(serial_answer!='y' && serial_answer!='Y'){
serial_answer = MYSERIAL.read(); serial_answer = MYSERIAL.read();
} }
SERIAL_ECHOLN(MSG_FWTEST_04); ECHO_EV(MSG_FWTEST_04);
SERIAL_ECHOLN(" "); ECHO_EM(" ");
SERIAL_ECHOLN("***** MOTOR X *****"); ECHO_EM("***** MOTOR X *****");
destination[X_AXIS] = 10; destination[X_AXIS] = 10;
prepare_move(); prepare_move();
st_synchronize(); st_synchronize();
SERIAL_ECHOLN(MSG_FWTEST_XAXIS); ECHO_EV(MSG_FWTEST_XAXIS);
SERIAL_ECHOLN(MSG_FWTEST_YES_NO); ECHO_EV(MSG_FWTEST_YES_NO);
serial_answer = ' '; serial_answer = ' ';
while(serial_answer!='y' && serial_answer!='Y' && serial_answer!='n' && serial_answer!='N'){ while(serial_answer!='y' && serial_answer!='Y' && serial_answer!='n' && serial_answer!='N'){
serial_answer = MYSERIAL.read(); serial_answer = MYSERIAL.read();
} }
if(serial_answer=='y' || serial_answer=='Y'){ if(serial_answer=='y' || serial_answer=='Y'){
SERIAL_ECHOLN("MOTOR X OK"); ECHO_EM("MOTOR X OK");
} }
else else
{ {
SERIAL_ECHO(MSG_FWTEST_INVERT); ECHO_V(MSG_FWTEST_INVERT);
SERIAL_ECHOLN("#define INVERT_X_DIR"); ECHO_EM("#define INVERT_X_DIR");
return; return;
} }
SERIAL_ECHOLN(" "); ECHO_EM(" ");
SERIAL_ECHOLN("***** MOTOR Y *****"); ECHO_EM("***** MOTOR Y *****");
destination[Y_AXIS] = 10; destination[Y_AXIS] = 10;
prepare_move(); prepare_move();
st_synchronize(); st_synchronize();
SERIAL_ECHOLN(MSG_FWTEST_YAXIS); ECHO_EV(MSG_FWTEST_YAXIS);
SERIAL_ECHOLN(MSG_FWTEST_YES_NO); ECHO_EV(MSG_FWTEST_YES_NO);
serial_answer = ' '; serial_answer = ' ';
while(serial_answer!='y' && serial_answer!='Y' && serial_answer!='n' && serial_answer!='N'){ while(serial_answer!='y' && serial_answer!='Y' && serial_answer!='n' && serial_answer!='N'){
serial_answer = MYSERIAL.read(); serial_answer = MYSERIAL.read();
} }
if(serial_answer=='y' || serial_answer=='Y'){ if(serial_answer=='y' || serial_answer=='Y'){
SERIAL_ECHOLN("MOTOR Y OK"); ECHO_EM("MOTOR Y OK");
} }
else else
{ {
SERIAL_ECHO(MSG_FWTEST_INVERT); ECHO_V(MSG_FWTEST_INVERT);
SERIAL_ECHOLN("#define INVERT_Y_DIR"); ECHO_EM("#define INVERT_Y_DIR");
return; return;
} }
SERIAL_ECHOLN(" "); ECHO_EM(" ");
SERIAL_ECHOLN("***** MOTOR Z *****"); ECHO_EM("***** MOTOR Z *****");
destination[Z_AXIS] = 10; destination[Z_AXIS] = 10;
prepare_move(); prepare_move();
st_synchronize(); st_synchronize();
SERIAL_ECHOLN(MSG_FWTEST_ZAXIS); ECHO_EV(MSG_FWTEST_ZAXIS);
SERIAL_ECHOLN(MSG_FWTEST_YES_NO); ECHO_EV(MSG_FWTEST_YES_NO);
serial_answer = ' '; serial_answer = ' ';
while(serial_answer!='y' && serial_answer!='Y' && serial_answer!='n' && serial_answer!='N'){ while(serial_answer!='y' && serial_answer!='Y' && serial_answer!='n' && serial_answer!='N'){
serial_answer = MYSERIAL.read(); serial_answer = MYSERIAL.read();
} }
if(serial_answer=='y' || serial_answer=='Y'){ if(serial_answer=='y' || serial_answer=='Y'){
SERIAL_ECHOLN("MOTOR Z OK"); ECHO_EM("MOTOR Z OK");
} }
else else
{ {
SERIAL_ECHO(MSG_FWTEST_INVERT); ECHO_V(MSG_FWTEST_INVERT);
SERIAL_ECHOLN("#define INVERT_Z_DIR"); ECHO_EM("#define INVERT_Z_DIR");
return; return;
} }
SERIAL_ECHOLN("MOTOR OK"); ECHO_EM("MOTOR OK");
SERIAL_ECHOLN(" "); ECHO_EM(" ");
SERIAL_ECHO(MSG_FWTEST_END); ECHO_V(MSG_FWTEST_END);
} }
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
// Serial Console Messages (do not translate those!) // Serial Console Messages (do not translate those!)
#define MSG_Enqueueing "enqueueing \"" #define MSG_ENQUEUEING "enqueueing \""
#define MSG_POWERUP "PowerUp" #define MSG_POWERUP "PowerUp"
#define MSG_EXTERNAL_RESET " External Reset" #define MSG_EXTERNAL_RESET " External Reset"
#define MSG_BROWNOUT_RESET " Brown out Reset" #define MSG_BROWNOUT_RESET " Brown out Reset"
...@@ -116,9 +116,10 @@ ...@@ -116,9 +116,10 @@
#define MSG_COUNT_X " Count X: " #define MSG_COUNT_X " Count X: "
#define MSG_ERR_KILLED "Printer halted. kill() called!" #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_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_UNKNOWN_COMMAND "Unknown command: \""
#define MSG_ACTIVE_DRIVER "Active Driver: "
#define MSG_ACTIVE_EXTRUDER "Active Extruder: " #define MSG_ACTIVE_EXTRUDER "Active Extruder: "
#define MSG_ACTIVE_COLOR "Active Color: "
#define MSG_INVALID_EXTRUDER "Invalid extruder" #define MSG_INVALID_EXTRUDER "Invalid extruder"
#define MSG_INVALID_SOLENOID "Invalid solenoid" #define MSG_INVALID_SOLENOID "Invalid solenoid"
#define MSG_X_MIN "x_min: " #define MSG_X_MIN "x_min: "
...@@ -152,6 +153,10 @@ ...@@ -152,6 +153,10 @@
#define MSG_SD_NOT_PRINTING "Not SD printing" #define MSG_SD_NOT_PRINTING "Not SD printing"
#define MSG_SD_ERR_WRITE_TO_FILE "error writing to file" #define MSG_SD_ERR_WRITE_TO_FILE "error writing to file"
#define MSG_SD_CANT_ENTER_SUBDIR "Cannot enter subdir: " #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_STEPPER_TOO_HIGH "Steprate too high: "
#define MSG_ENDSTOPS_HIT "endstops hit: " #define MSG_ENDSTOPS_HIT "endstops hit: "
...@@ -161,6 +166,17 @@ ...@@ -161,6 +166,17 @@
#define MSG_BABYSTEPPING_Y "Babystepping Y" #define MSG_BABYSTEPPING_Y "Babystepping Y"
#define MSG_BABYSTEPPING_Z "Babystepping Z" #define MSG_BABYSTEPPING_Z "Babystepping Z"
#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Error in menu structure" #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!" #define MSG_ERR_EEPROM_WRITE "Error writing to EEPROM!"
...@@ -181,26 +197,43 @@ ...@@ -181,26 +197,43 @@
#define MSG_KP " Kp: " #define MSG_KP " Kp: "
#define MSG_KI " Ki: " #define MSG_KI " Ki: "
#define MSG_KD " Kd: " #define MSG_KD " Kd: "
#define MSG_OK_B "ok B:" #define MSG_B " B:"
#define MSG_OK_T "ok T:" #define MSG_T " T:"
#define MSG_AT " @:" #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_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_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_EXTRUDER_SWITCHED_OFF "Extruder switched off. Temperature difference between temp sensors is too high !"
#define MSG_INVALID_EXTRUDER_NUM " - Invalid extruder number !" #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_SWITCHED_OFF_MAX " switched off. MAXTEMP triggered !!"
#define MSG_MINTEMP_EXTRUDER_OFF ": Extruder switched off. MINTEMP triggered !" #define MSG_MINTEMP_EXTRUDER_OFF ": Extruder switched off. MINTEMP triggered !"
#define MSG_MAXTEMP_EXTRUDER_OFF ": Extruder" MSG_SWITCHED_OFF_MAX #define MSG_MAXTEMP_EXTRUDER_OFF ": Extruder" MSG_SWITCHED_OFF_MAX
#define MSG_MAXTEMP_BED_OFF "Heated bed" 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 // LCD Menu Messages
#if !(defined( DISPLAY_CHARSET_HD44780_JAPAN ) || defined( DISPLAY_CHARSET_HD44780_WESTERN ) || defined( DISPLAY_CHARSET_HD44780_CYRILLIC )) #if !(defined( DISPLAY_CHARSET_HD44780_JAPAN ) || defined( DISPLAY_CHARSET_HD44780_WESTERN ) || defined( DISPLAY_CHARSET_HD44780_CYRILLIC ))
......
...@@ -151,6 +151,11 @@ ...@@ -151,6 +151,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA #endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset" #define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration" #define MSG_CONFIG "Configuration"
#define MSG_E_BOWDEN_LENGTH "Extrude " STRINGIFY(BOWDEN_LENGTH) "mm" #define MSG_E_BOWDEN_LENGTH "Extrude " STRINGIFY(BOWDEN_LENGTH) "mm"
......
...@@ -152,6 +152,11 @@ ...@@ -152,6 +152,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA #endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset" #define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration" #define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate" #define MSG_BAUDRATE "Baudrate"
......
...@@ -150,6 +150,11 @@ ...@@ -150,6 +150,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA #endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset" #define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration" #define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate" #define MSG_BAUDRATE "Baudrate"
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
#define MSG_TEMPERATURE "Temperature" #define MSG_TEMPERATURE "Temperature"
#define MSG_MOTION "Motion" #define MSG_MOTION "Motion"
#define MSG_VOLUMETRIC "Filament" #define MSG_VOLUMETRIC "Filament"
#define MSG_VOLUMETRIC_ENABLED E in mm3" #define MSG_VOLUMETRIC_ENABLED "E in mm3"
#define MSG_FILAMENT_SIZE_EXTRUDER "Fil. Dia." #define MSG_FILAMENT_SIZE_EXTRUDER "Fil. Dia."
#define MSG_CONTRAST "LCD contrast" #define MSG_CONTRAST "LCD contrast"
#define MSG_STORE_EPROM "Store memory" #define MSG_STORE_EPROM "Store memory"
...@@ -142,7 +142,8 @@ ...@@ -142,7 +142,8 @@
#define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Y "Babystep Y"
#define MSG_BABYSTEP_Z "Babystep Z" #define MSG_BABYSTEP_Z "Babystep Z"
#define MSG_ENDSTOP_ABORT "Endstop abort" #define MSG_ENDSTOP_ABORT "Endstop abort"
#define MSG_END_HOUR "hours"
#define MSG_END_MINUTE "minutes"
#define MSG_HEATING_FAILED_LCD "Heating failed" #define MSG_HEATING_FAILED_LCD "Heating failed"
#define MSG_ERR_REDUNDANT_TEMP "Err: REDUNDANT TEMP ERROR" #define MSG_ERR_REDUNDANT_TEMP "Err: REDUNDANT TEMP ERROR"
#define MSG_THERMAL_RUNAWAY "THERMAL RUNAWAY" #define MSG_THERMAL_RUNAWAY "THERMAL RUNAWAY"
...@@ -150,8 +151,6 @@ ...@@ -150,8 +151,6 @@
#define MSG_ERR_MINTEMP "Err: MINTEMP" #define MSG_ERR_MINTEMP "Err: MINTEMP"
#define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED" #define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED"
#define MSG_END_HOUR "hours"
#define MSG_END_MINUTE "minutes"
#ifdef DELTA #ifdef DELTA
#define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE "Delta Calibration"
...@@ -161,6 +160,11 @@ ...@@ -161,6 +160,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA #endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset" #define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration" #define MSG_CONFIG "Configuration"
#define MSG_E_BOWDEN_LENGTH "Extrude " STRINGIFY(BOWDEN_LENGTH) "mm" #define MSG_E_BOWDEN_LENGTH "Extrude " STRINGIFY(BOWDEN_LENGTH) "mm"
...@@ -184,7 +188,6 @@ ...@@ -184,7 +188,6 @@
#define MSG_FWTEST_04 "Start check MOTOR" #define MSG_FWTEST_04 "Start check MOTOR"
#define MSG_FWTEST_ATTENTION "ATTENTION! Check that the three axes are more than 5 mm from the endstop!" #define MSG_FWTEST_ATTENTION "ATTENTION! Check that the three axes are more than 5 mm from the endstop!"
#define MSG_FWTEST_END "Finish Test. Disable FIRMWARE_TEST and recompile." #define MSG_FWTEST_END "Finish Test. Disable FIRMWARE_TEST and recompile."
#define MSG_FWTEST_END "Finish Test. Disable FIRMWARE_TEST and recompile."
#endif // FIRMWARE_TEST #endif // FIRMWARE_TEST
#endif // LANGUAGE_EN_H #endif // LANGUAGE_EN_H
...@@ -150,6 +150,11 @@ ...@@ -150,6 +150,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA #endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset" #define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration" #define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate" #define MSG_BAUDRATE "Baudrate"
......
...@@ -150,6 +150,11 @@ ...@@ -150,6 +150,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA #endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset" #define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration" #define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate" #define MSG_BAUDRATE "Baudrate"
......
...@@ -150,6 +150,11 @@ ...@@ -150,6 +150,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Kalibroi Center" #define MSG_DELTA_CALIBRATE_CENTER "Kalibroi Center"
#endif // DELTA #endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset" #define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration" #define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate" #define MSG_BAUDRATE "Baudrate"
......
...@@ -151,6 +151,11 @@ ...@@ -151,6 +151,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA #endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset" #define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration" #define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate" #define MSG_BAUDRATE "Baudrate"
......
...@@ -8,10 +8,14 @@ ...@@ -8,10 +8,14 @@
#ifndef LANGUAGE_IT_H #ifndef LANGUAGE_IT_H
#define LANGUAGE_IT_H #define LANGUAGE_IT_H
#define MAPPER_NON #if !( defined(MAPPER_NON)|| defined(MAPPER_C2C3)|| defined(MAPPER_D0D1)|| defined(MAPPER_D0D1_MOD)|| defined(MAPPER_E382E383) )
// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h #define MAPPER_NON // For direct asci codes
//#define SIMULATE_ROMFONT #endif
#define DISPLAY_CHARSET_ISO10646_1
//#define SIMULATE_ROMFONT //Comment in to see what is seen on the character based displays
#if !( defined(SIMULATE_ROMFONT)|| defined(DISPLAY_CHARSET_ISO10646_1)|| defined(DISPLAY_CHARSET_ISO10646_5)|| defined(DISPLAY_CHARSET_ISO10646_KANA) )
#define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays.
#endif
#define WELCOME_MSG MACHINE_NAME " pronta." #define WELCOME_MSG MACHINE_NAME " pronta."
#define MSG_SD_INSERTED "SD Card inserita" #define MSG_SD_INSERTED "SD Card inserita"
...@@ -138,7 +142,8 @@ ...@@ -138,7 +142,8 @@
#define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Y "Babystep Y"
#define MSG_BABYSTEP_Z "Babystep Z" #define MSG_BABYSTEP_Z "Babystep Z"
#define MSG_ENDSTOP_ABORT "Finecorsa abort" #define MSG_ENDSTOP_ABORT "Finecorsa abort"
#define MSG_END_HOUR "ore"
#define MSG_END_MINUTE "minuti"
#define MSG_HEATING_FAILED_LCD "Heating failed" #define MSG_HEATING_FAILED_LCD "Heating failed"
#define MSG_ERR_REDUNDANT_TEMP "Err: REDUNDANT TEMP ERROR" #define MSG_ERR_REDUNDANT_TEMP "Err: REDUNDANT TEMP ERROR"
#define MSG_THERMAL_RUNAWAY "THERMAL RUNAWAY" #define MSG_THERMAL_RUNAWAY "THERMAL RUNAWAY"
...@@ -146,8 +151,6 @@ ...@@ -146,8 +151,6 @@
#define MSG_ERR_MINTEMP "Err: MINTEMP" #define MSG_ERR_MINTEMP "Err: MINTEMP"
#define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED" #define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED"
#define MSG_END_HOUR "ore"
#define MSG_END_MINUTE "minuti"
#ifdef DELTA #ifdef DELTA
#define MSG_DELTA_CALIBRATE "Calibraz. Delta" #define MSG_DELTA_CALIBRATE "Calibraz. Delta"
...@@ -157,6 +160,11 @@ ...@@ -157,6 +160,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibra Centro" #define MSG_DELTA_CALIBRATE_CENTER "Calibra Centro"
#endif // DELTA #endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset" #define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configurazione" #define MSG_CONFIG "Configurazione"
#define MSG_E_BOWDEN_LENGTH "Extrude " STRINGIFY(BOWDEN_LENGTH) "mm" #define MSG_E_BOWDEN_LENGTH "Extrude " STRINGIFY(BOWDEN_LENGTH) "mm"
......
...@@ -150,6 +150,11 @@ ...@@ -150,6 +150,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA #endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset" #define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration" #define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate" #define MSG_BAUDRATE "Baudrate"
......
...@@ -150,6 +150,11 @@ ...@@ -150,6 +150,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA #endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset" #define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration" #define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate" #define MSG_BAUDRATE "Baudrate"
......
...@@ -8,15 +8,19 @@ ...@@ -8,15 +8,19 @@
#ifndef LANGUAGE_PT_BR_H #ifndef LANGUAGE_PT_BR_H
#define LANGUAGE_PT_BR_H #define LANGUAGE_PT_BR_H
#define MAPPER_NON #if !( defined(MAPPER_NON)|| defined(MAPPER_C2C3)|| defined(MAPPER_D0D1)|| defined(MAPPER_D0D1_MOD)|| defined(MAPPER_E382E383) )
// Define SIMULATE_ROMFONT to see what is seen on the character based display defined in Configuration.h #define MAPPER_NON // For direct asci codes
//#define SIMULATE_ROMFONT #endif
#define DISPLAY_CHARSET_ISO10646_1
//#define SIMULATE_ROMFONT //Comment in to see what is seen on the character based displays
#if !( defined(SIMULATE_ROMFONT)|| defined(DISPLAY_CHARSET_ISO10646_1)|| defined(DISPLAY_CHARSET_ISO10646_5)|| defined(DISPLAY_CHARSET_ISO10646_KANA) )
#define DISPLAY_CHARSET_ISO10646_1 // use the better font on full graphic displays.
#endif
#define WELCOME_MSG MACHINE_NAME " pronto." #define WELCOME_MSG MACHINE_NAME " pronto."
#define MSG_SD_INSERTED "Cartao inserido" #define MSG_SD_INSERTED "Cartao inserido"
#define MSG_SD_REMOVED "Cartao removido" #define MSG_SD_REMOVED "Cartao removido"
#define MSG_MAIN " Menu principal \003" #define MSG_MAIN " Menu principal"
#define MSG_AUTOSTART "Autostart" #define MSG_AUTOSTART "Autostart"
#define MSG_DISABLE_STEPPERS " Apagar motores" #define MSG_DISABLE_STEPPERS " Apagar motores"
#define MSG_AUTO_HOME "Ir para origen" #define MSG_AUTO_HOME "Ir para origen"
...@@ -32,11 +36,11 @@ ...@@ -32,11 +36,11 @@
#define MSG_SET_ORIGIN "Estabelecer orig." #define MSG_SET_ORIGIN "Estabelecer orig."
#define MSG_PREHEAT_PLA "Pre-aquecer PLA" #define MSG_PREHEAT_PLA "Pre-aquecer PLA"
#define MSG_PREHEAT_PLA_ALL "Pre-aq. PLA Tudo" #define MSG_PREHEAT_PLA_ALL "Pre-aq. PLA Tudo"
#define MSG_PREHEAT_PLA_BEDONLY "Pre-aq. PLA \002Base" #define MSG_PREHEAT_PLA_BEDONLY "Pre-aq. PLA " LCD_STR_THERMOMETER "Base"
#define MSG_PREHEAT_PLA_SETTINGS "PLA setting" #define MSG_PREHEAT_PLA_SETTINGS "PLA setting"
#define MSG_PREHEAT_ABS "Pre-aquecer ABS" #define MSG_PREHEAT_ABS "Pre-aquecer ABS"
#define MSG_PREHEAT_ABS_ALL "Pre-aq. ABS Tudo" #define MSG_PREHEAT_ABS_ALL "Pre-aq. ABS Tudo"
#define MSG_PREHEAT_ABS_BEDONLY "Pre-aq. ABS \002Base" #define MSG_PREHEAT_ABS_BEDONLY "Pre-aq. ABS " LCD_STR_THERMOMETER "Base"
#define MSG_PREHEAT_ABS_SETTINGS "ABS setting" #define MSG_PREHEAT_ABS_SETTINGS "ABS setting"
#define MSG_PREHEAT_GUM "Preheat GUM" #define MSG_PREHEAT_GUM "Preheat GUM"
#define MSG_PREHEAT_GUM_ALL "Preheat GUM All" #define MSG_PREHEAT_GUM_ALL "Preheat GUM All"
...@@ -61,20 +65,24 @@ ...@@ -61,20 +65,24 @@
#define MSG_FAN_SPEED "Velocidade vento." #define MSG_FAN_SPEED "Velocidade vento."
#define MSG_FLOW "Fluxo" #define MSG_FLOW "Fluxo"
#define MSG_CONTROL "Controle" #define MSG_CONTROL "Controle"
#define MSG_MIN " " STR_THERMOMETER " Min" #define MSG_MIN " "LCD_STR_THERMOMETER " Min"
#define MSG_MAX " " STR_THERMOMETER " Max" #define MSG_MAX " "LCD_STR_THERMOMETER " Max"
#define MSG_FACTOR " " STR_THERMOMETER " Fact" #define MSG_FACTOR " "LCD_STR_THERMOMETER " Fact"
#define MSG_IDLEOOZING "Anti oozing"
#define MSG_AUTOTEMP "Autotemp" #define MSG_AUTOTEMP "Autotemp"
#define MSG_ON "On " #define MSG_ON "On "
#define MSG_OFF "Off" #define MSG_OFF "Off"
#define MSG_PID_P "PID-P" #define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I" #define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D" #define MSG_PID_D "PID-D"
#define MSG_ACC "Acc" #define MSG_E2 " E2"
#define MSG_E3 " E3"
#define MSG_E4 " E4"
#define MSG_ACC "Accel"
#define MSG_VXY_JERK "Vxy-jerk" #define MSG_VXY_JERK "Vxy-jerk"
#define MSG_VZ_JERK "Vz-jerk" #define MSG_VZ_JERK "Vz-jerk"
#define MSG_VE_JERK "Ve-jerk" #define MSG_VE_JERK "Ve-jerk"
#define MSG_VMAX " Vmax " #define MSG_VMAX "Vmax "
#define MSG_X "x" #define MSG_X "x"
#define MSG_Y "y" #define MSG_Y "y"
#define MSG_Z "z" #define MSG_Z "z"
...@@ -87,20 +95,20 @@ ...@@ -87,20 +95,20 @@
#define MSG_XSTEPS "Xpasso/mm" #define MSG_XSTEPS "Xpasso/mm"
#define MSG_YSTEPS "Ypasso/mm" #define MSG_YSTEPS "Ypasso/mm"
#define MSG_ZSTEPS "Zpasso/mm" #define MSG_ZSTEPS "Zpasso/mm"
#define MSG_E0STEPS "E0 passo/mm" #define MSG_ESTEPS "E0 passo/mm"
#define MSG_E1STEPS "E1 passo/mm" #define MSG_E1STEPS "E1 steps/mm"
#define MSG_E2STEPS "E2 passo/mm" #define MSG_E2STEPS "E2 steps/mm"
#define MSG_E3STEPS "E3 passo/mm" #define MSG_E3STEPS "E3 steps/mm"
#define MSG_TEMPERATURE "Temperatura" #define MSG_TEMPERATURE "Temperatura"
#define MSG_MOTION "Movimento" #define MSG_MOTION "Movimento"
#define MSG_VOLUMETRIC "Filament" #define MSG_VOLUMETRIC "Filament"
#define MSG_VOLUMETRIC_ENABLED "E in mm" STR_h3 #define MSG_VOLUMETRIC_ENABLED "E in mm3"
#define MSG_FILAMENT_SIZE_EXTRUDER "Fil. Dia." #define MSG_FILAMENT_SIZE_EXTRUDER "Fil. Dia."
#define MSG_CONTRAST "Contrast" #define MSG_CONTRAST "Contrast"
#define MSG_STORE_EPROM "Guardar memoria" #define MSG_STORE_EPROM "Guardar memoria"
#define MSG_LOAD_EPROM "Carregar memoria" #define MSG_LOAD_EPROM "Carregar memoria"
#define MSG_RESTORE_FAILSAFE "Rest. de emergen." #define MSG_RESTORE_FAILSAFE "Rest. de emergen."
#define MSG_REFRESH "Recarregar" #define MSG_REFRESH LCD_STR_REFRESH " Recarregar"
#define MSG_WATCH "Monitorar" #define MSG_WATCH "Monitorar"
#define MSG_PREPARE "Preparar" #define MSG_PREPARE "Preparar"
#define MSG_TUNE "Tune" #define MSG_TUNE "Tune"
...@@ -134,7 +142,8 @@ ...@@ -134,7 +142,8 @@
#define MSG_BABYSTEP_Y "Babystep Y" #define MSG_BABYSTEP_Y "Babystep Y"
#define MSG_BABYSTEP_Z "Babystep Z" #define MSG_BABYSTEP_Z "Babystep Z"
#define MSG_ENDSTOP_ABORT "Endstop abort" #define MSG_ENDSTOP_ABORT "Endstop abort"
#define MSG_END_HOUR "horas"
#define MSG_END_MINUTE "minutos"
#define MSG_HEATING_FAILED_LCD "Heating failed" #define MSG_HEATING_FAILED_LCD "Heating failed"
#define MSG_ERR_REDUNDANT_TEMP "Err: REDUNDANT TEMP ERROR" #define MSG_ERR_REDUNDANT_TEMP "Err: REDUNDANT TEMP ERROR"
#define MSG_THERMAL_RUNAWAY "THERMAL RUNAWAY" #define MSG_THERMAL_RUNAWAY "THERMAL RUNAWAY"
...@@ -142,6 +151,7 @@ ...@@ -142,6 +151,7 @@
#define MSG_ERR_MINTEMP "Err: MINTEMP" #define MSG_ERR_MINTEMP "Err: MINTEMP"
#define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED" #define MSG_ERR_MAXTEMP_BED "Err: MAXTEMP BED"
#ifdef DELTA #ifdef DELTA
#define MSG_DELTA_CALIBRATE "Delta Calibration" #define MSG_DELTA_CALIBRATE "Delta Calibration"
#define MSG_DELTA_CALIBRATE_X "Calibrate X" #define MSG_DELTA_CALIBRATE_X "Calibrate X"
...@@ -150,9 +160,13 @@ ...@@ -150,9 +160,13 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA #endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset" #define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration" #define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate"
#define MSG_E_BOWDEN_LENGTH "Extrude " STRINGIFY(BOWDEN_LENGTH) "mm" #define MSG_E_BOWDEN_LENGTH "Extrude " STRINGIFY(BOWDEN_LENGTH) "mm"
#define MSG_R_BOWDEN_LENGTH "Retract " STRINGIFY(BOWDEN_LENGTH) "mm" #define MSG_R_BOWDEN_LENGTH "Retract " STRINGIFY(BOWDEN_LENGTH) "mm"
#define MSG_PURGE_XMM "Purge " STRINGIFY(LCD_PURGE_LENGTH) "mm" #define MSG_PURGE_XMM "Purge " STRINGIFY(LCD_PURGE_LENGTH) "mm"
......
...@@ -150,6 +150,11 @@ ...@@ -150,6 +150,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA #endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset" #define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration" #define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate" #define MSG_BAUDRATE "Baudrate"
......
...@@ -150,6 +150,11 @@ ...@@ -150,6 +150,11 @@
#define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center"
#endif // DELTA #endif // DELTA
#ifdef SCARA
#define MSG_XSCALE "X Scale"
#define MSG_YSCALE "Y Scale"
#endif
#define MSG_LASER "Laser Preset" #define MSG_LASER "Laser Preset"
#define MSG_CONFIG "Configuration" #define MSG_CONFIG "Configuration"
#define MSG_BAUDRATE "Baudrate" #define MSG_BAUDRATE "Baudrate"
......
...@@ -4525,7 +4525,7 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a ...@@ -4525,7 +4525,7 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
#endif #endif
#ifdef POWER_CONSUMPTION #ifdef POWER_CONSUMPTION
#define POWER_CONSUMPTION_PIN 4 // ANALOG NUMBERING #define POWER_CONSUMPTION_PIN 5 // ANALOG NUMBERING
#endif #endif
/****************************************************************************************/ /****************************************************************************************/
......
...@@ -518,8 +518,8 @@ float junction_deviation = 0.1; ...@@ -518,8 +518,8 @@ float junction_deviation = 0.1;
if (degHotend(extruder) < extrude_min_temp && !debugDryrun()) { 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 position[E_AXIS] = target[E_AXIS]; //behave as if the move really took place, but ignore E part
de = 0; // no difference de = 0; // no difference
SERIAL_ECHO_START; ECHO_S(OK);
SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP); ECHO_EM(MSG_ERR_COLD_EXTRUDE_STOP);
} }
} }
...@@ -530,8 +530,8 @@ float junction_deviation = 0.1; ...@@ -530,8 +530,8 @@ float junction_deviation = 0.1;
#endif #endif
position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
de = 0; // no difference de = 0; // no difference
SERIAL_ECHO_START; ECHO_S(OK);
SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP); ECHO_EM(MSG_ERR_LONG_EXTRUDE_STOP);
#ifdef EASY_LOAD #ifdef EASY_LOAD
} }
allow_lengthy_extrude_once = false; allow_lengthy_extrude_once = false;
...@@ -877,7 +877,7 @@ float junction_deviation = 0.1; ...@@ -877,7 +877,7 @@ float junction_deviation = 0.1;
xsteps = axis_steps_per_sqr_second[X_AXIS], xsteps = axis_steps_per_sqr_second[X_AXIS],
ysteps = axis_steps_per_sqr_second[Y_AXIS], ysteps = axis_steps_per_sqr_second[Y_AXIS],
zsteps = axis_steps_per_sqr_second[Z_AXIS], zsteps = axis_steps_per_sqr_second[Z_AXIS],
esteps = axis_steps_per_sqr_second[E_AXIS]; esteps = axis_steps_per_sqr_second[E_AXIS + active_extruder];
if ((float)acc_st * bsx / block->step_event_count > xsteps) acc_st = xsteps; if ((float)acc_st * bsx / block->step_event_count > xsteps) acc_st = xsteps;
if ((float)acc_st * bsy / block->step_event_count > ysteps) acc_st = ysteps; if ((float)acc_st * bsy / block->step_event_count > ysteps) acc_st = ysteps;
if ((float)acc_st * bsz / block->step_event_count > zsteps) acc_st = zsteps; if ((float)acc_st * bsz / block->step_event_count > zsteps) acc_st = zsteps;
...@@ -887,7 +887,7 @@ float junction_deviation = 0.1; ...@@ -887,7 +887,7 @@ float junction_deviation = 0.1;
block->acceleration = acc_st / steps_per_mm; block->acceleration = acc_st / steps_per_mm;
#ifdef __SAM3X8E__ #ifdef __SAM3X8E__
block->acceleration_rate = (long)(acc_st * ( 16777216.0 / HAL_TIMER_RATE)); block->acceleration_rate = (long)(acc_st * ( 4294967296.0 / HAL_TIMER_RATE));
#else #else
block->acceleration_rate = (long)(acc_st * 16777216.0 / (F_CPU / 8.0)); block->acceleration_rate = (long)(acc_st * 16777216.0 / (F_CPU / 8.0));
#endif #endif
...@@ -993,12 +993,12 @@ float junction_deviation = 0.1; ...@@ -993,12 +993,12 @@ float junction_deviation = 0.1;
block->advance_rate = acc_dist ? advance / (float)acc_dist : 0; block->advance_rate = acc_dist ? advance / (float)acc_dist : 0;
} }
/* /*
SERIAL_ECHO_START; ECHO_S(OK);
SERIAL_ECHOPGM("advance :"); ECHO_M("advance :");
SERIAL_ECHO(block->advance/256.0); ECHO_V(block->advance/256.0);
SERIAL_ECHOPGM("advance rate :"); ECHO_M("advance rate :");
SERIAL_ECHOLN(block->advance_rate/256.0); ECHO_EV(block->advance_rate/256.0);
*/ */
#endif // ADVANCE #endif // ADVANCE
calculate_trapezoid_for_block(block, block->entry_speed / block->nominal_speed, safe_speed / block->nominal_speed); calculate_trapezoid_for_block(block, block->entry_speed / block->nominal_speed, safe_speed / block->nominal_speed);
......
...@@ -46,7 +46,7 @@ block_t *current_block; // A pointer to the block currently being traced ...@@ -46,7 +46,7 @@ block_t *current_block; // A pointer to the block currently being traced
// Variables used by The Stepper Driver Interrupt // Variables used by The Stepper Driver Interrupt
static unsigned char out_bits; // The next stepping-bits to be output static unsigned char out_bits; // The next stepping-bits to be output
static unsigned int cleaning_buffer_counter; static unsigned int cleaning_buffer_counter;
#ifdef Z_DUAL_ENDSTOPS #ifdef Z_DUAL_ENDSTOPS
static bool performing_homing = false, static bool performing_homing = false,
...@@ -276,32 +276,30 @@ void endstops_hit_on_purpose() { ...@@ -276,32 +276,30 @@ void endstops_hit_on_purpose() {
void checkHitEndstops() { void checkHitEndstops() {
if (endstop_x_hit || endstop_y_hit || endstop_z_hit || endstop_z_probe_hit || endstop_e_hit) { if (endstop_x_hit || endstop_y_hit || endstop_z_hit || endstop_z_probe_hit || endstop_e_hit) {
SERIAL_ECHO_START; ECHO_SM(OK, MSG_ENDSTOPS_HIT);
SERIAL_ECHOPGM(MSG_ENDSTOPS_HIT);
if(endstop_x_hit) { if(endstop_x_hit) {
SERIAL_ECHOPAIR(" X:", (float)endstops_trigsteps[X_AXIS] / axis_steps_per_unit[X_AXIS]); ECHO_MV(MSG_ENDSTOP_X, (float)endstops_trigsteps[X_AXIS] / axis_steps_per_unit[X_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "X"); LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT MSG_ENDSTOP_XS);
} }
if(endstop_y_hit) { if(endstop_y_hit) {
SERIAL_ECHOPAIR(" Y:", (float)endstops_trigsteps[Y_AXIS] / axis_steps_per_unit[Y_AXIS]); ECHO_MV(MSG_ENDSTOP_Y, (float)endstops_trigsteps[Y_AXIS] / axis_steps_per_unit[Y_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Y"); LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT MSG_ENDSTOP_YS);
} }
if(endstop_z_hit) { if(endstop_z_hit) {
SERIAL_ECHOPAIR(" Z:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]); ECHO_MV(MSG_ENDSTOP_Z, (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Z"); LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT MSG_ENDSTOP_ZS);
} }
#ifdef Z_PROBE_ENDSTOP #ifdef Z_PROBE_ENDSTOP
if (endstop_z_probe_hit) { if (endstop_z_probe_hit) {
SERIAL_ECHOPAIR(" Z_PROBE:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]); ECHO_MV(" Z_PROBE:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "ZP"); LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT MSG_ENDSTOP_ZPS);
} }
#endif #endif
if(endstop_e_hit) { if(endstop_e_hit) {
SERIAL_ECHOPAIR(" E:", (float)endstops_trigsteps[E_AXIS] / axis_steps_per_unit[E_AXIS]); ECHO_MV(MSG_ENDSTOP_E, (float)endstops_trigsteps[E_AXIS] / axis_steps_per_unit[E_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "E"); LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT MSG_ENDSTOP_ES);
} }
ECHO_E;
SERIAL_ECHOLN("");
endstops_hit_on_purpose(); endstops_hit_on_purpose();
...@@ -327,27 +325,26 @@ void endstops_hit_on_purpose() { ...@@ -327,27 +325,26 @@ void endstops_hit_on_purpose() {
void checkHitEndstops() { void checkHitEndstops() {
if (endstop_x_hit || endstop_y_hit || endstop_z_hit || endstop_z_probe_hit) { if (endstop_x_hit || endstop_y_hit || endstop_z_hit || endstop_z_probe_hit) {
SERIAL_ECHO_START; ECHO_SM(OK, MSG_ENDSTOPS_HIT);
SERIAL_ECHOPGM(MSG_ENDSTOPS_HIT);
if (endstop_x_hit) { if (endstop_x_hit) {
SERIAL_ECHOPAIR(" X:", (float)endstops_trigsteps[X_AXIS] / axis_steps_per_unit[X_AXIS]); ECHO_MV(MSG_ENDSTOP_X, (float)endstops_trigsteps[X_AXIS] / axis_steps_per_unit[X_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "X"); LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT MSG_ENDSTOP_XS);
} }
if (endstop_y_hit) { if (endstop_y_hit) {
SERIAL_ECHOPAIR(" Y:", (float)endstops_trigsteps[Y_AXIS] / axis_steps_per_unit[Y_AXIS]); ECHO_MV(MSG_ENDSTOP_Y, (float)endstops_trigsteps[Y_AXIS] / axis_steps_per_unit[Y_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Y"); LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT MSG_ENDSTOP_YS);
} }
if (endstop_z_hit) { if (endstop_z_hit) {
SERIAL_ECHOPAIR(" Z:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]); ECHO_MV(MSG_ENDSTOP_Z, (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Z"); LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT MSG_ENDSTOP_ZS);
} }
#ifdef Z_PROBE_ENDSTOP #ifdef Z_PROBE_ENDSTOP
if (endstop_z_probe_hit) { if (endstop_z_probe_hit) {
SERIAL_ECHOPAIR(" Z_PROBE:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]); ECHO_MV(MSG_ENDSTOP_ZPS, (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "ZP"); LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT MSG_ENDSTOP_ZPS);
} }
#endif #endif
SERIAL_EOL; ECHO_E;
endstops_hit_on_purpose(); endstops_hit_on_purpose();
...@@ -443,16 +440,6 @@ FORCE_INLINE void trapezoid_generator_reset() { ...@@ -443,16 +440,6 @@ FORCE_INLINE void trapezoid_generator_reset() {
acc_step_rate = current_block->initial_rate; acc_step_rate = current_block->initial_rate;
acceleration_time = calc_timer(acc_step_rate); acceleration_time = calc_timer(acc_step_rate);
OCR1A = acceleration_time; 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. // "The Stepper Driver Interrupt" - This timer interrupt is the workhorse.
...@@ -545,7 +532,7 @@ ISR(TIMER1_COMPA_vect) { ...@@ -545,7 +532,7 @@ ISR(TIMER1_COMPA_vect) {
#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 HAS_X_MIN #if HAS_X_MIN
UPDATE_ENDSTOP(x, X, min, MIN); UPDATE_ENDSTOP(x, X, min, MIN);
...@@ -631,14 +618,14 @@ ISR(TIMER1_COMPA_vect) { ...@@ -631,14 +618,14 @@ ISR(TIMER1_COMPA_vect) {
z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING); z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING);
if (z_probe_endstop && old_z_probe_endstop) if (z_probe_endstop && old_z_probe_endstop)
{ {
endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
endstop_z_probe_hit = true; endstop_z_probe_hit = true;
// if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true"); // if (z_probe_endstop && old_z_probe_endstop) ECHO_EV("z_probe_endstop = true");
} }
old_z_probe_endstop = z_probe_endstop; old_z_probe_endstop = z_probe_endstop;
#endif #endif
} // check_endstops } // check_endstops
} }
...@@ -668,8 +655,8 @@ ISR(TIMER1_COMPA_vect) { ...@@ -668,8 +655,8 @@ ISR(TIMER1_COMPA_vect) {
endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
endstop_z_hit = true; endstop_z_hit = true;
// if (z_max_both) SERIAL_ECHOLN("z_max_endstop = true"); // if (z_max_both) ECHO_EV("z_max_endstop = true");
// if (z2_max_both) SERIAL_ECHOLN("z2_max_endstop = true"); // if (z2_max_both) ECHO_EV("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... 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; step_events_completed = current_block->step_event_count;
...@@ -808,6 +795,7 @@ ISR(TIMER1_COMPA_vect) { ...@@ -808,6 +795,7 @@ ISR(TIMER1_COMPA_vect) {
#endif #endif
} }
else if (step_events_completed > (unsigned long)current_block->decelerate_after) { else if (step_events_completed > (unsigned long)current_block->decelerate_after) {
MultiU24X32toH16(step_rate, deceleration_time, current_block->acceleration_rate); MultiU24X32toH16(step_rate, deceleration_time, current_block->acceleration_rate);
if (step_rate > acc_step_rate) { // Check step_rate stays positive if (step_rate > acc_step_rate) { // Check step_rate stays positive
...@@ -934,7 +922,7 @@ void st_init() { ...@@ -934,7 +922,7 @@ void st_init() {
#ifdef HAVE_L6470DRIVER #ifdef HAVE_L6470DRIVER
L6470_init(); L6470_init();
#endif #endif
// Initialize Dir Pins // Initialize Dir Pins
#if HAS_X_DIR #if HAS_X_DIR
X_DIR_INIT; X_DIR_INIT;
...@@ -980,11 +968,11 @@ void st_init() { ...@@ -980,11 +968,11 @@ void st_init() {
#if HAS_Y_ENABLE #if HAS_Y_ENABLE
Y_ENABLE_INIT; Y_ENABLE_INIT;
if (!Y_ENABLE_ON) Y_ENABLE_WRITE(HIGH); if (!Y_ENABLE_ON) Y_ENABLE_WRITE(HIGH);
#if defined(Y_DUAL_STEPPER_DRIVERS) && HAS_Y2_ENABLE #if defined(Y_DUAL_STEPPER_DRIVERS) && HAS_Y2_ENABLE
Y2_ENABLE_INIT; Y2_ENABLE_INIT;
if (!Y_ENABLE_ON) Y2_ENABLE_WRITE(HIGH); if (!Y_ENABLE_ON) Y2_ENABLE_WRITE(HIGH);
#endif #endif
#endif #endif
#if HAS_Z_ENABLE #if HAS_Z_ENABLE
Z_ENABLE_INIT; Z_ENABLE_INIT;
...@@ -1082,8 +1070,8 @@ void st_init() { ...@@ -1082,8 +1070,8 @@ void st_init() {
#ifdef ENDSTOPPULLUP_ZMAX #ifdef ENDSTOPPULLUP_ZMAX
WRITE(Z2_MAX_PIN,HIGH); WRITE(Z2_MAX_PIN,HIGH);
#endif #endif
#endif #endif
#if (defined(Z_PROBE_PIN) && Z_PROBE_PIN >= 0) && defined(Z_PROBE_ENDSTOP) // Check for Z_PROBE_ENDSTOP so we don't pull a pin high unless it's to be used. #if (defined(Z_PROBE_PIN) && Z_PROBE_PIN >= 0) && defined(Z_PROBE_ENDSTOP) // Check for Z_PROBE_ENDSTOP so we don't pull a pin high unless it's to be used.
SET_INPUT(Z_PROBE_PIN); SET_INPUT(Z_PROBE_PIN);
#ifdef ENDSTOPPULLUP_ZPROBE #ifdef ENDSTOPPULLUP_ZPROBE
...@@ -1261,7 +1249,7 @@ void quickStop() { ...@@ -1261,7 +1249,7 @@ void quickStop() {
case Y_AXIS: case Y_AXIS:
BABYSTEP_AXIS(y, Y, false); BABYSTEP_AXIS(y, Y, false);
break; break;
case Z_AXIS: { case Z_AXIS: {
#ifndef DELTA #ifndef DELTA
...@@ -1298,7 +1286,7 @@ void quickStop() { ...@@ -1298,7 +1286,7 @@ void quickStop() {
#endif #endif
} break; } break;
default: break; default: break;
} }
} }
...@@ -1371,7 +1359,7 @@ void microstep_init() { ...@@ -1371,7 +1359,7 @@ void microstep_init() {
#if HAS_MICROSTEPS #if HAS_MICROSTEPS
pinMode(X_MS1_PIN,OUTPUT); pinMode(X_MS1_PIN,OUTPUT);
pinMode(X_MS2_PIN,OUTPUT); pinMode(X_MS2_PIN,OUTPUT);
pinMode(Y_MS1_PIN,OUTPUT); pinMode(Y_MS1_PIN,OUTPUT);
pinMode(Y_MS2_PIN,OUTPUT); pinMode(Y_MS2_PIN,OUTPUT);
pinMode(Z_MS1_PIN,OUTPUT); pinMode(Z_MS1_PIN,OUTPUT);
...@@ -1419,23 +1407,23 @@ void microstep_mode(uint8_t driver, uint8_t stepping_mode) { ...@@ -1419,23 +1407,23 @@ void microstep_mode(uint8_t driver, uint8_t stepping_mode) {
} }
void microstep_readings() { void microstep_readings() {
SERIAL_PROTOCOLPGM("MS1,MS2 Pins\n"); ECHO_SM(OK, MSG_MICROSTEP_MS1_MS2);
SERIAL_PROTOCOLPGM("X: "); ECHO_M(MSG_MICROSTEP_X);
SERIAL_PROTOCOL(digitalRead(X_MS1_PIN)); ECHO_V(digitalRead(X_MS1_PIN));
SERIAL_PROTOCOLLN(digitalRead(X_MS2_PIN)); ECHO_EV(digitalRead(X_MS2_PIN));
SERIAL_PROTOCOLPGM("Y: "); ECHO_SM(OK, MSG_MICROSTEP_Y);
SERIAL_PROTOCOL(digitalRead(Y_MS1_PIN)); ECHO_V(digitalRead(Y_MS1_PIN));
SERIAL_PROTOCOLLN(digitalRead(Y_MS2_PIN)); ECHO_EV(digitalRead(Y_MS2_PIN));
SERIAL_PROTOCOLPGM("Z: "); ECHO_SM(OK, MSG_MICROSTEP_Z);
SERIAL_PROTOCOL(digitalRead(Z_MS1_PIN)); ECHO_V(digitalRead(Z_MS1_PIN));
SERIAL_PROTOCOLLN(digitalRead(Z_MS2_PIN)); ECHO_EV(digitalRead(Z_MS2_PIN));
SERIAL_PROTOCOLPGM("E0: "); ECHO_SM(OK, MSG_MICROSTEP_E0);
SERIAL_PROTOCOL(digitalRead(E0_MS1_PIN)); ECHO_V(digitalRead(E0_MS1_PIN));
SERIAL_PROTOCOLLN(digitalRead(E0_MS2_PIN)); ECHO_EV(digitalRead(E0_MS2_PIN));
#if HAS_MICROSTEPS_E1 #if HAS_MICROSTEPS_E1
SERIAL_PROTOCOLPGM("E1: "); ECHO_SM(OK, MSG_MICROSTEP_E1);
SERIAL_PROTOCOL(digitalRead(E1_MS1_PIN)); ECHO_V(digitalRead(E1_MS1_PIN));
SERIAL_PROTOCOLLN(digitalRead(E1_MS2_PIN)); ECHO_EV(digitalRead(E1_MS2_PIN));
#endif #endif
} }
......
...@@ -204,11 +204,11 @@ void PID_autotune(float temp, int hotend, int ncycles) ...@@ -204,11 +204,11 @@ void PID_autotune(float temp, int hotend, int ncycles)
|| hotend < 0 || hotend < 0
#endif #endif
) { ) {
SERIAL_ECHOLN(MSG_PID_BAD_EXTRUDER_NUM); ECHO_LM(ER, MSG_PID_BAD_EXTRUDER_NUM);
return; return;
} }
SERIAL_ECHOLN(MSG_PID_AUTOTUNE_START); ECHO_LM(OK, MSG_PID_AUTOTUNE_START);
disable_all_heaters(); // switch off all heaters. disable_all_heaters(); // switch off all heaters.
...@@ -260,39 +260,44 @@ void PID_autotune(float temp, int hotend, int ncycles) ...@@ -260,39 +260,44 @@ void PID_autotune(float temp, int hotend, int ncycles)
bias = constrain(bias, 20, max_pow - 20); bias = constrain(bias, 20, max_pow - 20);
d = (bias > max_pow / 2) ? max_pow - 1 - bias : bias; d = (bias > max_pow / 2) ? max_pow - 1 - bias : bias;
SERIAL_PROTOCOLPGM(MSG_BIAS); SERIAL_PROTOCOL(bias); ECHO_SMV(OK, MSG_BIAS, bias);
SERIAL_PROTOCOLPGM(MSG_D); SERIAL_PROTOCOL(d); ECHO_MV(MSG_D, d);
SERIAL_PROTOCOLPGM(MSG_T_MIN); SERIAL_PROTOCOL(min); ECHO_MV(MSG_T_MIN, min);
SERIAL_PROTOCOLPGM(MSG_T_MAX); SERIAL_PROTOCOLLN(max); ECHO_MV(MSG_T_MAX, max);
if (cycles > 2) { if (cycles > 2) {
Ku = (4.0 * d) / (3.14159265 * (max - min) / 2.0); Ku = (4.0 * d) / (3.14159265 * (max - min) / 2.0);
Tu = ((float)(t_low + t_high) / 1000.0); Tu = ((float)(t_low + t_high) / 1000.0);
SERIAL_PROTOCOLPGM(MSG_KU); SERIAL_PROTOCOL(Ku); ECHO_MV(MSG_KU, Ku);
SERIAL_PROTOCOLPGM(MSG_TU); SERIAL_PROTOCOLLN(Tu); ECHO_MV(MSG_TU, Tu);
Kp_temp = 0.6 * Ku; Kp_temp = 0.6 * Ku;
Ki_temp = 2 * Kp_temp / Tu; Ki_temp = 2 * Kp_temp / Tu;
Kd_temp = Kp_temp * Tu / 8; Kd_temp = Kp_temp * Tu / 8;
SERIAL_PROTOCOLLNPGM(MSG_CLASSIC_PID);
SERIAL_PROTOCOLPGM(MSG_KP); SERIAL_PROTOCOLLN(Kp_temp); ECHO_M(MSG_CLASSIC_PID);
SERIAL_PROTOCOLPGM(MSG_KI); SERIAL_PROTOCOLLN(Ki_temp); ECHO_MV(MSG_KP, Kp_temp);
SERIAL_PROTOCOLPGM(MSG_KD); SERIAL_PROTOCOLLN(Kd_temp); ECHO_MV(MSG_KI, Ki_temp);
ECHO_EMV(MSG_KD, Kd_temp);
/* /*
Kp = 0.33*Ku; Kp = 0.33*Ku;
Ki = Kp_temp / Tu; Ki = Kp_temp / Tu;
Kd = Kp_temp * Tu / 3; Kd = Kp_temp * Tu / 3;
SERIAL_PROTOCOLLNPGM(" Some overshoot "); ECHO_SMV(DB," Some overshoot ");
SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(Kp_temp); ECHO_MV(" Kp: ", Kp_temp);
SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(Ki_temp); ECHO_MV(" Ki: ", Ki_temp);
SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(Kd_temp); ECHO_MV(" Kd: ", Kd_temp);
Kp = 0.2 * Ku; Kp = 0.2 * Ku;
Ki = 2 * Kp_temp / Tu; Ki = 2 * Kp_temp / Tu;
Kd = Kp_temp * Tu / 3; Kd = Kp_temp * Tu / 3;
SERIAL_PROTOCOLLNPGM(" No overshoot "); ECHO_M(" No overshoot ");
SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(Kp_temp); ECHO_MV(" Kp: ", Kp_temp);
SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(Ki_temp); ECHO_MV(" Ki: ", Ki_temp);
SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(Kd_temp); ECHO_EMV(" Kd: ", Kd_temp);
*/ */
} }
else {
ECHO_E;
}
} }
if (hotend < 0) if (hotend < 0)
soft_pwm_bed = (bias + d) >> 1; soft_pwm_bed = (bias + d) >> 1;
...@@ -304,7 +309,7 @@ void PID_autotune(float temp, int hotend, int ncycles) ...@@ -304,7 +309,7 @@ void PID_autotune(float temp, int hotend, int ncycles)
} }
} }
if (input > temp + 20) { if (input > temp + 20) {
SERIAL_PROTOCOLLNPGM(MSG_PID_TEMP_TOO_HIGH); ECHO_LM(ER, MSG_PID_TEMP_TOO_HIGH);
return; return;
} }
// Every 2 seconds... // Every 2 seconds...
...@@ -312,26 +317,24 @@ void PID_autotune(float temp, int hotend, int ncycles) ...@@ -312,26 +317,24 @@ void PID_autotune(float temp, int hotend, int ncycles)
int p; int p;
if (hotend < 0) { if (hotend < 0) {
p = soft_pwm_bed; p = soft_pwm_bed;
SERIAL_PROTOCOLPGM(MSG_OK_B); ECHO_SMV(OK, MSG_B, input);
ECHO_EMV(MSG_AT, p);
} }
else { else {
p = soft_pwm[hotend]; p = soft_pwm[hotend];
SERIAL_PROTOCOLPGM(MSG_OK_T); ECHO_SMV(OK, MSG_T, input);
ECHO_EMV(MSG_AT, p);
} }
SERIAL_PROTOCOL(input);
SERIAL_PROTOCOLPGM(MSG_AT);
SERIAL_PROTOCOLLN(p);
temp_ms = ms; temp_ms = ms;
} // every 2 seconds } // every 2 seconds
// Over 2 minutes? // Over 2 minutes?
if (((ms - t1) + (ms - t2)) > (10L*60L*1000L*2L)) { if (((ms - t1) + (ms - t2)) > (10L*60L*1000L*2L)) {
SERIAL_PROTOCOLLNPGM(MSG_PID_TIMEOUT); ECHO_LM(ER, MSG_PID_TIMEOUT);
return; return;
} }
if (cycles > ncycles) { if (cycles > ncycles) {
SERIAL_PROTOCOLLNPGM(MSG_PID_AUTOTUNE_FINISHED); ECHO_LM(OK, MSG_PID_AUTOTUNE_FINISHED);
#ifdef PIDTEMP #ifdef PIDTEMP
PID_PARAM(Kp, hotend) = Kp_temp; PID_PARAM(Kp, hotend) = Kp_temp;
PID_PARAM(Ki, hotend) = scalePID_i(Ki_temp); PID_PARAM(Ki, hotend) = scalePID_i(Ki_temp);
...@@ -440,10 +443,11 @@ void checkExtruderAutoFans() ...@@ -440,10 +443,11 @@ void checkExtruderAutoFans()
// //
inline void _temp_error(int e, const char *msg1, const char *msg2) { inline void _temp_error(int e, const char *msg1, const char *msg2) {
if (IsRunning()) { if (IsRunning()) {
SERIAL_ERROR_START; ECHO_S(ER);
if (e >= 0) SERIAL_ERRORLN((int)e); if (e >= 0) ECHO_EV(e);
serialprintPGM(msg1); else ECHO_EV(MSG_TEMP_BED);
MYSERIAL.write('\n'); PS_PGM(msg1);
ECHO_E;
#ifdef ULTRA_LCD #ifdef ULTRA_LCD
lcd_setalertstatuspgm(msg2); lcd_setalertstatuspgm(msg2);
#endif #endif
...@@ -508,19 +512,12 @@ float get_pid_output(int e) { ...@@ -508,19 +512,12 @@ float get_pid_output(int e) {
#endif //PID_OPENLOOP #endif //PID_OPENLOOP
#ifdef PID_DEBUG #ifdef PID_DEBUG
SERIAL_ECHO_START; ECHO_SMV(DB, " PID_DEBUG ", e);
SERIAL_ECHO(MSG_PID_DEBUG); ECHO_MV(": Input ", current_temperature[e]);
SERIAL_ECHO(e); ECHO_MV(" Output ", pid_output);
SERIAL_ECHO(MSG_PID_DEBUG_INPUT); ECHO_MV(" pTerm ", pTerm[e]);
SERIAL_ECHO(current_temperature[e]); ECHO_MV(" iTerm ", iTerm[e]);
SERIAL_ECHO(MSG_PID_DEBUG_OUTPUT); ECHO_EMV(" dTerm ", dTerm[e]);
SERIAL_ECHO(pid_output);
SERIAL_ECHO(MSG_PID_DEBUG_PTERM);
SERIAL_ECHO(pTerm[e]);
SERIAL_ECHO(MSG_PID_DEBUG_ITERM);
SERIAL_ECHO(iTerm[e]);
SERIAL_ECHO(MSG_PID_DEBUG_DTERM);
SERIAL_ECHOLN(dTerm[e]);
#endif //PID_DEBUG #endif //PID_DEBUG
#else /* PID off */ #else /* PID off */
...@@ -557,18 +554,12 @@ float get_pid_output(int e) { ...@@ -557,18 +554,12 @@ float get_pid_output(int e) {
#endif // PID_OPENLOOP #endif // PID_OPENLOOP
#ifdef PID_BED_DEBUG #ifdef PID_BED_DEBUG
SERIAL_ECHO_START; ECHO_SM(DB ," PID_BED_DEBUG ");
SERIAL_ECHO(" PID_BED_DEBUG "); ECHO_MV(": Input ", current_temperature_bed);
SERIAL_ECHO(": Input "); ECHO_MV(" Output ", pid_output);
SERIAL_ECHO(current_temperature_bed); ECHO_MV(" pTerm ", pTerm_bed);
SERIAL_ECHO(" Output "); ECHO_MV(" iTerm ", iTerm_bed);
SERIAL_ECHO(pid_output); ECHO_EMV(" dTerm ", dTerm_bed);
SERIAL_ECHO(" pTerm ");
SERIAL_ECHO(pTerm_bed);
SERIAL_ECHO(" iTerm ");
SERIAL_ECHO(iTerm_bed);
SERIAL_ECHO(" dTerm ");
SERIAL_ECHOLN(dTerm_bed);
#endif //PID_BED_DEBUG #endif //PID_BED_DEBUG
return pid_output; return pid_output;
...@@ -615,9 +606,8 @@ void manage_heater() { ...@@ -615,9 +606,8 @@ void manage_heater() {
if (watchmillis[e] && ms > watchmillis[e] + WATCH_TEMP_PERIOD) { if (watchmillis[e] && ms > watchmillis[e] + WATCH_TEMP_PERIOD) {
if (degHotend(e) < watch_start_temp[e] + WATCH_TEMP_INCREASE) { if (degHotend(e) < watch_start_temp[e] + WATCH_TEMP_INCREASE) {
setTargetHotend(0, e); setTargetHotend(0, e);
ECHO_LM(ER, MSG_HEATING_FAILED);
LCD_MESSAGEPGM(MSG_HEATING_FAILED_LCD); LCD_MESSAGEPGM(MSG_HEATING_FAILED_LCD);
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM(MSG_HEATING_FAILED);
} }
else { else {
watchmillis[e] = 0; watchmillis[e] = 0;
...@@ -707,9 +697,7 @@ static float analog2temp(int raw, uint8_t e) { ...@@ -707,9 +697,7 @@ static float analog2temp(int raw, uint8_t e) {
if (e >= EXTRUDERS) if (e >= EXTRUDERS)
#endif #endif
{ {
SERIAL_ERROR_START; ECHO_LVM(ER, e, MSG_INVALID_EXTRUDER_NUM);
SERIAL_ERROR((int)e);
SERIAL_ERRORLNPGM(MSG_INVALID_EXTRUDER_NUM);
kill(); kill();
return 0.0; return 0.0;
} }
...@@ -807,12 +795,21 @@ static void updateTemperaturesFromRawValues() { ...@@ -807,12 +795,21 @@ static void updateTemperaturesFromRawValues() {
watt_overflow--; watt_overflow--;
} }
#endif #endif
<<<<<<< HEAD
static unsigned int second_overflow = 0; static unsigned int second_overflow = 0;
second_overflow += from_last_update; second_overflow += from_last_update;
if(second_overflow >= 1000) { if(second_overflow >= 1000) {
printer_usage_seconds++; printer_usage_seconds++;
second_overflow -= 1000; second_overflow -= 1000;
=======
static unsigned int second_overflow = 0;
second_overflow += from_last_update;
if(second_overflow >= 1000) {
printer_usage_seconds++;
second_overflow -= 1000;
>>>>>>> origin/master
} }
last_update = temp_last_update; last_update = temp_last_update;
//Reset the watchdog after we know we have a temperature measurement. //Reset the watchdog after we know we have a temperature measurement.
...@@ -1058,18 +1055,12 @@ void setWatch() { ...@@ -1058,18 +1055,12 @@ void setWatch() {
static float tr_target_temperature[EXTRUDERS+1] = { 0.0 }; static float tr_target_temperature[EXTRUDERS+1] = { 0.0 };
/* /*
SERIAL_ECHO_START; ECHO_SM(DB, "Thermal Thermal Runaway Running. Heater ID: ");
SERIAL_ECHOPGM("Thermal Thermal Runaway Running. Heater ID: "); if (heater_id < 0) ECHO_M("bed"); else ECHO_V(heater_id);
if (heater_id < 0) SERIAL_ECHOPGM("bed"); else SERIAL_ECHOPGM(heater_id); ECHO_MV(" ; State:", *state);
SERIAL_ECHOPGM(" ; State:"); ECHO_MV(" ; Timer:", *timer);
SERIAL_ECHOPGM(*state); ECHO_MV(" ; Temperature:", temperature);
SERIAL_ECHOPGM(" ; Timer:"); ECHO_EMV(" ; Target Temp:", target_temperature);
SERIAL_ECHOPGM(*timer);
SERIAL_ECHOPGM(" ; Temperature:");
SERIAL_ECHOPGM(temperature);
SERIAL_ECHOPGM(" ; Target Temp:");
SERIAL_ECHOPGM(target_temperature);
SERIAL_EOL;
*/ */
int heater_index = heater_id >= 0 ? heater_id : EXTRUDERS; int heater_index = heater_id >= 0 ? heater_id : EXTRUDERS;
...@@ -1104,9 +1095,8 @@ void setWatch() { ...@@ -1104,9 +1095,8 @@ void setWatch() {
*state = TRRunaway; *state = TRRunaway;
break; break;
case TRRunaway: case TRRunaway:
SERIAL_ERROR_START; ECHO_SM(ER, MSG_THERMAL_RUNAWAY_STOP);
SERIAL_ERRORLNPGM(MSG_THERMAL_RUNAWAY_STOP); if (heater_id < 0) ECHO_EM(MSG_THERMAL_RUNAWAY_BED); else ECHO_EV(heater_id);
if (heater_id < 0) SERIAL_ERRORLNPGM("bed"); else SERIAL_ERRORLN(heater_id);
LCD_ALERTMESSAGEPGM(MSG_THERMAL_RUNAWAY); LCD_ALERTMESSAGEPGM(MSG_THERMAL_RUNAWAY);
disable_all_heaters(); disable_all_heaters();
disable_all_steppers(); disable_all_steppers();
...@@ -1586,10 +1576,9 @@ ISR(TIMER0_COMPB_vect) { ...@@ -1586,10 +1576,9 @@ ISR(TIMER0_COMPB_vect) {
temp_state = PrepareTemp_0; temp_state = PrepareTemp_0;
break; break;
// default: default:
// SERIAL_ERROR_START; ECHO_LM(ER, MSG_TEMP_READ_ERROR);
// SERIAL_ERRORLNPGM("Temp measurement error!"); break;
// break;
} // switch(temp_state) } // switch(temp_state)
if (temp_count >= OVERSAMPLENR) { // 14 * 16 * 1/(16000000/64/256) if (temp_count >= OVERSAMPLENR) { // 14 * 16 * 1/(16000000/64/256)
......
...@@ -276,34 +276,34 @@ static void lcd_status_screen() { ...@@ -276,34 +276,34 @@ static void lcd_status_screen() {
#ifdef LCD_PROGRESS_BAR #ifdef LCD_PROGRESS_BAR
millis_t ms = millis(); millis_t ms = millis();
#ifndef PROGRESS_MSG_ONCE #ifndef PROGRESS_MSG_ONCE
if (ms > progressBarTick + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME) { if (ms > progress_bar_ms + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME) {
progressBarTick = ms; progress_bar_ms = ms;
} }
#endif #endif
#if PROGRESS_MSG_EXPIRE > 0 #if PROGRESS_MSG_EXPIRE > 0
// Handle message expire // Handle message expire
if (expireStatusMillis > 0) { if (expire_status_ms > 0) {
if (card.isFileOpen()) { if (card.isFileOpen()) {
// Expire the message when printing is active // Expire the message when printing is active
if (IS_SD_PRINTING) { if (IS_SD_PRINTING) {
// Expire the message when printing is active // Expire the message when printing is active
if (ms >= expireStatusMillis) { if (ms >= expire_status_ms) {
lcd_status_message[0] = '\0'; lcd_status_message[0] = '\0';
expireStatusMillis = 0; expire_status_ms = 0;
} }
} }
else { else {
expireStatusMillis += LCD_UPDATE_INTERVAL; expire_status_ms += LCD_UPDATE_INTERVAL;
} }
} }
else { else {
expireStatusMillis = 0; expire_status_ms = 0;
} }
} }
#endif #endif
#endif //LCD_PROGRESS_BAR #endif //LCD_PROGRESS_BAR
lcd_implementation_status_screen(); lcd_implementation_status_screen();
#if HAS_LCD_POWER_SENSOR #if HAS_LCD_POWER_SENSOR
if (millis() > print_millis + 2000) print_millis = millis(); if (millis() > print_millis + 2000) print_millis = millis();
...@@ -675,7 +675,7 @@ void config_lcd_level_bed() ...@@ -675,7 +675,7 @@ void config_lcd_level_bed()
{ {
setTargetHotend(0,0); setTargetHotend(0,0);
SERIAL_ECHOLN("Leveling..."); ECHO_EM("Leveling...");
currentMenu = lcd_level_bed; currentMenu = lcd_level_bed;
enqueuecommands_P(PSTR("G28 M")); enqueuecommands_P(PSTR("G28 M"));
pageShowInfo = 0; pageShowInfo = 0;
...@@ -816,26 +816,26 @@ static void lcd_prepare_menu() { ...@@ -816,26 +816,26 @@ static void lcd_prepare_menu() {
} }
#endif // DELTA #endif // DELTA
inline void line_to_current() { inline void line_to_current(AxisEnum axis) {
#ifdef DELTA #ifdef DELTA
calculate_delta(current_position); calculate_delta(current_position);
plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[X_AXIS]/60, active_extruder, active_driver); plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[axis]/60, active_extruder, active_driver);
#else #else
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[X_AXIS]/60, active_extruder, active_driver); plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[axis]/60, active_extruder, active_driver);
#endif #endif
} }
float move_menu_scale; float move_menu_scale;
static void lcd_move_menu_axis(); static void lcd_move_menu_axis();
static void _lcd_move(const char *name, int axis, int min, int max) { static void _lcd_move(const char *name, AxisEnum axis, int min, int max) {
if (encoderPosition != 0) { if (encoderPosition != 0) {
refresh_cmd_timeout(); refresh_cmd_timeout();
current_position[axis] += float((int)encoderPosition) * move_menu_scale; current_position[axis] += float((int)encoderPosition) * move_menu_scale;
if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; if (min_software_endstops && current_position[axis] < min) current_position[axis] = min;
if (max_software_endstops && current_position[axis] > max) current_position[axis] = max; if (max_software_endstops && current_position[axis] > max) current_position[axis] = max;
encoderPosition = 0; encoderPosition = 0;
line_to_current(); line_to_current(axis);
lcdDrawUpdate = 1; lcdDrawUpdate = 1;
} }
if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr31(current_position[axis])); if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr31(current_position[axis]));
...@@ -848,7 +848,7 @@ static void lcd_move_e() { ...@@ -848,7 +848,7 @@ static void lcd_move_e() {
if (encoderPosition != 0) { if (encoderPosition != 0) {
current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale; current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale;
encoderPosition = 0; encoderPosition = 0;
line_to_current(); line_to_current(E_AXIS);
lcdDrawUpdate = 1; lcdDrawUpdate = 1;
} }
if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("Extruder"), ftostr31(current_position[E_AXIS])); if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("Extruder"), ftostr31(current_position[E_AXIS]));
...@@ -1104,8 +1104,8 @@ static void lcd_control_motion_menu() { ...@@ -1104,8 +1104,8 @@ static void lcd_control_motion_menu() {
MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &abort_on_endstop_hit); MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &abort_on_endstop_hit);
#endif #endif
#ifdef SCARA #ifdef SCARA
MENU_ITEM_EDIT(float74, MSG_XSCALE, &axis_scaling[X_AXIS],0.5,2); MENU_ITEM_EDIT(float52, 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_YSCALE, &axis_scaling[Y_AXIS],0.5,2);
#endif #endif
END_MENU(); END_MENU();
} }
...@@ -1310,23 +1310,18 @@ void lcd_quick_feedback() { ...@@ -1310,23 +1310,18 @@ void lcd_quick_feedback() {
#endif #endif
lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ);
#elif defined(BEEPER) && BEEPER > -1 #elif defined(BEEPER) && BEEPER > -1
SET_OUTPUT(BEEPER);
#ifndef LCD_FEEDBACK_FREQUENCY_HZ #ifndef LCD_FEEDBACK_FREQUENCY_HZ
#define LCD_FEEDBACK_FREQUENCY_HZ 5000 #define LCD_FEEDBACK_FREQUENCY_HZ 5000
#endif #endif
#ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS
#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2
#endif #endif
const uint16_t delay = 1000000 / LCD_FEEDBACK_FREQUENCY_HZ / 2; lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ);
uint16_t i = LCD_FEEDBACK_FREQUENCY_DURATION_MS * LCD_FEEDBACK_FREQUENCY_HZ / 1000; #else
while (i--) { #ifndef LCD_FEEDBACK_FREQUENCY_DURATION_MS
WRITE(BEEPER,HIGH); #define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2
delayMicroseconds(delay); #endif
WRITE(BEEPER,LOW); delay(LCD_FEEDBACK_FREQUENCY_DURATION_MS);
delayMicroseconds(delay);
}
const uint16_t j = max(10000 - LCD_FEEDBACK_FREQUENCY_DURATION_MS * 1000, 0);
if (j) delayMicroseconds(j);
#endif #endif
} }
...@@ -1493,16 +1488,11 @@ void lcd_update() { ...@@ -1493,16 +1488,11 @@ void lcd_update() {
else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10; else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10;
#ifdef ENCODER_RATE_MULTIPLIER_DEBUG #ifdef ENCODER_RATE_MULTIPLIER_DEBUG
SERIAL_ECHO_START; ECHO_SMV(DB, "Enc Step Rate: ", encoderStepRate);
SERIAL_ECHO("Enc Step Rate: "); ECHO_MV(" Multiplier: ", encoderMultiplier);
SERIAL_ECHO(encoderStepRate); ECHO_MV(" ENCODER_10X_STEPS_PER_SEC: ", ENCODER_10X_STEPS_PER_SEC);
SERIAL_ECHO(" Multiplier: "); ECHO_EMV(" ENCODER_100X_STEPS_PER_SEC: ", ENCODER_100X_STEPS_PER_SEC);
SERIAL_ECHO(encoderMultiplier); #endif
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
} }
lastEncoderMovementMillis = ms; lastEncoderMovementMillis = ms;
...@@ -1567,9 +1557,9 @@ void lcd_ignore_click(bool b) { ...@@ -1567,9 +1557,9 @@ void lcd_ignore_click(bool b) {
void lcd_finishstatus(bool persist=false) { void lcd_finishstatus(bool persist=false) {
#ifdef LCD_PROGRESS_BAR #ifdef LCD_PROGRESS_BAR
progressBarTick = millis(); progress_bar_ms = millis();
#if PROGRESS_MSG_EXPIRE > 0 #if PROGRESS_MSG_EXPIRE > 0
expireStatusMillis = persist ? 0 : progressBarTick + PROGRESS_MSG_EXPIRE; expire_status_ms = persist ? 0 : progress_bar_ms + PROGRESS_MSG_EXPIRE;
#endif #endif
#endif #endif
lcdDrawUpdate = 2; lcdDrawUpdate = 2;
...@@ -1580,7 +1570,7 @@ void lcd_finishstatus(bool persist=false) { ...@@ -1580,7 +1570,7 @@ void lcd_finishstatus(bool persist=false) {
} }
#if defined(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0 #if defined(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
void dontExpireStatus() { expireStatusMillis = 0; } void dontExpireStatus() { expire_status_ms = 0; }
#endif #endif
void set_utf_strlen(char *s, uint8_t n) { void set_utf_strlen(char *s, uint8_t n) {
...@@ -1593,6 +1583,8 @@ void set_utf_strlen(char *s, uint8_t n) { ...@@ -1593,6 +1583,8 @@ void set_utf_strlen(char *s, uint8_t n) {
s[i] = 0; s[i] = 0;
} }
bool lcd_hasstatus() { return (lcd_status_message[0] != '\0'); }
void lcd_setstatus(const char* message, bool persist) { void lcd_setstatus(const char* message, bool persist) {
if (lcd_status_message_level > 0) return; if (lcd_status_message_level > 0) return;
strncpy(lcd_status_message, message, 3*LCD_WIDTH); strncpy(lcd_status_message, message, 3*LCD_WIDTH);
...@@ -1718,9 +1710,20 @@ bool lcd_detected(void) { ...@@ -1718,9 +1710,20 @@ bool lcd_detected(void) {
} }
void lcd_buzz(long duration, uint16_t freq) { void lcd_buzz(long duration, uint16_t freq) {
#ifdef LCD_USE_I2C_BUZZER if (freq > 0) {
lcd.buzz(duration,freq); #if BEEPER > 0
#endif SET_OUTPUT(BEEPER);
tone(BEEPER, freq, duration);
delay(duration);
#elif defined(LCD_USE_I2C_BUZZER)
lcd.buzz(duration, freq);
#else
delay(duration);
#endif
}
else {
delay(duration);
}
} }
bool lcd_clicked() { return LCD_CLICKED; } bool lcd_clicked() { return LCD_CLICKED; }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
int lcd_strlen_P(const char *s); int lcd_strlen_P(const char *s);
void lcd_update(); void lcd_update();
void lcd_init(); void lcd_init();
bool lcd_hasstatus();
void lcd_setstatus(const char* message, const bool persist=false); void lcd_setstatus(const char* message, const bool persist=false);
void lcd_setstatuspgm(const char* message, const uint8_t level=0); void lcd_setstatuspgm(const char* message, const uint8_t level=0);
void lcd_setalertstatuspgm(const char* message); void lcd_setalertstatuspgm(const char* message);
...@@ -108,6 +109,7 @@ ...@@ -108,6 +109,7 @@
#else //no LCD #else //no LCD
FORCE_INLINE void lcd_update() {} FORCE_INLINE void lcd_update() {}
FORCE_INLINE void lcd_init() {} FORCE_INLINE void lcd_init() {}
FORCE_INLINE bool lcd_hasstatus() { return false; }
FORCE_INLINE void lcd_setstatus(const char* message, const bool persist=false) {} FORCE_INLINE void lcd_setstatus(const char* message, const bool persist=false) {}
FORCE_INLINE void lcd_setstatuspgm(const char* message, const uint8_t level=0) {} FORCE_INLINE void lcd_setstatuspgm(const char* message, const uint8_t level=0) {}
FORCE_INLINE void lcd_buttons_update() {} FORCE_INLINE void lcd_buttons_update() {}
...@@ -115,8 +117,8 @@ ...@@ -115,8 +117,8 @@
FORCE_INLINE void lcd_buzz(long duration,uint16_t freq) {} FORCE_INLINE void lcd_buzz(long duration,uint16_t freq) {}
FORCE_INLINE bool lcd_detected(void) { return true; } FORCE_INLINE bool lcd_detected(void) { return true; }
#define LCD_MESSAGEPGM(x) #define LCD_MESSAGEPGM(x) do{}while(0)
#define LCD_ALERTMESSAGEPGM(x) #define LCD_ALERTMESSAGEPGM(x) do{}while(0)
#endif //ULTRA_LCD #endif //ULTRA_LCD
......
...@@ -202,9 +202,9 @@ ...@@ -202,9 +202,9 @@
#include "utf_mapper.h" #include "utf_mapper.h"
#ifdef LCD_PROGRESS_BAR #ifdef LCD_PROGRESS_BAR
static uint16_t progressBarTick = 0; static millis_t progress_bar_ms = 0;
#if PROGRESS_MSG_EXPIRE > 0 #if PROGRESS_MSG_EXPIRE > 0
static uint16_t expireStatusMillis = 0; static millis_t expire_status_ms = 0;
#endif #endif
#define LCD_STR_PROGRESS "\x03\x04\x05" #define LCD_STR_PROGRESS "\x03\x04\x05"
#endif #endif
...@@ -634,8 +634,9 @@ static void lcd_implementation_status_screen() { ...@@ -634,8 +634,9 @@ static void lcd_implementation_status_screen() {
#ifdef LCD_PROGRESS_BAR #ifdef LCD_PROGRESS_BAR
if (card.isFileOpen()) { if (card.isFileOpen()) {
if (millis() >= progressBarTick + PROGRESS_BAR_MSG_TIME || !lcd_status_message[0]) { // Draw the progress bar if the message has shown long enough
// draw the progress bar // or if there is no message set.
if (millis() >= progress_bar_ms + PROGRESS_BAR_MSG_TIME || !lcd_status_message[0]) {
int tix = (int)(card.percentDone() * LCD_WIDTH * 3) / 100, int tix = (int)(card.percentDone() * LCD_WIDTH * 3) / 100,
cel = tix / 3, rem = tix % 3, i = LCD_WIDTH; cel = tix / 3, rem = tix % 3, i = LCD_WIDTH;
char msg[LCD_WIDTH+1], b = ' '; char msg[LCD_WIDTH+1], b = ' ';
......
...@@ -60,14 +60,10 @@ void vector_3::apply_rotation(matrix_3x3 matrix) { ...@@ -60,14 +60,10 @@ void vector_3::apply_rotation(matrix_3x3 matrix) {
} }
void vector_3::debug(const char title[]) { void vector_3::debug(const char title[]) {
SERIAL_PROTOCOL(title); ECHO_SV(DB, title);
SERIAL_PROTOCOLPGM(" x: "); ECHO_MV(" x: ", x, 6);
SERIAL_PROTOCOL_F(x, 6); ECHO_MV(" y: ", y, 6);
SERIAL_PROTOCOLPGM(" y: "); ECHO_EMV(" z: ", z, 6);
SERIAL_PROTOCOL_F(y, 6);
SERIAL_PROTOCOLPGM(" z: ");
SERIAL_PROTOCOL_F(z, 6);
SERIAL_EOL;
} }
void apply_rotation_xyz(matrix_3x3 matrix, float &x, float& y, float& z) { void apply_rotation_xyz(matrix_3x3 matrix, float &x, float& y, float& z) {
...@@ -121,18 +117,18 @@ matrix_3x3 matrix_3x3::transpose(matrix_3x3 original) { ...@@ -121,18 +117,18 @@ matrix_3x3 matrix_3x3::transpose(matrix_3x3 original) {
} }
void matrix_3x3::debug(const char title[]) { void matrix_3x3::debug(const char title[]) {
SERIAL_PROTOCOLLN(title); ECHO_LV(DB, title);
int count = 0; int count = 0;
for(int i=0; i<3; i++) { for(int i = 0; i < 3; i++) {
for(int j=0; j<3; j++) { ECHO_S(DB);
if (matrix[count] >= 0.0) SERIAL_PROTOCOLCHAR('+'); for(int j = 0; j < 3; j++) {
SERIAL_PROTOCOL_F(matrix[count], 6); if (matrix[count] >= 0.0) ECHO_C('+');
SERIAL_PROTOCOLCHAR(' '); ECHO_V(matrix[count], 6);
ECHO_C(' ');
count++; count++;
} }
SERIAL_EOL; ECHO_E;
} }
} }
#endif // ENABLE_AUTO_BED_LEVELING #endif // ENABLE_AUTO_BED_LEVELING
...@@ -43,11 +43,10 @@ void watchdog_reset() ...@@ -43,11 +43,10 @@ void watchdog_reset()
#ifdef WATCHDOG_RESET_MANUAL #ifdef WATCHDOG_RESET_MANUAL
ISR(WDT_vect) ISR(WDT_vect)
{ {
ECHO_LM(MSG_WATCHDOG_RESET);
//TODO: This message gets overwritten by the kill() call //TODO: This message gets overwritten by the kill() call
LCD_ALERTMESSAGEPGM("ERR:Please Reset");//16 characters so it fits on a 16x2 display LCD_ALERTMESSAGEPGM("ERR:Please Reset");//16 characters so it fits on a 16x2 display
lcd_update(); lcd_update();
SERIAL_ERROR_START;
SERIAL_ERRORLNPGM("Something is wrong, please turn off the printer.");
kill(); //kill blocks kill(); //kill blocks
while(1); //wait for user or serial reset while(1); //wait for user or serial reset
} }
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
* [Filament Sensor](/Documentation/FilamentSensor.md) * [Filament Sensor](/Documentation/FilamentSensor.md)
* [Ramps Servo Power](/Documentation/RampsServoPower.md) * [Ramps Servo Power](/Documentation/RampsServoPower.md)
* [LCD Language - Font - System](Documentation/LCDLanguageFont.md) * [LCD Language - Font - System](Documentation/LCDLanguageFont.md)
* Version
* [Change Log](/Documentation/changelog.md)
## Configurator Tool Online ## Configurator Tool Online
...@@ -34,13 +36,17 @@ Adding Debug Dryrun used by repetier. ...@@ -34,13 +36,17 @@ Adding Debug Dryrun used by repetier.
## Credits ## Credits
The current MarlinKimbra dev team consists of: The current MarlinKimbra dev team consists of:
- MagoKimbra - Alberto Cotronei (https://github.com/MagoKimbra)
- MagoKimbra (https://github.com/MagoKimbra)
More features have been added by: More features have been added by:
<<<<<<< HEAD
- simone97 (https://github.com/simone97) - simone97 (https://github.com/simone97)
- -
=======
- simone97 (https://github.com/simone97)
-
>>>>>>> origin/master
## License ## License
......
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