|
@@ -42,25 +42,29 @@
|
42
|
42
|
int target_raw[3] = {0, 0, 0};
|
43
|
43
|
int current_raw[3] = {0, 0, 0};
|
44
|
44
|
|
45
|
|
-bool temp_meas_ready = false;
|
|
45
|
+static bool temp_meas_ready = false;
|
46
|
46
|
|
47
|
|
-unsigned long previous_millis_heater, previous_millis_bed_heater;
|
|
47
|
+static unsigned long previous_millis_heater, previous_millis_bed_heater;
|
48
|
48
|
|
49
|
49
|
#ifdef PIDTEMP
|
50
|
|
- float temp_iState = 0;
|
51
|
|
- float temp_dState = 0;
|
52
|
|
- float pTerm;
|
53
|
|
- float iTerm;
|
54
|
|
- float dTerm;
|
|
50
|
+ //static cannot be external:
|
|
51
|
+ static float temp_iState = 0;
|
|
52
|
+ static float temp_dState = 0;
|
|
53
|
+ static float pTerm;
|
|
54
|
+ static float iTerm;
|
|
55
|
+ static float dTerm;
|
55
|
56
|
//int output;
|
56
|
|
- float pid_error;
|
57
|
|
- float temp_iState_min;
|
58
|
|
- float temp_iState_max;
|
59
|
|
- float pid_setpoint = 0.0;
|
60
|
|
- float pid_input;
|
61
|
|
- float pid_output;
|
62
|
|
- bool pid_reset;
|
|
57
|
+ static float pid_error;
|
|
58
|
+ static float temp_iState_min;
|
|
59
|
+ static float temp_iState_max;
|
|
60
|
+ static float pid_input;
|
|
61
|
+ static float pid_output;
|
|
62
|
+ static bool pid_reset;
|
|
63
|
+
|
|
64
|
+ // probably used external
|
63
|
65
|
float HeaterPower;
|
|
66
|
+ float pid_setpoint = 0.0;
|
|
67
|
+
|
64
|
68
|
|
65
|
69
|
float Kp=DEFAULT_Kp;
|
66
|
70
|
float Ki=DEFAULT_Ki;
|
|
@@ -69,29 +73,29 @@ unsigned long previous_millis_heater, previous_millis_bed_heater;
|
69
|
73
|
#endif //PIDTEMP
|
70
|
74
|
|
71
|
75
|
#ifdef WATCHPERIOD
|
72
|
|
- int watch_raw[3] = {-1000,-1000,-1000};
|
73
|
|
- unsigned long watchmillis = 0;
|
|
76
|
+ static int watch_raw[3] = {-1000,-1000,-1000};
|
|
77
|
+ static unsigned long watchmillis = 0;
|
74
|
78
|
#endif //WATCHPERIOD
|
75
|
79
|
|
76
|
80
|
#ifdef HEATER_0_MINTEMP
|
77
|
|
- int minttemp_0 = temp2analog(HEATER_0_MINTEMP);
|
|
81
|
+ static int minttemp_0 = temp2analog(HEATER_0_MINTEMP);
|
78
|
82
|
#endif //MINTEMP
|
79
|
83
|
#ifdef HEATER_0_MAXTEMP
|
80
|
|
- int maxttemp_0 = temp2analog(HEATER_0_MAXTEMP);
|
|
84
|
+ static int maxttemp_0 = temp2analog(HEATER_0_MAXTEMP);
|
81
|
85
|
#endif //MAXTEMP
|
82
|
86
|
|
83
|
87
|
#ifdef HEATER_1_MINTEMP
|
84
|
|
- int minttemp_1 = temp2analog(HEATER_1_MINTEMP);
|
|
88
|
+ static int minttemp_1 = temp2analog(HEATER_1_MINTEMP);
|
85
|
89
|
#endif //MINTEMP
|
86
|
90
|
#ifdef HEATER_1_MAXTEMP
|
87
|
|
- int maxttemp_1 = temp2analog(HEATER_1_MAXTEMP);
|
|
91
|
+ static int maxttemp_1 = temp2analog(HEATER_1_MAXTEMP);
|
88
|
92
|
#endif //MAXTEMP
|
89
|
93
|
|
90
|
94
|
#ifdef BED_MINTEMP
|
91
|
|
- int bed_minttemp = temp2analog(BED_MINTEMP);
|
|
95
|
+ static int bed_minttemp = temp2analog(BED_MINTEMP);
|
92
|
96
|
#endif //BED_MINTEMP
|
93
|
97
|
#ifdef BED_MAXTEMP
|
94
|
|
- int bed_maxttemp = temp2analog(BED_MAXTEMP);
|
|
98
|
+ static int bed_maxttemp = temp2analog(BED_MAXTEMP);
|
95
|
99
|
#endif //BED_MAXTEMP
|
96
|
100
|
|
97
|
101
|
void manage_heater()
|