Skip to content

Commit

Permalink
add new/missing custom button functions
Browse files Browse the repository at this point in the history
  • Loading branch information
egzumer committed Feb 27, 2024
1 parent 8b861d6 commit bd890b1
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions uvk5_egzumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@
ENABLE_VOICE:1,
ENABLE_NOAA:1,
ENABLE_FMRADIO:1;
u8 __UNUSED:3,
u8 __UNUSED:2,
ENABLE_SPECTRUM:1,
ENABLE_AM_FIX:1,
ENABLE_BLMIN_TMP_OFF:1,
ENABLE_RAW_DEMODULATORS:1,
Expand Down Expand Up @@ -418,7 +419,9 @@
"Lock keypad",
"Switch main VFO",
"Switch frequency/memory mode",
"Switch demodulation"
"Switch demodulation",
"Min backlight temporary off",
"Spectrum analyzer"
]

MIC_GAIN_LIST = ["+1.1dB", "+4.0dB", "+8.0dB", "+12.0dB", "+15.1dB"]
Expand Down Expand Up @@ -933,16 +936,21 @@ def append_label(radio_setting, label, descr=""):
# Programmable keys
def get_action(action_num):
""""get actual key action"""
has_alarm = self._memobj.BUILD_OPTIONS.ENABLE_ALARM
has1750 = self._memobj.BUILD_OPTIONS.ENABLE_TX1750
has_flashlight = self._memobj.BUILD_OPTIONS.ENABLE_FLASHLIGHT
lst = KEYACTIONS_LIST.copy()
if not has_alarm:
if not self._memobj.BUILD_OPTIONS.ENABLE_ALARM:
lst.remove("Alarm")
if not has1750:
if not self._memobj.BUILD_OPTIONS.ENABLE_TX1750:
lst.remove("1750Hz tone")
if not has_flashlight:
if not self._memobj.BUILD_OPTIONS.ENABLE_FLASHLIGHT:
lst.remove("Flashlight")
if not self._memobj.BUILD_OPTIONS.ENABLE_VOX:
lst.remove("VOX")
if not self._memobj.BUILD_OPTIONS.ENABLE_FMRADIO:
lst.remove("FM broadcast radio")
if not self._memobj.BUILD_OPTIONS.ENABLE_BLMIN_TMP_OFF:
lst.remove("Min backlight temporary off")
if not self._memobj.BUILD_OPTIONS.ENABLE_SPECTRUM:
lst.remove("Spectrum analyzer")

action_num = int(action_num)
if action_num >= len(KEYACTIONS_LIST) or \
Expand Down

0 comments on commit bd890b1

Please sign in to comment.