Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 12a4d60e18 | |||
| 5a998558a9 | |||
| f6ff0ab767 | |||
| 5d471e0f34 | |||
| d3ebc34958 | |||
| b6ff45254e | |||
| 7e348fcb5f |
@@ -0,0 +1,24 @@
|
|||||||
|
#ifndef CONFIG_STORE_H
|
||||||
|
#define CONFIG_STORE_H
|
||||||
|
|
||||||
|
#include "Configuration.h"
|
||||||
|
|
||||||
|
#ifdef EEPROM_SETTINGS
|
||||||
|
void Config_StoreSettings();
|
||||||
|
void Config_RetrieveSettings();
|
||||||
|
#else
|
||||||
|
FORCE_INLINE void Config_StoreSettings() {}
|
||||||
|
FORCE_INLINE void Config_RetrieveSettings() {}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef EEPROM_CHITCHAT
|
||||||
|
void Config_PrintSettings();
|
||||||
|
#else
|
||||||
|
FORCE_INLINE void Config_PrintSettings() {}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void Config_ResetDefault();
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -179,15 +179,16 @@
|
|||||||
|
|
||||||
|
|
||||||
#define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers?
|
#define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers?
|
||||||
#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // no z because of layer shift.
|
#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
|
||||||
|
|
||||||
// The hardware watchdog should reset the Microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
|
// The hardware watchdog should reset the Microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
|
||||||
#define USE_WATCHDOG
|
//#define USE_WATCHDOG
|
||||||
|
|
||||||
#ifdef USE_WATCHDOG
|
#ifdef USE_WATCHDOG
|
||||||
// you cannot watchdog reboot on Arduino mega2560 due to a bug in he bootloader. Hence we need to ask the user to reset.
|
// If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
|
||||||
// THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
|
// The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
|
||||||
//#define RESET_MANUAL
|
// However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
|
||||||
|
//#define WATCHDOG_RESET_MANUAL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// extruder advance constant (s2/mm3)
|
// extruder advance constant (s2/mm3)
|
||||||
|
|||||||
@@ -1,224 +0,0 @@
|
|||||||
#ifndef EEPROM_H
|
|
||||||
#define EEPROM_H
|
|
||||||
|
|
||||||
#include "Marlin.h"
|
|
||||||
#include "planner.h"
|
|
||||||
#include "temperature.h"
|
|
||||||
//#include <EEPROM.h>
|
|
||||||
|
|
||||||
template <class T> int EEPROM_writeAnything(int &ee, const T& value)
|
|
||||||
{
|
|
||||||
const byte* p = (const byte*)(const void*)&value;
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < (int)sizeof(value); i++)
|
|
||||||
eeprom_write_byte((unsigned char *)ee++, *p++);
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T> int EEPROM_readAnything(int &ee, T& value)
|
|
||||||
{
|
|
||||||
byte* p = (byte*)(void*)&value;
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < (int)sizeof(value); i++)
|
|
||||||
*p++ = eeprom_read_byte((unsigned char *)ee++);
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
//======================================================================================
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define EEPROM_OFFSET 100
|
|
||||||
|
|
||||||
|
|
||||||
// IMPORTANT: Whenever there are changes made to the variables stored in EEPROM
|
|
||||||
// in the functions below, also increment the version number. This makes sure that
|
|
||||||
// the default values are used whenever there is a change to the data, to prevent
|
|
||||||
// wrong data being written to the variables.
|
|
||||||
// ALSO: always make sure the variables in the Store and retrieve sections are in the same order.
|
|
||||||
#define EEPROM_VERSION "V07"
|
|
||||||
|
|
||||||
inline void EEPROM_StoreSettings()
|
|
||||||
{
|
|
||||||
#ifdef EEPROM_SETTINGS
|
|
||||||
char ver[4]= "000";
|
|
||||||
int i=EEPROM_OFFSET;
|
|
||||||
EEPROM_writeAnything(i,ver); // invalidate data first
|
|
||||||
EEPROM_writeAnything(i,axis_steps_per_unit);
|
|
||||||
EEPROM_writeAnything(i,max_feedrate);
|
|
||||||
EEPROM_writeAnything(i,max_acceleration_units_per_sq_second);
|
|
||||||
EEPROM_writeAnything(i,acceleration);
|
|
||||||
EEPROM_writeAnything(i,retract_acceleration);
|
|
||||||
EEPROM_writeAnything(i,minimumfeedrate);
|
|
||||||
EEPROM_writeAnything(i,mintravelfeedrate);
|
|
||||||
EEPROM_writeAnything(i,minsegmenttime);
|
|
||||||
EEPROM_writeAnything(i,max_xy_jerk);
|
|
||||||
EEPROM_writeAnything(i,max_z_jerk);
|
|
||||||
EEPROM_writeAnything(i,max_e_jerk);
|
|
||||||
EEPROM_writeAnything(i,add_homeing);
|
|
||||||
EEPROM_writeAnything(i,plaPreheatHotendTemp);
|
|
||||||
EEPROM_writeAnything(i,plaPreheatHPBTemp);
|
|
||||||
EEPROM_writeAnything(i,plaPreheatFanSpeed);
|
|
||||||
EEPROM_writeAnything(i,absPreheatHotendTemp);
|
|
||||||
EEPROM_writeAnything(i,absPreheatHPBTemp);
|
|
||||||
EEPROM_writeAnything(i,absPreheatFanSpeed);
|
|
||||||
#ifdef PIDTEMP
|
|
||||||
EEPROM_writeAnything(i,Kp);
|
|
||||||
EEPROM_writeAnything(i,Ki);
|
|
||||||
EEPROM_writeAnything(i,Kd);
|
|
||||||
#else
|
|
||||||
EEPROM_writeAnything(i,3000);
|
|
||||||
EEPROM_writeAnything(i,0);
|
|
||||||
EEPROM_writeAnything(i,0);
|
|
||||||
#endif
|
|
||||||
char ver2[4]=EEPROM_VERSION;
|
|
||||||
i=EEPROM_OFFSET;
|
|
||||||
EEPROM_writeAnything(i,ver2); // validate data
|
|
||||||
SERIAL_ECHO_START;
|
|
||||||
SERIAL_ECHOLNPGM("Settings Stored");
|
|
||||||
#endif //EEPROM_SETTINGS
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline void EEPROM_printSettings()
|
|
||||||
{ // if def=true, the default values will be used
|
|
||||||
// #ifdef EEPROM_SETTINGS
|
|
||||||
SERIAL_ECHO_START;
|
|
||||||
SERIAL_ECHOLNPGM("Steps per unit:");
|
|
||||||
SERIAL_ECHO_START;
|
|
||||||
SERIAL_ECHOPAIR(" M92 X",axis_steps_per_unit[0]);
|
|
||||||
SERIAL_ECHOPAIR(" Y",axis_steps_per_unit[1]);
|
|
||||||
SERIAL_ECHOPAIR(" Z",axis_steps_per_unit[2]);
|
|
||||||
SERIAL_ECHOPAIR(" E",axis_steps_per_unit[3]);
|
|
||||||
SERIAL_ECHOLN("");
|
|
||||||
|
|
||||||
SERIAL_ECHO_START;
|
|
||||||
SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):");
|
|
||||||
SERIAL_ECHO_START;
|
|
||||||
SERIAL_ECHOPAIR(" M203 X",max_feedrate[0]);
|
|
||||||
SERIAL_ECHOPAIR(" Y",max_feedrate[1] );
|
|
||||||
SERIAL_ECHOPAIR(" Z", max_feedrate[2] );
|
|
||||||
SERIAL_ECHOPAIR(" E", max_feedrate[3]);
|
|
||||||
SERIAL_ECHOLN("");
|
|
||||||
SERIAL_ECHO_START;
|
|
||||||
SERIAL_ECHOLNPGM("Maximum Acceleration (mm/s2):");
|
|
||||||
SERIAL_ECHO_START;
|
|
||||||
SERIAL_ECHOPAIR(" M201 X" ,max_acceleration_units_per_sq_second[0] );
|
|
||||||
SERIAL_ECHOPAIR(" Y" , max_acceleration_units_per_sq_second[1] );
|
|
||||||
SERIAL_ECHOPAIR(" Z" ,max_acceleration_units_per_sq_second[2] );
|
|
||||||
SERIAL_ECHOPAIR(" E" ,max_acceleration_units_per_sq_second[3]);
|
|
||||||
SERIAL_ECHOLN("");
|
|
||||||
SERIAL_ECHO_START;
|
|
||||||
SERIAL_ECHOLNPGM("Acceleration: S=acceleration, T=retract acceleration");
|
|
||||||
SERIAL_ECHO_START;
|
|
||||||
SERIAL_ECHOPAIR(" M204 S",acceleration );
|
|
||||||
SERIAL_ECHOPAIR(" T" ,retract_acceleration);
|
|
||||||
SERIAL_ECHOLN("");
|
|
||||||
SERIAL_ECHO_START;
|
|
||||||
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)");
|
|
||||||
SERIAL_ECHO_START;
|
|
||||||
SERIAL_ECHOPAIR(" M205 S",minimumfeedrate );
|
|
||||||
SERIAL_ECHOPAIR(" T" ,mintravelfeedrate );
|
|
||||||
SERIAL_ECHOPAIR(" B" ,minsegmenttime );
|
|
||||||
SERIAL_ECHOPAIR(" X" ,max_xy_jerk );
|
|
||||||
SERIAL_ECHOPAIR(" Z" ,max_z_jerk);
|
|
||||||
SERIAL_ECHOPAIR(" E" ,max_e_jerk);
|
|
||||||
SERIAL_ECHOLN("");
|
|
||||||
SERIAL_ECHO_START;
|
|
||||||
SERIAL_ECHOLNPGM("Home offset (mm):");
|
|
||||||
SERIAL_ECHO_START;
|
|
||||||
SERIAL_ECHOPAIR(" M206 X",add_homeing[0] );
|
|
||||||
SERIAL_ECHOPAIR(" Y" ,add_homeing[1] );
|
|
||||||
SERIAL_ECHOPAIR(" Z" ,add_homeing[2] );
|
|
||||||
SERIAL_ECHOLN("");
|
|
||||||
#ifdef PIDTEMP
|
|
||||||
SERIAL_ECHO_START;
|
|
||||||
SERIAL_ECHOLNPGM("PID settings:");
|
|
||||||
SERIAL_ECHO_START;
|
|
||||||
SERIAL_ECHOPAIR(" M301 P",Kp);
|
|
||||||
SERIAL_ECHOPAIR(" I" ,Ki/PID_dT);
|
|
||||||
SERIAL_ECHOPAIR(" D" ,Kd*PID_dT);
|
|
||||||
SERIAL_ECHOLN("");
|
|
||||||
#endif
|
|
||||||
// #endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline void EEPROM_RetrieveSettings(bool def=false)
|
|
||||||
{ // if def=true, the default values will be used
|
|
||||||
#ifdef EEPROM_SETTINGS
|
|
||||||
int i=EEPROM_OFFSET;
|
|
||||||
char stored_ver[4];
|
|
||||||
char ver[4]=EEPROM_VERSION;
|
|
||||||
EEPROM_readAnything(i,stored_ver); //read stored version
|
|
||||||
// SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << stored_ver << "]");
|
|
||||||
if ((!def)&&(strncmp(ver,stored_ver,3)==0))
|
|
||||||
{ // version number match
|
|
||||||
EEPROM_readAnything(i,axis_steps_per_unit);
|
|
||||||
EEPROM_readAnything(i,max_feedrate);
|
|
||||||
EEPROM_readAnything(i,max_acceleration_units_per_sq_second);
|
|
||||||
EEPROM_readAnything(i,acceleration);
|
|
||||||
EEPROM_readAnything(i,retract_acceleration);
|
|
||||||
EEPROM_readAnything(i,minimumfeedrate);
|
|
||||||
EEPROM_readAnything(i,mintravelfeedrate);
|
|
||||||
EEPROM_readAnything(i,minsegmenttime);
|
|
||||||
EEPROM_readAnything(i,max_xy_jerk);
|
|
||||||
EEPROM_readAnything(i,max_z_jerk);
|
|
||||||
EEPROM_readAnything(i,max_e_jerk);
|
|
||||||
EEPROM_readAnything(i,add_homeing);
|
|
||||||
EEPROM_readAnything(i,plaPreheatHotendTemp);
|
|
||||||
EEPROM_readAnything(i,plaPreheatHPBTemp);
|
|
||||||
EEPROM_readAnything(i,plaPreheatFanSpeed);
|
|
||||||
EEPROM_readAnything(i,absPreheatHotendTemp);
|
|
||||||
EEPROM_readAnything(i,absPreheatHPBTemp);
|
|
||||||
EEPROM_readAnything(i,absPreheatFanSpeed);
|
|
||||||
#ifndef PIDTEMP
|
|
||||||
float Kp,Ki,Kd;
|
|
||||||
#endif
|
|
||||||
EEPROM_readAnything(i,Kp);
|
|
||||||
EEPROM_readAnything(i,Ki);
|
|
||||||
EEPROM_readAnything(i,Kd);
|
|
||||||
|
|
||||||
SERIAL_ECHO_START;
|
|
||||||
SERIAL_ECHOLNPGM("Stored settings retreived:");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
float tmp1[]=DEFAULT_AXIS_STEPS_PER_UNIT;
|
|
||||||
float tmp2[]=DEFAULT_MAX_FEEDRATE;
|
|
||||||
long tmp3[]=DEFAULT_MAX_ACCELERATION;
|
|
||||||
for (short i=0;i<4;i++)
|
|
||||||
{
|
|
||||||
axis_steps_per_unit[i]=tmp1[i];
|
|
||||||
max_feedrate[i]=tmp2[i];
|
|
||||||
max_acceleration_units_per_sq_second[i]=tmp3[i];
|
|
||||||
}
|
|
||||||
acceleration=DEFAULT_ACCELERATION;
|
|
||||||
retract_acceleration=DEFAULT_RETRACT_ACCELERATION;
|
|
||||||
minimumfeedrate=DEFAULT_MINIMUMFEEDRATE;
|
|
||||||
minsegmenttime=DEFAULT_MINSEGMENTTIME;
|
|
||||||
mintravelfeedrate=DEFAULT_MINTRAVELFEEDRATE;
|
|
||||||
max_xy_jerk=DEFAULT_XYJERK;
|
|
||||||
max_z_jerk=DEFAULT_ZJERK;
|
|
||||||
max_e_jerk=DEFAULT_EJERK;
|
|
||||||
add_homeing[0] = add_homeing[1] = add_homeing[2] = 0;
|
|
||||||
SERIAL_ECHO_START;
|
|
||||||
SERIAL_ECHOLN("Using Default settings:");
|
|
||||||
#ifdef ULTIPANEL
|
|
||||||
plaPreheatHotendTemp = PLA_PREHEAT_HOTEND_TEMP;
|
|
||||||
plaPreheatHPBTemp = PLA_PREHEAT_HPB_TEMP;
|
|
||||||
plaPreheatFanSpeed = PLA_PREHEAT_FAN_SPEED;
|
|
||||||
absPreheatHotendTemp = ABS_PREHEAT_HOTEND_TEMP;
|
|
||||||
absPreheatHPBTemp = ABS_PREHEAT_HPB_TEMP;
|
|
||||||
absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#ifdef EEPROM_CHITCHAT
|
|
||||||
EEPROM_printSettings();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
#include <util/delay.h>
|
#include <util/delay.h>
|
||||||
#include <avr/pgmspace.h>
|
#include <avr/pgmspace.h>
|
||||||
#include <avr/eeprom.h>
|
#include <avr/eeprom.h>
|
||||||
#include <avr/wdt.h>
|
|
||||||
#include <avr/interrupt.h>
|
#include <avr/interrupt.h>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,11 @@
|
|||||||
// These are macros to build serial port register names for the selected SERIAL_PORT (C preprocessor
|
// These are macros to build serial port register names for the selected SERIAL_PORT (C preprocessor
|
||||||
// requires two levels of indirection to expand macro values properly)
|
// requires two levels of indirection to expand macro values properly)
|
||||||
#define SERIAL_REGNAME(registerbase,number,suffix) SERIAL_REGNAME_INTERNAL(registerbase,number,suffix)
|
#define SERIAL_REGNAME(registerbase,number,suffix) SERIAL_REGNAME_INTERNAL(registerbase,number,suffix)
|
||||||
|
#if SERIAL_PORT == 0 && !defined(UBRR0H)
|
||||||
|
#define SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) registerbase##suffix
|
||||||
|
#else
|
||||||
#define SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) registerbase##number##suffix
|
#define SERIAL_REGNAME_INTERNAL(registerbase,number,suffix) registerbase##number##suffix
|
||||||
|
#endif
|
||||||
|
|
||||||
// Registers used by MarlinSerial class (these are expanded
|
// Registers used by MarlinSerial class (these are expanded
|
||||||
// depending on selected serial port
|
// depending on selected serial port
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
#include "motion_control.h"
|
#include "motion_control.h"
|
||||||
#include "cardreader.h"
|
#include "cardreader.h"
|
||||||
#include "watchdog.h"
|
#include "watchdog.h"
|
||||||
#include "EEPROMwrite.h"
|
#include "ConfigurationStore.h"
|
||||||
#include "language.h"
|
#include "language.h"
|
||||||
#include "pins_arduino.h"
|
#include "pins_arduino.h"
|
||||||
|
|
||||||
@@ -322,7 +322,7 @@ void setup()
|
|||||||
fromsd[i] = false;
|
fromsd[i] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
EEPROM_RetrieveSettings(); // loads data from EEPROM if available
|
Config_RetrieveSettings(); // loads data from EEPROM if available
|
||||||
|
|
||||||
for(int8_t i=0; i < NUM_AXIS; i++)
|
for(int8_t i=0; i < NUM_AXIS; i++)
|
||||||
{
|
{
|
||||||
@@ -1457,22 +1457,22 @@ void process_commands()
|
|||||||
break;
|
break;
|
||||||
case 500: // Store settings in EEPROM
|
case 500: // Store settings in EEPROM
|
||||||
{
|
{
|
||||||
EEPROM_StoreSettings();
|
Config_StoreSettings();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 501: // Read settings from EEPROM
|
case 501: // Read settings from EEPROM
|
||||||
{
|
{
|
||||||
EEPROM_RetrieveSettings();
|
Config_RetrieveSettings();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 502: // Revert to default settings
|
case 502: // Revert to default settings
|
||||||
{
|
{
|
||||||
EEPROM_RetrieveSettings(true);
|
Config_ResetDefault();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 503: // print settings currently in memory
|
case 503: // print settings currently in memory
|
||||||
{
|
{
|
||||||
EEPROM_printSettings();
|
Config_PrintSettings();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 999: // Restart after being stopped
|
case 999: // Restart after being stopped
|
||||||
|
|||||||
+12
-12
@@ -5,7 +5,7 @@
|
|||||||
#include "Marlin.h"
|
#include "Marlin.h"
|
||||||
#include "language.h"
|
#include "language.h"
|
||||||
#include "temperature.h"
|
#include "temperature.h"
|
||||||
#include "EEPROMwrite.h"
|
#include "ConfigurationStore.h"
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
//=============================imported variables============================
|
//=============================imported variables============================
|
||||||
@@ -53,9 +53,9 @@ static unsigned long previous_millis_lcd=0;
|
|||||||
|
|
||||||
|
|
||||||
#ifdef NEWPANEL
|
#ifdef NEWPANEL
|
||||||
static long blocking=0;
|
static unsigned long blocking=0;
|
||||||
#else
|
#else
|
||||||
static long blocking[8]={0,0,0,0,0,0,0,0};
|
static unsigned long blocking[8]={0,0,0,0,0,0,0,0};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static MainMenu menu;
|
static MainMenu menu;
|
||||||
@@ -225,7 +225,7 @@ void lcd_status()
|
|||||||
//static long previous_lcdinit=0;
|
//static long previous_lcdinit=0;
|
||||||
// buttons_check(); // Done in temperature interrupt
|
// buttons_check(); // Done in temperature interrupt
|
||||||
//previous_millis_buttons=millis();
|
//previous_millis_buttons=millis();
|
||||||
long ms=millis();
|
unsigned long ms=millis();
|
||||||
for(int8_t i=0; i<8; i++) {
|
for(int8_t i=0; i<8; i++) {
|
||||||
#ifndef NEWPANEL
|
#ifndef NEWPANEL
|
||||||
if((blocking[i]>ms))
|
if((blocking[i]>ms))
|
||||||
@@ -2220,7 +2220,7 @@ void MainMenu::showControl()
|
|||||||
//enquecommand("M84");
|
//enquecommand("M84");
|
||||||
beepshort();
|
beepshort();
|
||||||
BLOCK;
|
BLOCK;
|
||||||
EEPROM_StoreSettings();
|
Config_StoreSettings();
|
||||||
}
|
}
|
||||||
}break;
|
}break;
|
||||||
case ItemC_load:
|
case ItemC_load:
|
||||||
@@ -2234,7 +2234,7 @@ void MainMenu::showControl()
|
|||||||
//enquecommand("M84");
|
//enquecommand("M84");
|
||||||
beepshort();
|
beepshort();
|
||||||
BLOCK;
|
BLOCK;
|
||||||
EEPROM_RetrieveSettings();
|
Config_RetrieveSettings();
|
||||||
}
|
}
|
||||||
}break;
|
}break;
|
||||||
case ItemC_failsafe:
|
case ItemC_failsafe:
|
||||||
@@ -2248,7 +2248,7 @@ void MainMenu::showControl()
|
|||||||
//enquecommand("M84");
|
//enquecommand("M84");
|
||||||
beepshort();
|
beepshort();
|
||||||
BLOCK;
|
BLOCK;
|
||||||
EEPROM_RetrieveSettings(true);
|
Config_ResetDefault();
|
||||||
}
|
}
|
||||||
}break;
|
}break;
|
||||||
default:
|
default:
|
||||||
@@ -2365,7 +2365,7 @@ void MainMenu::showSD()
|
|||||||
card.getfilename(i-FIRSTITEM);
|
card.getfilename(i-FIRSTITEM);
|
||||||
if(card.filenameIsDir)
|
if(card.filenameIsDir)
|
||||||
{
|
{
|
||||||
for(int8_t i=0;i<strlen(card.filename);i++)
|
for(uint8_t i=0;i<strlen(card.filename);i++)
|
||||||
card.filename[i]=tolower(card.filename[i]);
|
card.filename[i]=tolower(card.filename[i]);
|
||||||
card.chdir(card.filename);
|
card.chdir(card.filename);
|
||||||
lineoffset=0;
|
lineoffset=0;
|
||||||
@@ -2374,7 +2374,7 @@ void MainMenu::showSD()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
char cmd[30];
|
char cmd[30];
|
||||||
for(int8_t i=0;i<strlen(card.filename);i++)
|
for(uint8_t i=0;i<strlen(card.filename);i++)
|
||||||
card.filename[i]=tolower(card.filename[i]);
|
card.filename[i]=tolower(card.filename[i]);
|
||||||
sprintf(cmd,"M23 %s",card.filename);
|
sprintf(cmd,"M23 %s",card.filename);
|
||||||
//sprintf(cmd,"M115");
|
//sprintf(cmd,"M115");
|
||||||
@@ -2549,7 +2549,7 @@ void MainMenu::showMainMenu()
|
|||||||
void MainMenu::update()
|
void MainMenu::update()
|
||||||
{
|
{
|
||||||
static MainStatus oldstatus=Main_Menu; //init automatically causes foce_lcd_update=true
|
static MainStatus oldstatus=Main_Menu; //init automatically causes foce_lcd_update=true
|
||||||
static long timeoutToStatus=0;
|
static unsigned long timeoutToStatus=0;
|
||||||
static bool oldcardstatus=false;
|
static bool oldcardstatus=false;
|
||||||
#ifdef CARDINSERTED
|
#ifdef CARDINSERTED
|
||||||
if((CARDINSERTED != oldcardstatus))
|
if((CARDINSERTED != oldcardstatus))
|
||||||
@@ -2785,7 +2785,7 @@ void MainMenu::showPLAsettings()
|
|||||||
//enquecommand("M84");
|
//enquecommand("M84");
|
||||||
beepshort();
|
beepshort();
|
||||||
BLOCK;
|
BLOCK;
|
||||||
EEPROM_StoreSettings();
|
Config_StoreSettings();
|
||||||
}
|
}
|
||||||
}break;
|
}break;
|
||||||
default:
|
default:
|
||||||
@@ -2931,7 +2931,7 @@ void MainMenu::showABSsettings()
|
|||||||
//enquecommand("M84");
|
//enquecommand("M84");
|
||||||
beepshort();
|
beepshort();
|
||||||
BLOCK;
|
BLOCK;
|
||||||
EEPROM_StoreSettings();
|
Config_StoreSettings();
|
||||||
}
|
}
|
||||||
}break;
|
}break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
+8
-6
@@ -1,6 +1,8 @@
|
|||||||
#include "Marlin.h"
|
#include "Marlin.h"
|
||||||
|
|
||||||
#ifdef USE_WATCHDOG
|
#ifdef USE_WATCHDOG
|
||||||
|
#include <avr/wdt.h>
|
||||||
|
|
||||||
#include "watchdog.h"
|
#include "watchdog.h"
|
||||||
#include "ultralcd.h"
|
#include "ultralcd.h"
|
||||||
|
|
||||||
@@ -16,7 +18,7 @@
|
|||||||
/// intialise watch dog with a 1 sec interrupt time
|
/// intialise watch dog with a 1 sec interrupt time
|
||||||
void watchdog_init()
|
void watchdog_init()
|
||||||
{
|
{
|
||||||
#ifdef RESET_MANUAL
|
#ifdef WATCHDOG_RESET_MANUAL
|
||||||
//We enable the watchdog timer, but only for the interrupt.
|
//We enable the watchdog timer, but only for the interrupt.
|
||||||
//Take care, as this requires the correct order of operation, with interrupts disabled. See the datasheet of any AVR chip for details.
|
//Take care, as this requires the correct order of operation, with interrupts disabled. See the datasheet of any AVR chip for details.
|
||||||
wdt_reset();
|
wdt_reset();
|
||||||
@@ -30,7 +32,7 @@ void watchdog_init()
|
|||||||
/// reset watchdog. MUST be called every 1s after init or avr will reset.
|
/// reset watchdog. MUST be called every 1s after init or avr will reset.
|
||||||
void watchdog_reset()
|
void watchdog_reset()
|
||||||
{
|
{
|
||||||
wdt_reset();
|
wdt_reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
@@ -38,14 +40,14 @@ void watchdog_reset()
|
|||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
//Watchdog timer interrupt, called if main program blocks >1sec and manual reset is enabled.
|
//Watchdog timer interrupt, called if main program blocks >1sec and manual reset is enabled.
|
||||||
#ifdef RESET_MANUAL
|
#ifdef WATCHDOG_RESET_MANUAL
|
||||||
ISR(WDT_vect)
|
ISR(WDT_vect)
|
||||||
{
|
{
|
||||||
|
//TODO: This message gets overwritten by the kill() call
|
||||||
LCD_MESSAGEPGM("ERR:Please Reset");//16 characters so it fits on a 16x2 display
|
LCD_MESSAGEPGM("ERR:Please Reset");//16 characters so it fits on a 16x2 display
|
||||||
LCD_STATUS;
|
LCD_STATUS;
|
||||||
SERIAL_ERROR_START;
|
SERIAL_ERROR_START;
|
||||||
SERIAL_ERRORLNPGM("Something is wrong, please turn off the printer.");
|
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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user