Sat, 07 Nov 2015 13:23:07 +0100
Initial code from reprappro Marlin repository
0 | 1 | #include "led.h" |
2 | #if (LED_PIN > -1) | |
3 | #include "Marlin.h" | |
4 | #include "temperature.h" | |
5 | ||
6 | static unsigned long previous_millis_led=0; | |
7 | static unsigned long previous_millis_toggle=0; | |
8 | ||
9 | void led_init() | |
10 | { | |
11 | SET_OUTPUT(LED_PIN); | |
12 | } | |
13 | ||
14 | void led_status() | |
15 | { | |
16 | if (((millis() - previous_millis_led) < LED_UPDATE_INTERVAL)) | |
17 | return; | |
18 | previous_millis_led=millis(); | |
19 | /* // Not sure what this did - AB | |
20 | if (degTargetHotend(active_extruder) > HEATER_0_MINTEMP) | |
21 | { | |
22 | if (((millis() - previous_millis_toggle) < LED_HOTEND_ACTIVE_FLASH)) | |
23 | } | |
24 | else | |
25 | { | |
26 | WRITE(LED_PIN, READ(HEATER_0_PIN)); // Just tell us if the extruder heater is on | |
27 | }*/ | |
28 | if(READ(HEATER_0_PIN)) | |
29 | WRITE(LED_PIN, 1); // Heater on | |
30 | else | |
31 | TOGGLE(LED_PIN); // Heater off | |
32 | } | |
33 | ||
34 | ||
35 | #endif //LED_PIN > -1 | |
36 | ||
37 |