From c1886a666c5edc030f5cf660394be420b89648f4 Mon Sep 17 00:00:00 2001 From: Hermes Date: Mon, 28 Sep 2026 12:15:29 +0200 Subject: [PATCH] hilink: wait for FC MSP VTX readiness before table sync --- .../msposd/0001-wifilink-mspvtx-read-only.patch | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/package/msposd/0001-wifilink-mspvtx-read-only.patch b/package/msposd/0001-wifilink-mspvtx-read-only.patch index 371d5c9..68cc5c3 100644 --- a/package/msposd/0001-wifilink-mspvtx-read-only.patch +++ b/package/msposd/0001-wifilink-mspvtx-read-only.patch @@ -1,24 +1,26 @@ diff --git a/osd.c b/osd.c -index a8b756e..701e989 100644 +index a8b756e..49673da 100644 --- a/osd.c +++ b/osd.c -@@ -190,6 +190,7 @@ extern bool vtxMenuActive; +@@ -190,6 +190,8 @@ extern bool vtxMenuActive; extern bool vtxMenuEnabled; extern bool armed; extern bool vtxInitDone; ++static uint8_t mspVtxConfigFramesReceived; +static bool mspVtxTableResentAfterFcTraffic; extern bool DrawOSD; // SRT/OSD -@@ -960,48 +961,24 @@ static void rx_msp_callback(msp_msg_t *msp_message) { +@@ -960,48 +962,25 @@ static void rx_msp_callback(msp_msg_t *msp_message) { } case MSP_GET_VTX_CONFIG: { - if (vtxInitDone) { -+ // The FC starts publishing its VTX state only after its MSP descriptor is -+ // active. Re-send our table once at that boundary: the boot-time burst can -+ // otherwise precede FC UART/MSP initialization. -+ if (vtxInitDone && !mspVtxTableResentAfterFcTraffic) { ++ // The FC publishes its VTX state only after its MSP descriptor is active. ++ // Wait for several frames, then send the table once. This avoids losing ++ // the boot-time burst while the FC is still bringing UART/MSP online. ++ if (vtxInitDone && !mspVtxTableResentAfterFcTraffic && ++ ++mspVtxConfigFramesReceived >= 5) { + msp_set_vtx_config(serial_fd); + mspVtxTableResentAfterFcTraffic = true; + }