You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AirDataComputer._status[3] = '1'; //External temperature sensor
65
65
AirDataComputer._status[4] = '1'; //Deltap sensor temperature
66
66
AirDataComputer._status[5] = '1'; //Absolute pressure sensor temperature
67
67
AirDataComputer._status[6] = '0'; //Real time clock temperature temperature
68
68
AirDataComputer._status[7] = '0'; //Error/Warning
69
-
AirDataComputer._status[8] = '1'; //BT Module present on serial1
69
+
AirDataComputer._status[8] = '0'; //BT Module present on serial1
70
70
InitTime = 1; //First run
71
71
pinMode(TsensorPin, INPUT); // and set pins to input.
72
72
@@ -105,8 +105,11 @@ void loop()
105
105
{
106
106
delay(500);
107
107
noInterrupts();
108
+
Serial.println("uno");
108
109
comm();
109
-
acquisition();
110
+
Serial.println("due");
111
+
acquisition();// <- Questa si appende
112
+
Serial.println("tre");
110
113
computation();
111
114
interrupts();
112
115
@@ -183,6 +186,7 @@ void computation() {
183
186
}
184
187
voidcomm()
185
188
{
189
+
noInterrupts();
186
190
endmsg = false;
187
191
ch = &input[0];// Return to first index, ready for the new message; <- Receive one single command at time, if the command is garbled then is dropped and we need retrasmittal
188
192
bytecount = 0;
@@ -214,6 +218,7 @@ void comm()
214
218
bytecount++;
215
219
}
216
220
}
221
+
217
222
if (!((endmsg) && (ch != &input[0]))) {
218
223
goto fine;
219
224
}
@@ -226,8 +231,8 @@ void comm()
226
231
}
227
232
if (endmsg) { //New message is received
228
233
endmsg = false;
229
-
*ch = 0;
230
-
ch = &input[0];// Return to first index, ready for the new message; Here for Debug purposes.
234
+
// *ch = 0;
235
+
// ch = &input[0];// Return to first index, ready for the new message; Here for Debug purposes.
231
236
232
237
if (AirDataComputer._status[8] == '1') { //if (AirDataComputer._status[8] == '1' )
233
238
Serial1.println(outputb);
@@ -238,15 +243,17 @@ void comm()
238
243
}
239
244
}
240
245
fine:;
246
+
interrupts();
241
247
}
242
248
243
249
voidacquisition()
244
250
{
251
+
noInterrupts();
245
252
//Outside Temperature Sensor
246
253
temperature = TMP36GT_AI_value_to_Celsius(analogRead(TsensorPin)); // read temperature
0 commit comments