Merge remote-tracking branch 'origin/Marlin_v1' into Marlin_v1

Conflicts:
	Marlin/Configuration.h
	Marlin/Marlin.pde
This commit is contained in:
Erik van der Zalm 2011-11-18 19:04:09 +01:00
commit e63e224a33
7 changed files with 42 additions and 18 deletions

View File

@ -58,7 +58,6 @@
//#define BED_USES_THERMISTOR //#define BED_USES_THERMISTOR
//#define BED_USES_AD595 //#define BED_USES_AD595
#define HEATER_CHECK_INTERVAL 50 //ms
#define BED_CHECK_INTERVAL 5000 //ms #define BED_CHECK_INTERVAL 5000 //ms
//// Experimental watchdog and minimal temp //// Experimental watchdog and minimal temp
@ -243,10 +242,12 @@ const bool ENDSTOPS_INVERTING = true; // set to true to invert the logic of the
// The watchdog waits for the watchperiod in milliseconds whenever an M104 or M109 increases the target temperature // The watchdog waits for the watchperiod in milliseconds whenever an M104 or M109 increases the target temperature
// this enables the watchdog interrupt. // this enables the watchdog interrupt.
//#define USE_WATCHDOG //#define USE_WATCHDOG
// you cannot reboot on a mega2560 due to a bug in he bootloader. Hence, you have to reset manually, and this is done hereby: #ifdef USE_WATCHDOG
// you cannot reboot on a mega2560 due to a bug in he bootloader. Hence, you have to reset manually, and this is done hereby:
//#define RESET_MANUAL //#define RESET_MANUAL
//#define WATCHDOG_TIMEOUT 4 //seconds //#define WATCHDOG_TIMEOUT 4 //seconds
// extruder advance constant (s2/mm3) // extruder advance constant (s2/mm3)
// //
// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTUDER_ADVANCE_K * cubic mm per second ^ 2 // advance (steps) = STEPS_PER_CUBIC_MM_E * EXTUDER_ADVANCE_K * cubic mm per second ^ 2

View File

@ -100,7 +100,7 @@ void prepare_move();
void kill(); void kill();
void enquecommand(const char *cmd); //put an ascii command at the end of the current buffer. void enquecommand(const char *cmd); //put an ascii command at the end of the current buffer.
void prepare_arc_move(char isclockwise);
#ifndef CRITICAL_SECTION_START #ifndef CRITICAL_SECTION_START
#define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli(); #define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli();

View File

@ -37,6 +37,7 @@
#include "temperature.h" #include "temperature.h"
#include "motion_control.h" #include "motion_control.h"
#include "cardreader.h" #include "cardreader.h"
#include "watchdog.h"
#define VERSION_STRING "1.0.0 Alpha 1" #define VERSION_STRING "1.0.0 Alpha 1"
@ -193,6 +194,12 @@ extern "C"{
} }
//adds an command to the main command buffer //adds an command to the main command buffer
//thats really done in a non-safe way. //thats really done in a non-safe way.
//needs overworking someday //needs overworking someday
@ -235,6 +242,7 @@ void setup()
tp_init(); // Initialize temperature loop tp_init(); // Initialize temperature loop
plan_init(); // Initialize planner; plan_init(); // Initialize planner;
st_init(); // Initialize stepper; st_init(); // Initialize stepper;
wd_init();
} }
@ -659,7 +667,8 @@ inline void process_commands()
break; break;
case 105: // M105 case 105: // M105
//SERIAL_ECHOLN(freeMemory()); //SERIAL_ECHOLN(freeMemory());
//test watchdog:
//delay(20000);
#if (TEMP_0_PIN > -1) || defined (HEATER_USES_AD595) #if (TEMP_0_PIN > -1) || defined (HEATER_USES_AD595)
SERIAL_PROTOCOLPGM("ok T:"); SERIAL_PROTOCOLPGM("ok T:");
SERIAL_PROTOCOL( degHotend0()); SERIAL_PROTOCOL( degHotend0());

View File

@ -33,6 +33,7 @@ public:
inline bool eof() { return sdpos>=filesize ;}; inline bool eof() { return sdpos>=filesize ;};
inline int16_t get() { sdpos = file.curPosition();return (int16_t)file.read();}; inline int16_t get() { sdpos = file.curPosition();return (int16_t)file.read();};
inline void setIndex(long index) {sdpos = index;file.seekSet(index);}; inline void setIndex(long index) {sdpos = index;file.seekSet(index);};
inline uint8_t percentDone(){if(!sdprinting) return 0; if(filesize) return sdpos*100/filesize; else return 0;};
public: public:
bool saving; bool saving;

View File

@ -97,7 +97,7 @@
#define BLOCK ; #define BLOCK ;
#endif #endif
void lcd_statuspgm(const char* message);
#endif //ULTRALCD #endif //ULTRALCD

View File

@ -374,6 +374,17 @@ void MainMenu::showStatus()
lcd.print(fillto(LCD_WIDTH,messagetext)); lcd.print(fillto(LCD_WIDTH,messagetext));
messagetext[0]='\0'; messagetext[0]='\0';
} }
static uint8_t oldpercent=101;
uint8_t percent=card.percentDone();
if(oldpercent!=percent ||force_lcd_update)
{
lcd.setCursor(7,2);
lcd.print(itostr3((int)percent));
lcdprintPGM("%SD");
}
#else //smaller LCDS---------------------------------- #else //smaller LCDS----------------------------------
static int olddegHotEnd0=-1; static int olddegHotEnd0=-1;
static int oldtargetHotEnd0=-1; static int oldtargetHotEnd0=-1;
@ -686,7 +697,7 @@ void MainMenu::showControl()
if(force_lcd_update) if(force_lcd_update)
{ {
lcd.setCursor(0,line);lcdprintPGM(" Vxy-jerk: "); lcd.setCursor(0,line);lcdprintPGM(" Vxy-jerk: ");
lcd.setCursor(13,line);lcd.print(itostr3(max_xy_jerk/60)); lcd.setCursor(13,line);lcd.print(itostr3(max_xy_jerk));
} }
if((activeline==line) ) if((activeline==line) )
@ -696,11 +707,11 @@ void MainMenu::showControl()
linechanging=!linechanging; linechanging=!linechanging;
if(linechanging) if(linechanging)
{ {
encoderpos=(int)max_xy_jerk/60; encoderpos=(int)max_xy_jerk;
} }
else else
{ {
max_xy_jerk= encoderpos*60; max_xy_jerk= encoderpos;
encoderpos=activeline*lcdslow; encoderpos=activeline*lcdslow;
} }
@ -866,7 +877,7 @@ void MainMenu::showControl()
if(i==ItemC_vmaxy)lcdprintPGM("y:"); if(i==ItemC_vmaxy)lcdprintPGM("y:");
if(i==ItemC_vmaxz)lcdprintPGM("z:"); if(i==ItemC_vmaxz)lcdprintPGM("z:");
if(i==ItemC_vmaxe)lcdprintPGM("e:"); if(i==ItemC_vmaxe)lcdprintPGM("e:");
lcd.setCursor(13,line);lcd.print(itostr3(max_feedrate[i-ItemC_vmaxx]/60)); lcd.setCursor(13,line);lcd.print(itostr3(max_feedrate[i-ItemC_vmaxx]));
} }
if((activeline==line) ) if((activeline==line) )
@ -876,11 +887,11 @@ void MainMenu::showControl()
linechanging=!linechanging; linechanging=!linechanging;
if(linechanging) if(linechanging)
{ {
encoderpos=(int)max_feedrate[i-ItemC_vmaxx]/60; encoderpos=(int)max_feedrate[i-ItemC_vmaxx];
} }
else else
{ {
max_feedrate[i-ItemC_vmaxx]= encoderpos*60; max_feedrate[i-ItemC_vmaxx]= encoderpos;
encoderpos=activeline*lcdslow; encoderpos=activeline*lcdslow;
} }
@ -901,7 +912,7 @@ void MainMenu::showControl()
if(force_lcd_update) if(force_lcd_update)
{ {
lcd.setCursor(0,line);lcdprintPGM(" Vmin:"); lcd.setCursor(0,line);lcdprintPGM(" Vmin:");
lcd.setCursor(13,line);lcd.print(itostr3(minimumfeedrate/60)); lcd.setCursor(13,line);lcd.print(itostr3(minimumfeedrate));
} }
if((activeline==line) ) if((activeline==line) )
@ -911,11 +922,11 @@ void MainMenu::showControl()
linechanging=!linechanging; linechanging=!linechanging;
if(linechanging) if(linechanging)
{ {
encoderpos=(int)(minimumfeedrate/60.); encoderpos=(int)(minimumfeedrate);
} }
else else
{ {
minimumfeedrate= encoderpos*60; minimumfeedrate= encoderpos;
encoderpos=activeline*lcdslow; encoderpos=activeline*lcdslow;
} }
@ -935,7 +946,7 @@ void MainMenu::showControl()
if(force_lcd_update) if(force_lcd_update)
{ {
lcd.setCursor(0,line);lcdprintPGM(" VTrav min:"); lcd.setCursor(0,line);lcdprintPGM(" VTrav min:");
lcd.setCursor(13,line);lcd.print(itostr3(mintravelfeedrate/60)); lcd.setCursor(13,line);lcd.print(itostr3(mintravelfeedrate));
} }
if((activeline==line) ) if((activeline==line) )
@ -945,11 +956,11 @@ void MainMenu::showControl()
linechanging=!linechanging; linechanging=!linechanging;
if(linechanging) if(linechanging)
{ {
encoderpos=(int)mintravelfeedrate/60; encoderpos=(int)mintravelfeedrate;
} }
else else
{ {
mintravelfeedrate= encoderpos*60; mintravelfeedrate= encoderpos;
encoderpos=activeline*lcdslow; encoderpos=activeline*lcdslow;
} }

View File

@ -42,10 +42,12 @@ ISR(WDT_vect)
#ifdef RESET_MANUAL #ifdef RESET_MANUAL
LCD_MESSAGEPGM("Please Reset!"); LCD_MESSAGEPGM("Please Reset!");
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.");
#else #else
LCD_MESSAGEPGM("Timeout, resetting!"); LCD_MESSAGEPGM("Timeout, resetting!");
LCD_STATUS;
#endif #endif
//disable watchdog, it will survife reboot. //disable watchdog, it will survife reboot.
WDTCSR |= (1<<WDCE) | (1<<WDE); WDTCSR |= (1<<WDCE) | (1<<WDE);