From 90bf33c31c5647e9c302306f3dc9b85002e4fca9 Mon Sep 17 00:00:00 2001 From: Georgy Dyuldin Date: Wed, 21 Aug 2024 12:51:31 +0300 Subject: [PATCH] Increase default FT8 output (ugly hack) --- src/dialog_ft8.c | 4 +++- src/params/params.c | 6 ++++++ src/params/params.h | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/dialog_ft8.c b/src/dialog_ft8.c index 1caa8ce..1906b6c 100644 --- a/src/dialog_ft8.c +++ b/src/dialog_ft8.c @@ -672,6 +672,7 @@ static void load_band() { static void clean() { reset(); + lv_table_set_row_cnt(table, 0); lv_table_set_row_cnt(table, 1); lv_table_set_cell_value(table, 0, 0, "Wait sync"); @@ -1179,7 +1180,8 @@ static void tx_worker() { radio_set_freq(radio_freq + params.ft8_tx_freq.x - signal_freq); radio_set_modem(true); - float gain_scale = -12.0f + log10f(params.pwr) * 5; + float gain_scale = -8.2f + params.ft8_output_gain_offset + log10f(params.pwr) * 5; + while (true) { if (n_samples <= 0 || state != TX_PROCESS) { state = RX_PROCESS; diff --git a/src/params/params.c b/src/params/params.c index 82ac15e..b417c60 100644 --- a/src/params/params.c +++ b/src/params/params.c @@ -118,6 +118,7 @@ params_t params = { .ft8_band = 5, .ft8_tx_freq = { .x = 1325, .name = "ft8_tx_freq" }, .ft8_auto = { .x = true, .name = "ft8_auto" }, + .ft8_output_gain_offset = 0.0f, .long_gen = ACTION_SCREENSHOT, .long_app = ACTION_APP_RECORDER, @@ -696,6 +697,11 @@ void params_init() { pthread_create(&thread, NULL, params_thread, NULL); pthread_detach(thread); params_modulation_setup(¶ms_lo_offset_get); + + // Fix for different output poser on different devices + if (access("/mnt/.fix_ft8_power", F_OK) == 0) { + params.ft8_output_gain_offset = -4.0f; + } } int32_t params_lo_offset_get() { diff --git a/src/params/params.h b/src/params/params.h index f14862c..ec6af7c 100644 --- a/src/params/params.h +++ b/src/params/params.h @@ -191,6 +191,9 @@ typedef struct { params_uint16_t ft8_tx_freq; params_bool_t ft8_auto; + // Temporal fix for different output power on FT8 + float ft8_output_gain_offset; + /* Long press actions */ uint8_t long_gen;