0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-28 22:31:25 +03:00

Missing 8.33kHz step

This commit is contained in:
OneOfEleven 2023-09-15 15:53:37 +01:00
parent 7ae40a361b
commit 605fcf5217
8 changed files with 26 additions and 40 deletions

View File

@ -34,6 +34,10 @@
#include "ui/menu.h" #include "ui/menu.h"
#include "ui/ui.h" #include "ui/ui.h"
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
#endif
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
static const VOICE_ID_t MenuVoices[] = static const VOICE_ID_t MenuVoices[] =
{ {
@ -133,14 +137,9 @@ int MENU_GetLimits(uint8_t Cursor, uint8_t *pMin, uint8_t *pMax)
break; break;
case MENU_STEP: case MENU_STEP:
if (gTxVfo->Band == BAND2_108MHz)
{
*pMin = 0; *pMin = 0;
*pMax = 6; *pMax = ARRAY_SIZE(StepFrequencyTable) - 1;
break; break;
}
// Fallthrough
case MENU_ABR: case MENU_ABR:
case MENU_F_LOCK: case MENU_F_LOCK:

BIN
firmware

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -79,24 +79,26 @@ const uint32_t UpperLimitFrequencyBandTable[7] =
#endif #endif
#if 0 #if 0
const uint16_t StepFrequencyTable[6] = const uint16_t StepFrequencyTable[7] =
{ {
250, 250,
500, 500,
625, 625,
1000, 1000,
1250, 1250,
2500 2500,
833
}; };
#else #else
const uint16_t StepFrequencyTable[6] = const uint16_t StepFrequencyTable[7] =
{ {
125, 125,
250, 250,
625, 625,
1000, 1000,
1250, 1250,
2500 2500,
833
}; };
#endif #endif

View File

@ -45,7 +45,7 @@ extern const uint32_t UpperLimitFrequencyBandTable[7];
extern const uint32_t NoaaFrequencyTable[10]; extern const uint32_t NoaaFrequencyTable[10];
#endif #endif
extern const uint16_t StepFrequencyTable[6]; extern const uint16_t StepFrequencyTable[7];
FREQUENCY_Band_t FREQUENCY_GetBand(uint32_t Frequency); FREQUENCY_Band_t FREQUENCY_GetBand(uint32_t Frequency);
uint8_t FREQUENCY_CalculateOutputPower(uint8_t TxpLow, uint8_t TxpMid, uint8_t TxpHigh, int32_t LowerLimit, int32_t Middle, int32_t UpperLimit, int32_t Frequency); uint8_t FREQUENCY_CalculateOutputPower(uint8_t TxpLow, uint8_t TxpMid, uint8_t TxpHigh, int32_t LowerLimit, int32_t Middle, int32_t UpperLimit, int32_t Frequency);

View File

@ -34,6 +34,10 @@
#include "radio.h" #include "radio.h"
#include "settings.h" #include "settings.h"
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
#endif
VFO_Info_t *gTxVfo; VFO_Info_t *gTxVfo;
VFO_Info_t *gRxVfo; VFO_Info_t *gRxVfo;
VFO_Info_t *gCurrentVfo; VFO_Info_t *gCurrentVfo;
@ -254,8 +258,8 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
gEeprom.VfoInfo[VFO].AM_CHANNEL_MODE = !!(Data[3] & 0x10); gEeprom.VfoInfo[VFO].AM_CHANNEL_MODE = !!(Data[3] & 0x10);
Tmp = Data[6]; Tmp = Data[6];
if (Tmp > STEP_8_33kHz) if (Tmp >= ARRAY_SIZE(StepFrequencyTable))
Tmp = STEP_25_0kHz; Tmp = STEP_12_5kHz;
gEeprom.VfoInfo[VFO].STEP_SETTING = Tmp; gEeprom.VfoInfo[VFO].STEP_SETTING = Tmp;
gEeprom.VfoInfo[VFO].StepFrequency = StepFrequencyTable[Tmp]; gEeprom.VfoInfo[VFO].StepFrequency = StepFrequencyTable[Tmp];

View File

@ -22,6 +22,7 @@
#include "driver/eeprom.h" // EEPROM_ReadBuffer() #include "driver/eeprom.h" // EEPROM_ReadBuffer()
#include "driver/st7565.h" #include "driver/st7565.h"
#include "external/printf/printf.h" #include "external/printf/printf.h"
#include "frequencies.h"
#include "helper/battery.h" #include "helper/battery.h"
#include "misc.h" #include "misc.h"
#include "settings.h" #include "settings.h"
@ -30,6 +31,10 @@
#include "ui/menu.h" #include "ui/menu.h"
#include "ui/ui.h" #include "ui/ui.h"
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
#endif
const char MenuList[][7] = const char MenuList[][7] =
{ {
"SQL", "SQL",
@ -106,30 +111,6 @@ const char MenuList[][7] =
"" // end of list "" // end of list
}; };
#if 0
static const uint16_t gSubMenu_Step[] =
{
250,
500,
625,
1000,
1250,
2500,
833
};
#else
static const uint16_t gSubMenu_Step[] =
{
125,
250,
625,
1000,
1250,
2500,
833
};
#endif
static const char gSubMenu_TXP[3][5] = static const char gSubMenu_TXP[3][5] =
{ {
"LOW", "LOW",
@ -325,7 +306,7 @@ void UI_DisplayMenu(void)
break; break;
case MENU_STEP: case MENU_STEP:
sprintf(String, "%u.%02uKHz", gSubMenu_Step[gSubMenuSelection] / 100, gSubMenu_Step[gSubMenuSelection] % 100); sprintf(String, "%u.%02uKHz", StepFrequencyTable[gSubMenuSelection] / 100, StepFrequencyTable[gSubMenuSelection] % 100);
break; break;
case MENU_TXP: case MENU_TXP: