4 Commits

Author SHA1 Message Date
Matias Fernandez
7607f0a4bd Fix typo in README.md 2024-03-26 20:33:06 +01:00
Krzysiek Egzmont
f2cdf1975f refactor 2024-03-17 15:43:45 +01:00
Bogdan-Ioan BRUDIU
eeee11cf1b spectrum analyzer assignable to Side button, close #478
Signed-off-by: Krzysiek Egzmont <egzumer@gmail.com>
2024-02-23 21:43:38 +01:00
egzumer
1da45d5a77 Update README.md 2024-02-21 00:16:58 +01:00
16 changed files with 51 additions and 64 deletions

View File

@@ -4,10 +4,7 @@ This repository is a merge of [OneOfEleven custom firmware](https://github.com/O
All is a cloned and customized version of DualTachyon's open firmware found [here](https://github.com/DualTachyon/uv-k5-firmware) ... a cool achievement !
> [!TIP]
> There is a work done by others on forks of this repository. I encourage you to take a look at those too.
You can use below links to see comparison between forks.<br>
https://gitpop2.vercel.app/egzumer/uv-k5-firmware-custom<br>
https://useful-forks.github.io/?repo=egzumer/uv-k5-firmware-custom
> There is a work done by others on forks of this repository. I encourage you to take a look at those too. [SEE HERE](https://github.com/egzumer/uv-k5-firmware-custom/discussions/485)
> [!WARNING]
> Use this firmware at your own risk (entirely). There is absolutely no guarantee that it will work in any way shape or form on your radio(s), it may even brick your radio(s), in which case, you'd need to buy another radio.
@@ -86,7 +83,7 @@ You'll find the options at the top of "Makefile" ('0' = disable, '1' = enable) .
|Build option | Description |
| --- | ---- |
|🧰 **STOCK QUANSHENG FERATURES**||
|🧰 **STOCK QUANSHENG FEATURES**||
| ENABLE_UART | without this you can't configure radio via PC ! |
| ENABLE_AIRCOPY | easier to just enter frequency with butts |
| ENABLE_FMRADIO | WBFM VHF broadcast band receiver |

View File

@@ -53,6 +53,10 @@ inline static void ACTION_Alarm() { ACTION_AlarmOr1750(false); }
inline static void ACTION_1750() { ACTION_AlarmOr1750(true); };
#endif
#ifdef ENABLE_SPECTRUM
#include "app/spectrum.h"
#endif
inline static void ACTION_ScanRestart() { ACTION_Scan(true); };
void (*action_opt_table[])(void) = {
@@ -100,6 +104,12 @@ void (*action_opt_table[])(void) = {
#else
[ACTION_OPT_BLMIN_TMP_OFF] = &FUNCTION_NOP,
#endif
#ifdef ENABLE_SPECTRUM
[ACTION_OPT_SPECTRUM] = &APP_RunSpectrum,
#else
[ACTION_OPT_SPECTRUM] = &FUNCTION_NOP,
#endif
};
static_assert(ARRAY_SIZE(action_opt_table) == ACTION_OPT_LEN);

View File

@@ -1139,8 +1139,7 @@ void MENU_ShowCurrentSetting(void)
case MENU_F1LONG:
case MENU_F2SHRT:
case MENU_F2LONG:
case MENU_MLONG:
{
case MENU_MLONG: {
uint8_t * fun[]= {
&gEeprom.KEY_1_SHORT_PRESS_ACTION,
&gEeprom.KEY_1_LONG_PRESS_ACTION,
@@ -1202,17 +1201,14 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
gRequestDisplayScreen = DISPLAY_MENU;
if (!gIsInSubMenu)
{
switch (gInputBoxIndex)
{
if (!gIsInSubMenu) {
switch (gInputBoxIndex) {
case 2:
gInputBoxIndex = 0;
Value = (gInputBox[0] * 10) + gInputBox[1];
if (Value > 0 && Value <= gMenuListCount)
{
if (Value > 0 && Value <= gMenuListCount) {
gMenuCursor = Value - 1;
gFlagRefreshSetting = true;
return;
@@ -1226,8 +1222,7 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
[[fallthrough]];
case 1:
Value = gInputBox[0];
if (Value > 0 && Value <= gMenuListCount)
{
if (Value > 0 && Value <= gMenuListCount) {
gMenuCursor = Value - 1;
gFlagRefreshSetting = true;
return;
@@ -1241,21 +1236,19 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
return;
}
if (UI_MENU_GetCurrentMenuId() == MENU_OFFSET)
{
if (UI_MENU_GetCurrentMenuId() == MENU_OFFSET) {
uint32_t Frequency;
if (gInputBoxIndex < 6)
{ // invalid frequency
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
#endif
if (gInputBoxIndex < 6) { // invalid frequency
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
#endif
return;
}
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
#endif
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
#endif
Frequency = StrToUL(INPUTBOX_GetAscii())*100;
gSubMenuSelection = FREQUENCY_RoundToStep(Frequency, gTxVfo->StepFrequency);
@@ -1270,11 +1263,10 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
UI_MENU_GetCurrentMenuId() == MENU_MEM_NAME)
{ // enter 3-digit channel number
if (gInputBoxIndex < 3)
{
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
#endif
if (gInputBoxIndex < 3) {
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
#endif
gRequestDisplayScreen = DISPLAY_MENU;
return;
}
@@ -1283,11 +1275,10 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
Value = ((gInputBox[0] * 100) + (gInputBox[1] * 10) + gInputBox[2]) - 1;
if (IS_MR_CHANNEL(Value))
{
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
#endif
if (IS_MR_CHANNEL(Value)) {
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
#endif
gSubMenuSelection = Value;
return;
}
@@ -1296,8 +1287,7 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
return;
}
if (MENU_GetLimits(UI_MENU_GetCurrentMenuId(), &Min, &Max))
{
if (MENU_GetLimits(UI_MENU_GetCurrentMenuId(), &Min, &Max)) {
gInputBoxIndex = 0;
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
return;
@@ -1305,8 +1295,7 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
Offset = (Max >= 100) ? 3 : (Max >= 10) ? 2 : 1;
switch (gInputBoxIndex)
{
switch (gInputBoxIndex) {
case 1:
Value = gInputBox[0];
break;
@@ -1321,8 +1310,7 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
if (Offset == gInputBoxIndex)
gInputBoxIndex = 0;
if (Value <= Max)
{
if (Value <= Max) {
gSubMenuSelection = Value;
return;
}
@@ -1613,16 +1601,13 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
gInputBoxIndex = 0;
}
else
if (!bKeyPressed)
else if (!bKeyPressed)
return;
if (SCANNER_IsScanning()) {
if (SCANNER_IsScanning())
return;
}
if (!gIsInSubMenu)
{
if (!gIsInSubMenu) {
gMenuCursor = NUMBER_AddWithWraparound(gMenuCursor, -Direction, 0, gMenuListCount - 1);
gFlagRefreshSetting = true;
@@ -1640,11 +1625,9 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
return;
}
if (UI_MENU_GetCurrentMenuId() == MENU_OFFSET)
{
if (UI_MENU_GetCurrentMenuId() == MENU_OFFSET) {
int32_t Offset = (Direction * gTxVfo->StepFrequency) + gSubMenuSelection;
if (Offset < 99999990)
{
if (Offset < 99999990) {
if (Offset < 0)
Offset = 99999990;
}
@@ -1688,18 +1671,8 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
void MENU_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
{
switch (Key)
{
case KEY_0:
case KEY_1:
case KEY_2:
case KEY_3:
case KEY_4:
case KEY_5:
case KEY_6:
case KEY_7:
case KEY_8:
case KEY_9:
switch (Key) {
case KEY_0...KEY_9:
MENU_Key_0_to_9(Key, bKeyPressed, bKeyHeld);
break;
case KEY_MENU:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@@ -757,6 +757,9 @@ buf[1] = 0
#ifdef ENABLE_AM_FIX
| (1 << 4)
#endif
#ifdef ENABLE_SPECTRUM
| (1 << 5)
#endif
;
EEPROM_WriteBuffer(0x1FF0, buf);
}

View File

@@ -90,6 +90,7 @@ enum ACTION_OPT_t {
ACTION_OPT_VFO_MR,
ACTION_OPT_SWITCH_DEMODUL,
ACTION_OPT_BLMIN_TMP_OFF, //BackLight Minimum Temporay OFF
ACTION_OPT_SPECTRUM,
ACTION_OPT_LEN
};

View File

@@ -362,6 +362,9 @@ const t_sidefunction gSubMenu_SIDEFUNCTIONS[] =
#ifdef ENABLE_BLMIN_TMP_OFF
{"BLMIN\nTMP OFF", ACTION_OPT_BLMIN_TMP_OFF}, //BackLight Minimum Temporay OFF
#endif
#ifdef ENABLE_SPECTRUM
{"SPECTRUM", ACTION_OPT_SPECTRUM}
#endif
};
const uint8_t gSubMenu_SIDEFUNCTIONS_size = ARRAY_SIZE(gSubMenu_SIDEFUNCTIONS);