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
if(sensor==0x80) HoTT_SerialRX_val&=0x0F; // RX only
231
+
if(prev_SerialRX_val!=HoTT_SerialRX_val)
232
+
{
233
+
prev_SerialRX_val=HoTT_SerialRX_val;
234
+
packet[28] = HoTT_SerialRX_val; // send the button being pressed only once
235
+
}
236
+
else
237
+
packet[28] = HoTT_SerialRX_val | 0x0F; // no button pressed
238
+
packet[29] = 0x01; // 0x01->Text config menu
222
239
}
223
-
else
224
-
packet[28] = 0xDF; // no touch pressed
225
-
packet[29] = 0x01; // 0x01->config menu
226
240
}
227
241
else
228
242
{
229
-
packet[28] = 0x8C; // unknown 0x80 when bind starts then when RX replies start normal, 0x89/8A/8B/8C/8D/8E during normal packets, 0x0F->config menu
230
-
packet[29] = 0x02; // unknown 0x02 when bind starts then when RX replies cycle in sequence 0x1A/22/2A/0A/12, 0x02 during normal packets, 0x01->config menu, 0x0A->no more RX telemetry
243
+
#ifdef HOTT_FW_TELEMETRY
244
+
packet[28] = 0x89+HOTT_sensor_cur; // 0x89/8A/8B/8C/8D/8E during normal packets
245
+
#else
246
+
packet[28] = 0x80; // no sensor
247
+
#endif
248
+
packet[29] = 0x02; // unknown 0x02 when bind starts then when RX replies cycle in sequence 0x1A/22/2A/0A/12, 0x02 during normal packets, 0x01->text config menu, 0x0A->no more RX telemetry
// Config menu consists of the different telem pages put all together
331
382
// Page X [12] = seems like all the telem pages with the same value are going together to make the full config menu text. Seen so far 'a', 'b', 'c', 'd'
332
383
// Page X [13..21] = 9 ascii chars to be displayed, char is highlighted when ascii|0x80
333
384
// Screen display is 21 characters large which means that once the first 21 chars are filled go to the begining of the next line
334
385
// Menu commands are sent through TX packets:
335
386
// packet[28]= 0xXF=>no key press, 0xXD=>down, 0xXB=>up, 0xX9=>enter, 0xXE=>right, 0xX7=>left with X=0 or D
336
387
// packet[29]= 0xX1/0xX9 with X=0 or X counting 0,1,1,2,2,..,9,9
337
-
TX_RSSI = packet_in[22];
338
-
if(TX_RSSI >=128)
339
-
TX_RSSI -= 128;
340
-
else
341
-
TX_RSSI += 128;
342
388
// Reduce telemetry to 14 bytes
343
-
packet_in[0]= TX_RSSI;
389
+
packet_in[0]= packet_in[HOTT_RX_PACKET_LEN];
344
390
packet_in[1]= TX_LQI;
345
-
debug("T=");
391
+
bool send_telem=true;
392
+
bool disp = true;
393
+
if(packet[29]==2) // Requesting binary sensor
394
+
{
395
+
if( packet_in[11]==1 ) // Page 1
396
+
{
397
+
if(packet_sent)
398
+
packet_sent--;
399
+
if( packet_in[12] == ((HOTT_sensor_cur+9)<<4) ) // The current sensor is responding: 0x90/A0/B0/C0/D0/E0
400
+
{
401
+
HOTT_sensor_pages = 0; // Sensor first page received
402
+
HOTT_sensor_valid = true; // Data from the expected sensor is being received
403
+
HOTT_sensor_ok[HOTT_sensor_cur]=true;
404
+
}
405
+
else
406
+
{
407
+
HOTT_sensor_valid = false;
408
+
HOTT_sensor_pages = 0x1E; // Switch to next sensor
0 commit comments