mirror of
https://github.com/bleackstorm/SteamFrame-FPV-Control-Center.git
synced 2026-12-03 07:31:57 +01:00
fix(crsf): prevent USB CDC / Serial2 blocking and ignore 0x16 echo on GP1
This commit is contained in:
1 parent
14f9218a44
commit
50c1eb05b1
1 file changed
+7
-1
+7
-1
@@ -763,6 +763,8 @@ void traiterTelemetrieCRSF() {
|
||||
}
|
||||
|
||||
// Relais de la télémétrie CRSF valide vers SteamFrame FPV (OSD via Radxa/USB)
|
||||
// Ne jamais relayer 0x16 (RC_CHANNELS_PACKED) si GP1 reçoit un écho des trames émises
|
||||
if (frameType != 0x16) {
|
||||
size_t totalLen = (size_t)paquetLongueurAttendue + 2;
|
||||
if (totalLen <= 64) {
|
||||
char bufCrsf[140];
|
||||
@@ -777,6 +779,7 @@ void traiterTelemetrieCRSF() {
|
||||
emettreLigneCockpit(bufCrsf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
crsfRxIdx = 0;
|
||||
}
|
||||
@@ -807,8 +810,11 @@ void traiterTelemetrieCRSF() {
|
||||
}
|
||||
|
||||
void emettreLigneCockpit(const char* ligne) {
|
||||
int needed = (int)strlen(ligne) + 2;
|
||||
if (Serial2.availableForWrite() >= needed) {
|
||||
Serial2.println(ligne);
|
||||
if (cockpitEchoUSB) {
|
||||
}
|
||||
if (cockpitEchoUSB && Serial && Serial.availableForWrite() >= needed) {
|
||||
Serial.println(ligne);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user