File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,7 @@ uint16_t SGF22_callback()
169169{
170170 #ifdef SGF22_HUB_TELEMETRY
171171 bool rx = false ;
172+ static uint8_t telem_count = 0 ;
172173 #endif
173174
174175 switch (phase)
@@ -195,6 +196,8 @@ uint16_t SGF22_callback()
195196 {// packets: 00 0B 00 -> 00 0B 01
196197 telemetry_link = 1 ;
197198 v_lipo1 = packet_in[2 ] ? 0 : 255 ; // 2.9V for 1S, 7.0V for 2S
199+ telemetry_lost = 0 ;
200+ telem_count = 0 ;
198201 }
199202 #if 0
200203 debug("L %d ",p_len);
@@ -204,6 +207,20 @@ uint16_t SGF22_callback()
204207 debugln("");
205208 #endif
206209 }
210+ if (telem_count > 4 *63 ) // Around 3.5sec with no telemetry
211+ telemetry_lost = 1 ;
212+ else
213+ {
214+ telem_count++;
215+ if (!telemetry_lost && (telem_count & 0x3F ) == 0 )
216+ {// Should have received a telem packet but... Send telem to the radio to keep it alive
217+ telemetry_link = 1 ;
218+ #if 0
219+ debugln("Miss");
220+ #endif
221+ }
222+ }
223+
207224 #endif
208225 phase++;
209226 break ;
@@ -245,6 +262,7 @@ void SGF22_init()
245262 phase = SGF22_DATA1;
246263 #ifdef SGF22_HUB_TELEMETRY
247264 RX_RSSI = 100 ; // Dummy value
265+ telemetry_lost = 1 ;
248266 #endif
249267}
250268
Original file line number Diff line number Diff line change @@ -244,7 +244,7 @@ uint16_t V761_callback()
244244 else
245245 {
246246 packet_count++;
247- if (!telemetry_lost && !rx && (packet_count% 64 ) == 0 )
247+ if (!telemetry_lost && !rx && (packet_count & 0x3F ) == 0 )
248248 {// Should have received a telem packet but... Send telem to the radio to keep it alive
249249 telemetry_link = 1 ;
250250 #ifdef V761_TELEM_DEBUG
You can’t perform that action at this time.
0 commit comments