0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-27 22:01:26 +03:00

fix tx offset display

This commit is contained in:
OneOfEleven 2023-11-30 16:15:19 +00:00
parent e83aac104f
commit 9819afa405
5 changed files with 15 additions and 8 deletions

View File

@ -138,8 +138,8 @@ void toggle_chan_scanlist(void)
const unsigned int channel = FREQ_CHANNEL_FIRST + g_vfo_info[vfo].channel_attributes.band;
g_eeprom.config.setting.indices.vfo[vfo].screen = channel;
g_vfo_info[vfo].channel_save = channel;
g_eeprom.config.setting.tx_vfo_num = vfo;
g_vfo_info[vfo].channel_save = channel;
// g_eeprom.config.setting.tx_vfo_num = vfo;
RADIO_select_vfos();
RADIO_apply_offset(g_tx_vfo, false);
@ -151,10 +151,10 @@ void toggle_chan_scanlist(void)
// find the first channel that contains this frequency
g_tx_vfo->freq_in_channel = SETTINGS_find_channel(g_tx_vfo->freq_config_tx.frequency);
SETTINGS_save_channel(g_tx_vfo->channel_save, g_eeprom.config.setting.tx_vfo_num, g_tx_vfo, 2);
SETTINGS_save_channel(channel, vfo, g_tx_vfo, 2);
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
// UART_printf("chan-vfo %u\r\n", g_tx_vfo->channel_save);
// UART_printf("chan-vfo %u\r\n", channel);
#endif
g_beep_to_play = BEEP_880HZ_60MS_TRIPLE_BEEP;

Binary file not shown.

Binary file not shown.

View File

@ -644,12 +644,12 @@ void RADIO_apply_offset(vfo_info_t *p_vfo, const bool set_pees)
{
case TX_OFFSET_FREQ_DIR_OFF:
break;
case TX_OFFSET_FREQ_DIR_ADD:
Frequency += p_vfo->channel.tx_offset;
break;
case TX_OFFSET_FREQ_DIR_SUB:
Frequency -= p_vfo->channel.tx_offset;
break;
case TX_OFFSET_FREQ_DIR_ADD:
Frequency += p_vfo->channel.tx_offset;
break;
}
if (Frequency < FREQ_BAND_TABLE[0].lower)

View File

@ -23,6 +23,9 @@
#include "driver/backlight.h"
#include "driver/bk4819.h"
#include "driver/st7565.h"
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
#include "driver/uart.h"
#endif
#include "external/printf/printf.h"
#include "font.h"
#include "functions.h"
@ -752,7 +755,11 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
}
else
{
const uint32_t frequency = (g_current_function == FUNCTION_TRANSMIT) ? g_vfo_info[vfo_num].p_rx->frequency : g_vfo_info[vfo_num].p_tx->frequency;
const uint32_t frequency = (g_current_function == FUNCTION_TRANSMIT) ? g_vfo_info[vfo_num].p_tx->frequency : g_vfo_info[vfo_num].p_rx->frequency;
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
// UART_printf("%u.%05u MHz\n", frequency / 100000, frequency % 100000);
#endif
if (scrn_chan <= USER_CHANNEL_LAST)
{ // a user channel