hilink: expose runtime knob power through MSP VTX
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user