|
@@ -37,6 +37,7 @@
|
37
|
37
|
#include "temperature.h"
|
38
|
38
|
#include "motion_control.h"
|
39
|
39
|
#include "cardreader.h"
|
|
40
|
+#include "watchdog.h"
|
40
|
41
|
|
41
|
42
|
|
42
|
43
|
#define VERSION_STRING "1.0.0 Alpha 1"
|
|
@@ -191,6 +192,36 @@ extern "C"{
|
191
|
192
|
}
|
192
|
193
|
|
193
|
194
|
|
|
195
|
+
|
|
196
|
+inline void get_coordinates()
|
|
197
|
+{
|
|
198
|
+ for(int8_t i=0; i < NUM_AXIS; i++) {
|
|
199
|
+ if(code_seen(axis_codes[i])) destination[i] = (float)code_value() + (axis_relative_modes[i] || relative_mode)*current_position[i];
|
|
200
|
+ else destination[i] = current_position[i]; //Are these else lines really needed?
|
|
201
|
+ }
|
|
202
|
+ if(code_seen('F')) {
|
|
203
|
+ next_feedrate = code_value();
|
|
204
|
+ if(next_feedrate > 0.0) feedrate = next_feedrate;
|
|
205
|
+ }
|
|
206
|
+}
|
|
207
|
+
|
|
208
|
+inline void get_arc_coordinates()
|
|
209
|
+{
|
|
210
|
+ get_coordinates();
|
|
211
|
+ if(code_seen('I')) offset[0] = code_value();
|
|
212
|
+ if(code_seen('J')) offset[1] = code_value();
|
|
213
|
+}
|
|
214
|
+
|
|
215
|
+void prepare_move()
|
|
216
|
+{
|
|
217
|
+ plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60.0/100.0);
|
|
218
|
+ for(int8_t i=0; i < NUM_AXIS; i++) {
|
|
219
|
+ current_position[i] = destination[i];
|
|
220
|
+ }
|
|
221
|
+}
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
194
|
225
|
//adds an command to the main command buffer
|
195
|
226
|
//thats really done in a non-safe way.
|
196
|
227
|
//needs overworking someday
|
|
@@ -234,6 +265,7 @@ void setup()
|
234
|
265
|
plan_init(); // Initialize planner;
|
235
|
266
|
st_init(); // Initialize stepper;
|
236
|
267
|
tp_init(); // Initialize temperature loop
|
|
268
|
+ wd_init();
|
237
|
269
|
}
|
238
|
270
|
|
239
|
271
|
|
|
@@ -656,7 +688,8 @@ inline void process_commands()
|
656
|
688
|
break;
|
657
|
689
|
case 105: // M105
|
658
|
690
|
//SERIAL_ECHOLN(freeMemory());
|
659
|
|
-
|
|
691
|
+ //test watchdog:
|
|
692
|
+ //delay(20000);
|
660
|
693
|
#if (TEMP_0_PIN > -1) || defined (HEATER_USES_AD595)
|
661
|
694
|
SERIAL_PROTOCOLPGM("ok T:");
|
662
|
695
|
SERIAL_PROTOCOL( degHotend0());
|
|
@@ -975,32 +1008,7 @@ void ClearToSend()
|
975
|
1008
|
SERIAL_PROTOCOLLNPGM("ok");
|
976
|
1009
|
}
|
977
|
1010
|
|
978
|
|
-inline void get_coordinates()
|
979
|
|
-{
|
980
|
|
- for(int8_t i=0; i < NUM_AXIS; i++) {
|
981
|
|
- if(code_seen(axis_codes[i])) destination[i] = (float)code_value() + (axis_relative_modes[i] || relative_mode)*current_position[i];
|
982
|
|
- else destination[i] = current_position[i]; //Are these else lines really needed?
|
983
|
|
- }
|
984
|
|
- if(code_seen('F')) {
|
985
|
|
- next_feedrate = code_value();
|
986
|
|
- if(next_feedrate > 0.0) feedrate = next_feedrate;
|
987
|
|
- }
|
988
|
|
-}
|
989
|
|
-
|
990
|
|
-inline void get_arc_coordinates()
|
991
|
|
-{
|
992
|
|
- get_coordinates();
|
993
|
|
- if(code_seen('I')) offset[0] = code_value();
|
994
|
|
- if(code_seen('J')) offset[1] = code_value();
|
995
|
|
-}
|
996
|
1011
|
|
997
|
|
-void prepare_move()
|
998
|
|
-{
|
999
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60.0/100.0);
|
1000
|
|
- for(int8_t i=0; i < NUM_AXIS; i++) {
|
1001
|
|
- current_position[i] = destination[i];
|
1002
|
|
- }
|
1003
|
|
-}
|
1004
|
1012
|
|
1005
|
1013
|
void prepare_arc_move(char isclockwise) {
|
1006
|
1014
|
float r = hypot(offset[X_AXIS], offset[Y_AXIS]); // Compute arc radius for mc_arc
|