// The watchdog waits for the watchperiod in milliseconds whenever an M104 or M109 increases the target temperature
// this enables the watchdog interrupt.
-#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:
-#define RESET_MANUAL
-#define WATCHDOG_TIMEOUT 4 //seconds
-
+//#define USE_WATCHDOG
+#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 WATCHDOG_TIMEOUT 4 //seconds
+#endif
#include "temperature.h"
#include "motion_control.h"
#include "cardreader.h"
+#include "watchdog.h"
#define VERSION_STRING "1.0.0 Alpha 1"
}
+
+inline void get_coordinates()
+{
+ for(int8_t i=0; i < NUM_AXIS; i++) {
+ if(code_seen(axis_codes[i])) destination[i] = (float)code_value() + (axis_relative_modes[i] || relative_mode)*current_position[i];
+ else destination[i] = current_position[i]; //Are these else lines really needed?
+ }
+ if(code_seen('F')) {
+ next_feedrate = code_value();
+ if(next_feedrate > 0.0) feedrate = next_feedrate;
+ }
+}
+
+inline void get_arc_coordinates()
+{
+ get_coordinates();
+ if(code_seen('I')) offset[0] = code_value();
+ if(code_seen('J')) offset[1] = code_value();
+}
+
+void prepare_move()
+{
+ plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60.0/100.0);
+ for(int8_t i=0; i < NUM_AXIS; i++) {
+ current_position[i] = destination[i];
+ }
+}
+
+
+
//adds an command to the main command buffer
//thats really done in a non-safe way.
//needs overworking someday
plan_init(); // Initialize planner;
st_init(); // Initialize stepper;
tp_init(); // Initialize temperature loop
+ wd_init();
}
break;
case 105: // M105
//SERIAL_ECHOLN(freeMemory());
-
+ //test watchdog:
+ //delay(20000);
#if (TEMP_0_PIN > -1) || defined (HEATER_USES_AD595)
SERIAL_PROTOCOLPGM("ok T:");
SERIAL_PROTOCOL( degHotend0());
SERIAL_PROTOCOLLNPGM("ok");
}
-inline void get_coordinates()
-{
- for(int8_t i=0; i < NUM_AXIS; i++) {
- if(code_seen(axis_codes[i])) destination[i] = (float)code_value() + (axis_relative_modes[i] || relative_mode)*current_position[i];
- else destination[i] = current_position[i]; //Are these else lines really needed?
- }
- if(code_seen('F')) {
- next_feedrate = code_value();
- if(next_feedrate > 0.0) feedrate = next_feedrate;
- }
-}
-
-inline void get_arc_coordinates()
-{
- get_coordinates();
- if(code_seen('I')) offset[0] = code_value();
- if(code_seen('J')) offset[1] = code_value();
-}
-void prepare_move()
-{
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60.0/100.0);
- for(int8_t i=0; i < NUM_AXIS; i++) {
- current_position[i] = destination[i];
- }
-}
void prepare_arc_move(char isclockwise) {
float r = hypot(offset[X_AXIS], offset[Y_AXIS]); // Compute arc radius for mc_arc
lcd.print(fillto(LCD_WIDTH,messagetext));\r
messagetext[0]='\0';\r
}\r
+ \r
+ static uint8_t oldpercent=101;\r
+ uint8_t percent=card.percentDone();\r
+ if(oldpercent!=percent)\r
+ {\r
+ lcd.setCursor(6,3);\r
+ lcd.print(oldpercent);\r
+ lcdprintPGM("done");\r
+ }\r
+ \r
#else //smaller LCDS----------------------------------\r
static int olddegHotEnd0=-1;\r
static int oldtargetHotEnd0=-1;\r