-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathclock.c
49 lines (40 loc) · 1.03 KB
/
clock.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "clock.h"
#include "pinio.h"
#include "sersendf.h"
#include "dda_queue.h"
#include "watchdog.h"
#include "temp.h"
#include "timer.h"
#include "debug.h"
#include "heater.h"
void clock_250ms() {
if (steptimeout > (30 * 4)) {
power_off();
}
else if (heaters_all_off())
steptimeout++;
ifclock(CLOCK_FLAG_1S) {
if (debug_flags & DEBUG_POSITION) {
// current position
sersendf_P(PSTR("Pos: %ld,%ld,%ld,%ld,%lu\n"), current_position.X, current_position.Y, current_position.Z, current_position.E, current_position.F);
// target position
sersendf_P(PSTR("Dst: %ld,%ld,%ld,%ld,%lu\n"), movebuffer[mb_tail].endpoint.X, movebuffer[mb_tail].endpoint.Y, movebuffer[mb_tail].endpoint.Z, movebuffer[mb_tail].endpoint.E, movebuffer[mb_tail].endpoint.F);
// Queue
print_queue();
}
// temperature
/* if (temp_get_target())
temp_print();*/
}
#ifdef TEMP_INTERCOM
start_send();
#endif
}
void clock_10ms() {
// reset watchdog
wd_reset();
temp_tick();
ifclock(CLOCK_FLAG_250MS) {
clock_250ms();
}
}