From 3be89cb70b41e0fc166317010ca5c35e7a93ee48 Mon Sep 17 00:00:00 2001 From: Hermes Date: Wed, 30 Sep 2026 12:05:33 +0200 Subject: [PATCH] hilink: expose runtime knob power through MSP VTX --- .../0001-wifilink-mspvtx-read-only.patch | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/package/msposd/0001-wifilink-mspvtx-read-only.patch b/package/msposd/0001-wifilink-mspvtx-read-only.patch index 70229b6..7430969 100644 --- a/package/msposd/0001-wifilink-mspvtx-read-only.patch +++ b/package/msposd/0001-wifilink-mspvtx-read-only.patch @@ -353,10 +353,10 @@ index 3e60a31..1fe1c28 100644 +// Advertise the actual local WFB configuration without resetting the FC table. +void msp_send_vtx_runtime_config(int serial_fd); diff --git a/osd/util/interface.c b/osd/util/interface.c -index 089fdc2..1ddd350 100644 +index 089fdc2..a783431 100644 --- a/osd/util/interface.c +++ b/osd/util/interface.c -@@ -153,3 +153,69 @@ void set_frequency(char *interface, int channel) { +@@ -153,3 +153,81 @@ void set_frequency(char *interface, int channel) { printf("Failed to set channel on %s\n", interface); } } @@ -400,10 +400,22 @@ index 089fdc2..1ddd350 100644 +} + +int read_wfb_txpower(void) { -+ FILE *fp = fopen("/etc/wfb.yaml", "r"); ++ FILE *fp = fopen("/run/wfb-power", "r"); ++ int txpower = -1; ++ ++ // CH6 knob state wins while WFB is active; it is intentionally kept in ++ // tmpfs so power changes do not wear the overlay flash. ++ if (fp != NULL) { ++ if (fscanf(fp, "%d", &txpower) == 1 && txpower >= 0 && txpower <= 100) { ++ fclose(fp); ++ return txpower; ++ } ++ fclose(fp); ++ } ++ ++ fp = fopen("/etc/wfb.yaml", "r"); + char buffer[256]; + int in_wireless = 0; -+ int txpower = -1; + + if (fp == NULL) { + return -1;