From 50c1eb05b1994f92c580d580ac467151d49ccfb7 Mon Sep 17 00:00:00 2001 From: bleackstorm <49142331+bleackstorm@users.noreply.github.com> Date: Mon, 16 Nov 2026 19:53:24 +0100 Subject: [PATCH 1/3] fix(crsf): prevent USB CDC / Serial2 blocking and ignore 0x16 echo on GP1 --- g29_crsf.ino | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/g29_crsf.ino b/g29_crsf.ino index 35d7a42..2dd4621 100644 --- a/g29_crsf.ino +++ b/g29_crsf.ino @@ -763,18 +763,21 @@ void traiterTelemetrieCRSF() { } // Relais de la télémétrie CRSF valide vers SteamFrame FPV (OSD via Radxa/USB) - size_t totalLen = (size_t)paquetLongueurAttendue + 2; - if (totalLen <= 64) { - char bufCrsf[140]; - memcpy(bufCrsf, "$CRSF,", 6); - static const char HEX_DIGITS[] = "0123456789ABCDEF"; - for (size_t i = 0; i < totalLen; i++) { - uint8_t byteVal = crsfRxBuffer[i]; - bufCrsf[6 + i * 2] = HEX_DIGITS[(byteVal >> 4) & 0x0F]; - bufCrsf[6 + i * 2 + 1] = HEX_DIGITS[byteVal & 0x0F]; + // 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]; + memcpy(bufCrsf, "$CRSF,", 6); + static const char HEX_DIGITS[] = "0123456789ABCDEF"; + for (size_t i = 0; i < totalLen; i++) { + uint8_t byteVal = crsfRxBuffer[i]; + bufCrsf[6 + i * 2] = HEX_DIGITS[(byteVal >> 4) & 0x0F]; + bufCrsf[6 + i * 2 + 1] = HEX_DIGITS[byteVal & 0x0F]; + } + bufCrsf[6 + totalLen * 2] = '\0'; + emettreLigneCockpit(bufCrsf); } - bufCrsf[6 + totalLen * 2] = '\0'; - emettreLigneCockpit(bufCrsf); } } @@ -807,8 +810,11 @@ void traiterTelemetrieCRSF() { } void emettreLigneCockpit(const char* ligne) { - Serial2.println(ligne); - if (cockpitEchoUSB) { + int needed = (int)strlen(ligne) + 2; + if (Serial2.availableForWrite() >= needed) { + Serial2.println(ligne); + } + if (cockpitEchoUSB && Serial && Serial.availableForWrite() >= needed) { Serial.println(ligne); } } From f2b9509c2518df14b0af3bade1343e48725921cb Mon Sep 17 00:00:00 2001 From: bleackstorm <49142331+bleackstorm@users.noreply.github.com> Date: Mon, 16 Nov 2026 20:18:13 +0100 Subject: [PATCH 2/3] fix(uart): always write to Serial2 (availableForWrite returns 1 on SerialUART) --- g29_crsf.ino | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/g29_crsf.ino b/g29_crsf.ino index 2dd4621..23419f3 100644 --- a/g29_crsf.ino +++ b/g29_crsf.ino @@ -810,10 +810,8 @@ void traiterTelemetrieCRSF() { } void emettreLigneCockpit(const char* ligne) { + Serial2.println(ligne); int needed = (int)strlen(ligne) + 2; - if (Serial2.availableForWrite() >= needed) { - Serial2.println(ligne); - } if (cockpitEchoUSB && Serial && Serial.availableForWrite() >= needed) { Serial.println(ligne); } From 55607325ee290b78afb309fd225515b199516114 Mon Sep 17 00:00:00 2001 From: bleackstorm <49142331+bleackstorm@users.noreply.github.com> Date: Mon, 16 Nov 2026 20:26:40 +0100 Subject: [PATCH 3/3] docs: add complete Logitech G29 button and cockpit mapping table --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 740345b..d094303 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,34 @@ Firmware dual-core pour **Waveshare RP2350-USB-A** transformant un volant **Logi --- +## Mapping Complet des Touches du Logitech G29 + +### 1. Conduite, Radio CRSF & Retour de Force (RP2350) +| Touche / Axe G29 | Action | Canal / Effet | +| :--- | :--- | :--- | +| **Volant** | Direction | `CH1` (plage `40..900°`, expo configurable) | +| **Pédale Accélérateur** | Gaz progressifs selon rapport (`R`, `1`, `2`, `3`) | `CH2` | +| **Pédale Frein** | Frein | `CH3` | +| **Pédale Embrayage** | Embrayage | `CH4` | +| **`R2`** | Bascule **Armé / Désarmé** *(au point mort `N`, gaz relâchés)* | `CH5` (`AUX1`) | +| **Palette droite (`R1`) / gauche (`L1`)** | Monter / rétrograder un rapport (`R ⇄ N ⇄ 1 ⇄ 2 ⇄ 3`) | Boîte séquentielle + LEDs | +| **Molette rouge (`CW` / `CCW`)** | Dureté du ressort de centrage FFB (`0..255`) | Retour de force | +| **Boutons `+` / `-`** | Intensité des vibrations haptiques (`0..100 %`, `0` = coupé) | Haptique volant | +| **Bouton central `Enter`** *(appui 2 s désarmé)* | Sauvegarde des réglages en mémoire Flash (EEPROM) | Persistance | + +### 2. Commandes Cockpit SteamFrame FPV (`$G29_EVT` via Radxa / USB) +| Touche G29 | Action dans `steamframe-fpv` | Toast OSD | +| :--- | :--- | :--- | +| **`Croix (✕)`**, **`PS`** ou **`R3`** | **Tare Head-Tracking** (recentre la vue et la nacelle) | `TARE HT OK` | +| **`Rond (○)`** ou **`Share`** | **Enregistrement DVR** (Démarrer / Arrêter) | `DVR REC` / `DVR STOP` | +| **`Triangle (△)`** | **Incrustation OSD** (Afficher / Masquer) | `OSD ON` / `OSD OFF` | +| **`Carré (□)`** | **Mode de projection VR** (`Dome140` ➔ `Cylinder140` ➔ `FlatQuad`) | `PROJ: ...` | +| **`D-Pad` Haut / Bas** | **Trim Tilt** caméra (`+1°` / `-1°`) | `TILT +1` / `TILT -1` | +| **`D-Pad` Gauche / Droite** | **Trim Pan** caméra (`-1°` / `+1°`) | `PAN -1` / `PAN +1` | +| **`Options`**, **`L3`** | Réservés (libres pour extensions futures) | — | + +--- + ## Commandes Série (`Serial` & `Serial2`) | Commande | Description |