mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-28 22:31:25 +03:00
Fixed error I made in makefile (python call now works - IF you have python installed)
This commit is contained in:
parent
5fe4e81c79
commit
835378c78c
16
Makefile
16
Makefile
@ -1,6 +1,8 @@
|
|||||||
|
|
||||||
# compile options (see Readme.md)
|
# compile options (see Readme.md)
|
||||||
# '0' = disable, 1 = enable
|
# '0' = disable
|
||||||
|
# '1' = enable
|
||||||
|
#
|
||||||
ENABLE_SWD := 0
|
ENABLE_SWD := 0
|
||||||
ENABLE_OVERLAY := 1
|
ENABLE_OVERLAY := 1
|
||||||
ENABLE_UART := 1
|
ENABLE_UART := 1
|
||||||
@ -19,6 +21,7 @@ ENABLE_BOOT_BEEPS := 0
|
|||||||
ENABLE_COMPANDER := 1
|
ENABLE_COMPANDER := 1
|
||||||
ENABLE_SHOW_CHARGE_LEVEL := 0
|
ENABLE_SHOW_CHARGE_LEVEL := 0
|
||||||
ENABLE_REVERSE_BAT_SYMBOL := 1
|
ENABLE_REVERSE_BAT_SYMBOL := 1
|
||||||
|
ENABLE_AUDIO_BAR := 0
|
||||||
#ENABLE_SINGLE_VFO_CHAN := 1
|
#ENABLE_SINGLE_VFO_CHAN := 1
|
||||||
#ENABLE_BAND_SCOPE := 1
|
#ENABLE_BAND_SCOPE := 1
|
||||||
|
|
||||||
@ -127,7 +130,9 @@ LD = arm-none-eabi-gcc
|
|||||||
OBJCOPY = arm-none-eabi-objcopy
|
OBJCOPY = arm-none-eabi-objcopy
|
||||||
SIZE = arm-none-eabi-size
|
SIZE = arm-none-eabi-size
|
||||||
|
|
||||||
|
# the user might not have/want git installed
|
||||||
GIT_HASH := $(shell git rev-parse --short HEAD)
|
GIT_HASH := $(shell git rev-parse --short HEAD)
|
||||||
|
$(info GIT_HASH = $(GIT_HASH))
|
||||||
|
|
||||||
ASFLAGS = -c -mcpu=cortex-m0
|
ASFLAGS = -c -mcpu=cortex-m0
|
||||||
ifeq ($(ENABLE_OVERLAY),1)
|
ifeq ($(ENABLE_OVERLAY),1)
|
||||||
@ -135,7 +140,6 @@ ifeq ($(ENABLE_OVERLAY),1)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS = -Os -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=c11 -MMD
|
CFLAGS = -Os -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=c11 -MMD
|
||||||
#CFLAGS = -Os -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=c11 -MMD -fdata-sections -ffunction-sections
|
|
||||||
CFLAGS += -DPRINTF_INCLUDE_CONFIG_H
|
CFLAGS += -DPRINTF_INCLUDE_CONFIG_H
|
||||||
CFLAGS += -DGIT_HASH=\"$(GIT_HASH)\"
|
CFLAGS += -DGIT_HASH=\"$(GIT_HASH)\"
|
||||||
ifeq ($(ENABLE_SWD),1)
|
ifeq ($(ENABLE_SWD),1)
|
||||||
@ -192,6 +196,9 @@ endif
|
|||||||
ifeq ($(ENABLE_REVERSE_BAT_SYMBOL),1)
|
ifeq ($(ENABLE_REVERSE_BAT_SYMBOL),1)
|
||||||
CFLAGS += -DENABLE_REVERSE_BAT_SYMBOL
|
CFLAGS += -DENABLE_REVERSE_BAT_SYMBOL
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(ENABLE_AUDIO_BAR),1)
|
||||||
|
CFLAGS += -DENABLE_AUDIO_BAR
|
||||||
|
endif
|
||||||
ifeq ($(ENABLE_SINGLE_VFO_CHAN),1)
|
ifeq ($(ENABLE_SINGLE_VFO_CHAN),1)
|
||||||
CFLAGS += -DENABLE_SINGLE_VFO_CHAN
|
CFLAGS += -DENABLE_SINGLE_VFO_CHAN
|
||||||
endif
|
endif
|
||||||
@ -200,7 +207,6 @@ ifeq ($(ENABLE_BAND_SCOPE),1)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
LDFLAGS = -mcpu=cortex-m0 -nostartfiles -Wl,-T,firmware.ld
|
LDFLAGS = -mcpu=cortex-m0 -nostartfiles -Wl,-T,firmware.ld
|
||||||
#LDFLAGS = -mcpu=cortex-m0 -nostartfiles -Wl,-T,firmware.ld,--gc-sections
|
|
||||||
|
|
||||||
ifeq ($(DEBUG),1)
|
ifeq ($(DEBUG),1)
|
||||||
ASFLAGS += -g
|
ASFLAGS += -g
|
||||||
@ -219,8 +225,8 @@ DEPS = $(OBJS:.o=.d)
|
|||||||
|
|
||||||
all: $(TARGET)
|
all: $(TARGET)
|
||||||
$(OBJCOPY) -O binary $< $<.bin
|
$(OBJCOPY) -O binary $< $<.bin
|
||||||
# -python fw-pack.py $<.bin $(GIT_HASH) $<.packed.bin
|
-python fw-pack.py $<.bin $(GIT_HASH) $<.packed.bin
|
||||||
# -python3 fw-pack.py $<.bin $(GIT_HASH) $<.packed.bin
|
-python3 fw-pack.py $<.bin $(GIT_HASH) $<.packed.bin
|
||||||
$(SIZE) $<
|
$(SIZE) $<
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
|
@ -30,6 +30,7 @@ ENABLE_BOOT_BEEPS := 0 give user audio feedback on volume knob
|
|||||||
ENABLE_COMPANDER := 1 compander option (per channel)
|
ENABLE_COMPANDER := 1 compander option (per channel)
|
||||||
ENABLE_SHOW_CHARGE_LEVEL := 1 show the charge level when the radio is on charge
|
ENABLE_SHOW_CHARGE_LEVEL := 1 show the charge level when the radio is on charge
|
||||||
ENABLE_REVERSE_BAT_SYMBOL := 1 mirror the battery symbol on the status bar (+ pole on the right)
|
ENABLE_REVERSE_BAT_SYMBOL := 1 mirror the battery symbol on the status bar (+ pole on the right)
|
||||||
|
ENABLE_AUDIO_BAR := 0 experimentle, display an audo bar level when TX'ing
|
||||||
#ENABLE_SINGLE_VFO_CHAN := 1 not yet implemented - single VFO on display when possible
|
#ENABLE_SINGLE_VFO_CHAN := 1 not yet implemented - single VFO on display when possible
|
||||||
#ENABLE_BAND_SCOPE := 1 not yet implemented - spectrum/pan-adapter
|
#ENABLE_BAND_SCOPE := 1 not yet implemented - spectrum/pan-adapter
|
||||||
```
|
```
|
||||||
@ -67,7 +68,8 @@ To compile directly in windows without the need of a linux virtual machine:
|
|||||||
```
|
```
|
||||||
1. Download and install "gcc-arm-none-eabi-10.3-2021.10-win32.exe" from https://developer.arm.com/downloads/-/gnu-rm
|
1. Download and install "gcc-arm-none-eabi-10.3-2021.10-win32.exe" from https://developer.arm.com/downloads/-/gnu-rm
|
||||||
2. Download and install "gnu_make-3.81.exe" from https://gnuwin32.sourceforge.net/packages/make.htm
|
2. Download and install "gnu_make-3.81.exe" from https://gnuwin32.sourceforge.net/packages/make.htm
|
||||||
3. You may (or may not) need to reboot your PC after installing the above
|
3. You may (or not) need to manualy add gcc path to you OS environment PATH, ie C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin
|
||||||
|
4. You may (or not) need to reboot your PC after installing the above
|
||||||
```
|
```
|
||||||
|
|
||||||
Then you can run 'win_make.bat' from the directory you saved this source code too.
|
Then you can run 'win_make.bat' from the directory you saved this source code too.
|
||||||
|
25
app/app.c
25
app/app.c
@ -56,6 +56,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include "ui/battery.h"
|
#include "ui/battery.h"
|
||||||
#include "ui/inputbox.h"
|
#include "ui/inputbox.h"
|
||||||
|
#include "ui/main.h"
|
||||||
#include "ui/menu.h"
|
#include "ui/menu.h"
|
||||||
#include "ui/rssi.h"
|
#include "ui/rssi.h"
|
||||||
#include "ui/status.h"
|
#include "ui/status.h"
|
||||||
@ -389,6 +390,9 @@ static void APP_HandleFunction(void)
|
|||||||
if (!gRxIdleMode)
|
if (!gRxIdleMode)
|
||||||
APP_CheckForIncoming();
|
APP_CheckForIncoming();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case FUNCTION_BAND_SCOPE:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1515,16 +1519,33 @@ void APP_TimeSlice10ms(void)
|
|||||||
APP_CheckRadioInterrupts();
|
APP_CheckRadioInterrupts();
|
||||||
|
|
||||||
if (gCurrentFunction != FUNCTION_TRANSMIT)
|
if (gCurrentFunction != FUNCTION_TRANSMIT)
|
||||||
{
|
{ // receiving
|
||||||
if (gUpdateStatus)
|
if (gUpdateStatus)
|
||||||
UI_DisplayStatus(false);
|
UI_DisplayStatus(false);
|
||||||
|
|
||||||
if (gUpdateDisplay)
|
if (gUpdateDisplay)
|
||||||
{
|
{
|
||||||
GUI_DisplayScreen();
|
|
||||||
gUpdateDisplay = false;
|
gUpdateDisplay = false;
|
||||||
|
GUI_DisplayScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{ // transmitting
|
||||||
|
#ifdef ENABLE_AUDIO_BAR
|
||||||
|
if (gSetting_mic_bar && (gFlashLightBlinkCounter % (100 / 10)) == 0) // once every 100ms
|
||||||
|
UI_DisplayAudioBar();
|
||||||
|
//gUpdateDisplay = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (gUpdateDisplay)
|
||||||
|
{
|
||||||
|
gUpdateDisplay = false;
|
||||||
|
GUI_DisplayScreen();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gUpdateStatus)
|
||||||
|
UI_DisplayStatus(false);
|
||||||
|
}
|
||||||
|
|
||||||
// Skipping authentic device checks
|
// Skipping authentic device checks
|
||||||
|
|
||||||
|
16
app/menu.c
16
app/menu.c
@ -82,6 +82,7 @@
|
|||||||
VOICE_ID_INVALID, // STE
|
VOICE_ID_INVALID, // STE
|
||||||
VOICE_ID_INVALID, // RP-STE
|
VOICE_ID_INVALID, // RP-STE
|
||||||
VOICE_ID_INVALID, // MIC
|
VOICE_ID_INVALID, // MIC
|
||||||
|
VOICE_ID_INVALID, // MICBAR
|
||||||
#ifdef ENABLE_COMPANDER
|
#ifdef ENABLE_COMPANDER
|
||||||
VOICE_ID_INVALID, // COMPND
|
VOICE_ID_INVALID, // COMPND
|
||||||
#endif
|
#endif
|
||||||
@ -254,6 +255,9 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_AUDIO_BAR
|
||||||
|
case MENU_MIC_BAR:
|
||||||
|
#endif
|
||||||
case MENU_BCL:
|
case MENU_BCL:
|
||||||
case MENU_BEEP:
|
case MENU_BEEP:
|
||||||
case MENU_AUTOLK:
|
case MENU_AUTOLK:
|
||||||
@ -596,6 +600,12 @@ void MENU_AcceptSetting(void)
|
|||||||
gFlagReconfigureVfos = true;
|
gFlagReconfigureVfos = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef ENABLE_AUDIO_BAR
|
||||||
|
case MENU_MIC_BAR:
|
||||||
|
gSetting_mic_bar = gSubMenuSelection;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_COMPANDER
|
#ifdef ENABLE_COMPANDER
|
||||||
case MENU_COMPAND:
|
case MENU_COMPAND:
|
||||||
gTxVfo->Compander = gSubMenuSelection;
|
gTxVfo->Compander = gSubMenuSelection;
|
||||||
@ -966,6 +976,12 @@ void MENU_ShowCurrentSetting(void)
|
|||||||
gSubMenuSelection = gEeprom.MIC_SENSITIVITY;
|
gSubMenuSelection = gEeprom.MIC_SENSITIVITY;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef ENABLE_AUDIO_BAR
|
||||||
|
case MENU_MIC_BAR:
|
||||||
|
gSubMenuSelection = gSetting_mic_bar;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_COMPANDER
|
#ifdef ENABLE_COMPANDER
|
||||||
case MENU_COMPAND:
|
case MENU_COMPAND:
|
||||||
gSubMenuSelection = gTxVfo->Compander;
|
gSubMenuSelection = gTxVfo->Compander;
|
||||||
|
3
board.c
3
board.c
@ -709,6 +709,9 @@ void BOARD_EEPROM_Init(void)
|
|||||||
gSetting_TX_EN = (Data[7] & (1u << 0)) ? true : false;
|
gSetting_TX_EN = (Data[7] & (1u << 0)) ? true : false;
|
||||||
gSetting_live_DTMF_decoder = (Data[7] & (1u << 1)) ? true : false;
|
gSetting_live_DTMF_decoder = (Data[7] & (1u << 1)) ? true : false;
|
||||||
gSetting_battery_text = (((Data[7] >> 2) & 3u) <= 2) ? (Data[7] >> 2) & 3: 2;
|
gSetting_battery_text = (((Data[7] >> 2) & 3u) <= 2) ? (Data[7] >> 2) & 3: 2;
|
||||||
|
#ifdef ENABLE_AUDIO_BAR
|
||||||
|
gSetting_mic_bar = (Data[7] & (1u << 4)) ? true : false;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!gEeprom.VFO_OPEN)
|
if (!gEeprom.VFO_OPEN)
|
||||||
{
|
{
|
||||||
|
@ -821,19 +821,23 @@ void BK4819_DisableDTMF(void)
|
|||||||
void BK4819_EnableDTMF(void)
|
void BK4819_EnableDTMF(void)
|
||||||
{
|
{
|
||||||
// no idea what this register does
|
// no idea what this register does
|
||||||
BK4819_WriteRegister(BK4819_REG_21, 0x06D8);
|
BK4819_WriteRegister(BK4819_REG_21, 0x06D8); // 0000 0110 1101 1000
|
||||||
|
|
||||||
// REG_24 <5> 0 DTMF/SelCall Enable
|
// REG_24 <15> 1 ???
|
||||||
|
// REG_24 <14:7> 24 Threshold
|
||||||
|
// REG_24 <6> 1 ???
|
||||||
|
// REG_24 <5> 0 DTMF/SelCall enable
|
||||||
// 1 = Enable
|
// 1 = Enable
|
||||||
// 0 = Disable
|
// 0 = Disable
|
||||||
// REG_24 <4> 1 DTMF or SelCall Detection Mode
|
// REG_24 <4> 1 DTMF or SelCall detection mode
|
||||||
// 1 = for DTMF
|
// 1 = for DTMF
|
||||||
// 0 = for SelCall
|
// 0 = for SelCall
|
||||||
// REG_24 <3:0> 14 Max Symbol Number for SelCall Detection
|
// REG_24 <3:0> 14 Max symbol number for SelCall detection
|
||||||
//
|
//
|
||||||
BK4819_WriteRegister(BK4819_REG_24,
|
const uint16_t threshold = 24;
|
||||||
|
BK4819_WriteRegister(BK4819_REG_24, // 1 00011000 1 1 1 1110
|
||||||
(1u << BK4819_REG_24_SHIFT_UNKNOWN_15)
|
(1u << BK4819_REG_24_SHIFT_UNKNOWN_15)
|
||||||
| (24u << BK4819_REG_24_SHIFT_THRESHOLD)
|
| (threshold << BK4819_REG_24_SHIFT_THRESHOLD)
|
||||||
| (1u << BK4819_REG_24_SHIFT_UNKNOWN_6)
|
| (1u << BK4819_REG_24_SHIFT_UNKNOWN_6)
|
||||||
| BK4819_REG_24_ENABLE
|
| BK4819_REG_24_ENABLE
|
||||||
| BK4819_REG_24_SELECT_DTMF
|
| BK4819_REG_24_SELECT_DTMF
|
||||||
@ -1185,6 +1189,26 @@ uint16_t BK4819_GetRSSI(void)
|
|||||||
return BK4819_ReadRegister(BK4819_REG_67) & 0x01FF;
|
return BK4819_ReadRegister(BK4819_REG_67) & 0x01FF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t BK4819_GetGlitchIndicator(void)
|
||||||
|
{
|
||||||
|
return BK4819_ReadRegister(BK4819_REG_63) & 0x00FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t BK4819_GetExNoiceIndicator(void)
|
||||||
|
{
|
||||||
|
return BK4819_ReadRegister(BK4819_REG_65) & 0x007F;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t BK4819_GetVoiceAmplitudeOut(void)
|
||||||
|
{
|
||||||
|
return BK4819_ReadRegister(BK4819_REG_64);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t BK4819_GetAfTxRx(void)
|
||||||
|
{
|
||||||
|
return BK4819_ReadRegister(BK4819_REG_6F) & 0x003F;
|
||||||
|
}
|
||||||
|
|
||||||
bool BK4819_GetFrequencyScanResult(uint32_t *pFrequency)
|
bool BK4819_GetFrequencyScanResult(uint32_t *pFrequency)
|
||||||
{
|
{
|
||||||
const uint16_t High = BK4819_ReadRegister(BK4819_REG_0D);
|
const uint16_t High = BK4819_ReadRegister(BK4819_REG_0D);
|
||||||
|
@ -132,6 +132,10 @@ void BK4819_EnableCDCSS(void);
|
|||||||
void BK4819_EnableCTCSS(void);
|
void BK4819_EnableCTCSS(void);
|
||||||
|
|
||||||
uint16_t BK4819_GetRSSI(void);
|
uint16_t BK4819_GetRSSI(void);
|
||||||
|
uint8_t BK4819_GetGlitchIndicator(void);
|
||||||
|
uint8_t BK4819_GetExNoiceIndicator(void);
|
||||||
|
uint16_t BK4819_GetVoiceAmplitudeOut(void);
|
||||||
|
uint8_t BK4819_GetAfTxRx(void);
|
||||||
|
|
||||||
bool BK4819_GetFrequencyScanResult(uint32_t *pFrequency);
|
bool BK4819_GetFrequencyScanResult(uint32_t *pFrequency);
|
||||||
BK4819_CssScanResult_t BK4819_GetCxCSSScanResult(uint32_t *pCdcssFreq, uint16_t *pCtcssFreq);
|
BK4819_CssScanResult_t BK4819_GetCxCSSScanResult(uint32_t *pCdcssFreq, uint16_t *pCtcssFreq);
|
||||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
@ -193,6 +193,9 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
|
|||||||
BK4819_DisableScramble();
|
BK4819_DisableScramble();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case FUNCTION_BAND_SCOPE:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gBatterySaveCountdown_10ms = battery_save_count_10ms;
|
gBatterySaveCountdown_10ms = battery_save_count_10ms;
|
||||||
|
@ -26,7 +26,8 @@ enum FUNCTION_Type_t
|
|||||||
FUNCTION_MONITOR,
|
FUNCTION_MONITOR,
|
||||||
FUNCTION_INCOMING,
|
FUNCTION_INCOMING,
|
||||||
FUNCTION_RECEIVE,
|
FUNCTION_RECEIVE,
|
||||||
FUNCTION_POWER_SAVE
|
FUNCTION_POWER_SAVE,
|
||||||
|
FUNCTION_BAND_SCOPE
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum FUNCTION_Type_t FUNCTION_Type_t;
|
typedef enum FUNCTION_Type_t FUNCTION_Type_t;
|
||||||
|
@ -68,7 +68,8 @@ void BOOT_ProcessMode(BOOT_Mode_t Mode)
|
|||||||
{
|
{
|
||||||
// enable all the menu items
|
// enable all the menu items
|
||||||
gMenuListCount = 0;
|
gMenuListCount = 0;
|
||||||
while (MenuList[gMenuListCount][0] != 0)
|
//while (MenuList[gMenuListCount][0] != 0)
|
||||||
|
while (MenuList[gMenuListCount] != NULL)
|
||||||
gMenuListCount++;
|
gMenuListCount++;
|
||||||
|
|
||||||
gMenuCursor = MENU_350TX;
|
gMenuCursor = MENU_350TX;
|
||||||
|
13
main.c
13
main.c
@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <stdio.h> // NULL
|
||||||
|
|
||||||
#include "app/app.h"
|
#include "app/app.h"
|
||||||
#include "app/dtmf.h"
|
#include "app/dtmf.h"
|
||||||
@ -95,7 +96,12 @@ void Main(void)
|
|||||||
|
|
||||||
BATTERY_GetReadings(false);
|
BATTERY_GetReadings(false);
|
||||||
|
|
||||||
|
// count the number of menu list items
|
||||||
gMenuListCount = 0;
|
gMenuListCount = 0;
|
||||||
|
// while (MenuList[gMenuListCount][0] != 0)
|
||||||
|
while (MenuList[gMenuListCount] != NULL)
|
||||||
|
gMenuListCount++;
|
||||||
|
gMenuListCount -= 8; // disable the last few menu items .. they are the normally 'hidden' menu items
|
||||||
|
|
||||||
boot_counter_10ms = 250; // 2.5 sec
|
boot_counter_10ms = 250; // 2.5 sec
|
||||||
|
|
||||||
@ -114,13 +120,6 @@ void Main(void)
|
|||||||
{
|
{
|
||||||
BOOT_Mode_t BootMode;
|
BOOT_Mode_t BootMode;
|
||||||
|
|
||||||
// count the number of menu list items
|
|
||||||
while (MenuList[gMenuListCount][0] != 0)
|
|
||||||
gMenuListCount++;
|
|
||||||
// disable the N menu items
|
|
||||||
//gMenuListCount -= 6;
|
|
||||||
gMenuListCount -= 8;
|
|
||||||
|
|
||||||
UI_DisplayWelcome();
|
UI_DisplayWelcome();
|
||||||
BACKLIGHT_TurnOn();
|
BACKLIGHT_TurnOn();
|
||||||
|
|
||||||
|
7
misc.c
7
misc.c
@ -50,8 +50,8 @@ const uint16_t dual_watch_count_toggle_10ms = 100 / 10; // 100ms betw
|
|||||||
const uint16_t battery_save_count_10ms = 10000 / 10; // 10 seconds
|
const uint16_t battery_save_count_10ms = 10000 / 10; // 10 seconds
|
||||||
|
|
||||||
const uint16_t gMax_bat_v = 843; // 8.43V
|
const uint16_t gMax_bat_v = 843; // 8.43V
|
||||||
//const uint16_t gMin_bat_v = 660; // 6.6V
|
const uint16_t gMin_bat_v = 660; // 6.6V
|
||||||
const uint16_t gMin_bat_v = 710; // 7.1V
|
//const uint16_t gMin_bat_v = 690; // 6.9V
|
||||||
|
|
||||||
const uint32_t gDefaultAesKey[4] = {0x4AA5CC60, 0x0312CC5F, 0xFFD2DABB, 0x6BBA7F92};
|
const uint32_t gDefaultAesKey[4] = {0x4AA5CC60, 0x0312CC5F, 0xFFD2DABB, 0x6BBA7F92};
|
||||||
|
|
||||||
@ -66,6 +66,9 @@ bool gSetting_TX_EN;
|
|||||||
uint8_t gSetting_F_LOCK;
|
uint8_t gSetting_F_LOCK;
|
||||||
bool gSetting_ScrambleEnable;
|
bool gSetting_ScrambleEnable;
|
||||||
|
|
||||||
|
#ifdef ENABLE_AUDIO_BAR
|
||||||
|
bool gSetting_mic_bar;
|
||||||
|
#endif
|
||||||
bool gSetting_live_DTMF_decoder;
|
bool gSetting_live_DTMF_decoder;
|
||||||
uint8_t gSetting_battery_text;
|
uint8_t gSetting_battery_text;
|
||||||
|
|
||||||
|
3
misc.h
3
misc.h
@ -127,6 +127,9 @@ extern bool gSetting_TX_EN;
|
|||||||
extern uint8_t gSetting_F_LOCK;
|
extern uint8_t gSetting_F_LOCK;
|
||||||
extern bool gSetting_ScrambleEnable;
|
extern bool gSetting_ScrambleEnable;
|
||||||
|
|
||||||
|
#ifdef ENABLE_AUDIO_BAR
|
||||||
|
extern bool gSetting_mic_bar;
|
||||||
|
#endif
|
||||||
extern bool gSetting_live_DTMF_decoder;
|
extern bool gSetting_live_DTMF_decoder;
|
||||||
extern uint8_t gSetting_battery_text;
|
extern uint8_t gSetting_battery_text;
|
||||||
|
|
||||||
|
@ -168,6 +168,9 @@ void SETTINGS_SaveSettings(void)
|
|||||||
if (!gSetting_TX_EN) State[7] &= ~(1u << 0);
|
if (!gSetting_TX_EN) State[7] &= ~(1u << 0);
|
||||||
if (!gSetting_live_DTMF_decoder) State[7] &= ~(1u << 1);
|
if (!gSetting_live_DTMF_decoder) State[7] &= ~(1u << 1);
|
||||||
State[7] = (State[7] & ~(3u << 2)) | ((gSetting_battery_text & 3u) << 2);
|
State[7] = (State[7] & ~(3u << 2)) | ((gSetting_battery_text & 3u) << 2);
|
||||||
|
#ifdef ENABLE_AUDIO_BAR
|
||||||
|
if (!gSetting_mic_bar) State[7] &= ~(1u << 4);
|
||||||
|
#endif
|
||||||
EEPROM_WriteBuffer(0x0F40, State);
|
EEPROM_WriteBuffer(0x0F40, State);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
45
ui/main.c
45
ui/main.c
@ -19,6 +19,7 @@
|
|||||||
#include "app/dtmf.h"
|
#include "app/dtmf.h"
|
||||||
#include "bitmaps.h"
|
#include "bitmaps.h"
|
||||||
#include "board.h"
|
#include "board.h"
|
||||||
|
#include "driver/bk4819.h"
|
||||||
#include "driver/st7565.h"
|
#include "driver/st7565.h"
|
||||||
#include "external/printf/printf.h"
|
#include "external/printf/printf.h"
|
||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
@ -34,6 +35,43 @@
|
|||||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
|
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_AUDIO_BAR
|
||||||
|
void UI_DisplayAudioBar(void)
|
||||||
|
{
|
||||||
|
// if (gCurrentFunction == FUNCTION_TRANSMIT && gSetting_mic_bar)
|
||||||
|
if (gSetting_mic_bar)
|
||||||
|
{
|
||||||
|
const unsigned int line = 3;
|
||||||
|
const unsigned int lcd_width = sizeof(gFrameBuffer[line]) - 2;
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
// TX audio level
|
||||||
|
const uint16_t voice_amp = BK4819_GetVoiceAmplitudeOut(); // 15:0
|
||||||
|
const unsigned int max = 32767;
|
||||||
|
const unsigned int level = (((uint32_t)voice_amp * lcd_width) + (max / 2)) / max; // with rounding
|
||||||
|
#else
|
||||||
|
// TX/RX AF input level (dB)
|
||||||
|
const uint8_t af_tx_rx = BK4819_GetAfTxRx(); // 6:0
|
||||||
|
const unsigned int max = 63;
|
||||||
|
const unsigned int level = (((uint16_t)af_tx_rx * lcd_width) + (max / 2)) / max; // with rounding
|
||||||
|
#endif
|
||||||
|
|
||||||
|
const unsigned int len = (level <= lcd_width) ? level : lcd_width;
|
||||||
|
uint8_t *pLine = gFrameBuffer[line];
|
||||||
|
memset(pLine, 0, lcd_width);
|
||||||
|
#if 0
|
||||||
|
// solid bar
|
||||||
|
memset(pLine, 0x3e, len);
|
||||||
|
#else
|
||||||
|
for (unsigned int i = 0; i < len; i += 2)
|
||||||
|
pLine[i] = 0x3e;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
ST7565_BlitFullScreen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void UI_DisplayMain(void)
|
void UI_DisplayMain(void)
|
||||||
{
|
{
|
||||||
char String[16];
|
char String[16];
|
||||||
@ -397,6 +435,7 @@ void UI_DisplayMain(void)
|
|||||||
}
|
}
|
||||||
UI_PrintStringSmall(String, LCD_WIDTH + 24, 0, Line + 1);
|
UI_PrintStringSmall(String, LCD_WIDTH + 24, 0, Line + 1);
|
||||||
|
|
||||||
|
if (State != VFO_STATE_TX_DISABLE)
|
||||||
{ // show the TX power
|
{ // show the TX power
|
||||||
const char pwr_list[] = "LMH";
|
const char pwr_list[] = "LMH";
|
||||||
const unsigned int i = gEeprom.VfoInfo[vfo_num].OUTPUT_POWER;
|
const unsigned int i = gEeprom.VfoInfo[vfo_num].OUTPUT_POWER;
|
||||||
@ -428,7 +467,7 @@ void UI_DisplayMain(void)
|
|||||||
UI_PrintStringSmall(String, LCD_WIDTH + 70, 0, Line + 1);
|
UI_PrintStringSmall(String, LCD_WIDTH + 70, 0, Line + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// show the DTMF decoding symbol
|
// show the DTMF decoding symbol(
|
||||||
if (gEeprom.VfoInfo[vfo_num].DTMF_DECODING_ENABLE || gSetting_KILLED)
|
if (gEeprom.VfoInfo[vfo_num].DTMF_DECODING_ENABLE || gSetting_KILLED)
|
||||||
UI_PrintStringSmall("DTMF", LCD_WIDTH + 78, 0, Line + 1);
|
UI_PrintStringSmall("DTMF", LCD_WIDTH + 78, 0, Line + 1);
|
||||||
|
|
||||||
@ -439,6 +478,10 @@ void UI_DisplayMain(void)
|
|||||||
|
|
||||||
if (center_line_is_free)
|
if (center_line_is_free)
|
||||||
{
|
{
|
||||||
|
#ifdef ENABLE_AUDIO_BAR
|
||||||
|
UI_DisplayAudioBar();
|
||||||
|
#endif
|
||||||
|
|
||||||
if (gSetting_live_DTMF_decoder && gDTMF_ReceivedSaved[0] >= 32)
|
if (gSetting_live_DTMF_decoder && gDTMF_ReceivedSaved[0] >= 32)
|
||||||
{ // show live DTMF decode
|
{ // show live DTMF decode
|
||||||
UI_PrintStringSmall(gDTMF_ReceivedSaved, 8, 0, 3);
|
UI_PrintStringSmall(gDTMF_ReceivedSaved, 8, 0, 3);
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#ifndef UI_MAIN_H
|
#ifndef UI_MAIN_H
|
||||||
#define UI_MAIN_H
|
#define UI_MAIN_H
|
||||||
|
|
||||||
|
void UI_DisplayAudioBar(void);
|
||||||
void UI_DisplayMain(void);
|
void UI_DisplayMain(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
11
ui/menu.c
11
ui/menu.c
@ -39,7 +39,7 @@
|
|||||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
|
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char MenuList[][7] =
|
const char *MenuList[] =
|
||||||
{
|
{
|
||||||
"SQL",
|
"SQL",
|
||||||
"STEP",
|
"STEP",
|
||||||
@ -74,6 +74,7 @@ const char MenuList[][7] =
|
|||||||
"STE",
|
"STE",
|
||||||
"RP-STE",
|
"RP-STE",
|
||||||
"MIC",
|
"MIC",
|
||||||
|
"MICBAR",
|
||||||
#ifdef ENABLE_COMPANDER
|
#ifdef ENABLE_COMPANDER
|
||||||
"COMPND",
|
"COMPND",
|
||||||
#endif
|
#endif
|
||||||
@ -118,7 +119,7 @@ const char MenuList[][7] =
|
|||||||
"TX-EN", // enable TX
|
"TX-EN", // enable TX
|
||||||
"F-CALI", // reference xtal calibration
|
"F-CALI", // reference xtal calibration
|
||||||
|
|
||||||
"" // end of list - DO NOT DELETE THIS ! .. I use this to compute this list size
|
NULL // end of list - DO NOT DELETE THIS
|
||||||
};
|
};
|
||||||
|
|
||||||
const char gSubMenu_TXP[3][5] =
|
const char gSubMenu_TXP[3][5] =
|
||||||
@ -325,6 +326,12 @@ void UI_DisplayMenu(void)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef ENABLE_AUDIO_BAR
|
||||||
|
case MENU_MIC_BAR:
|
||||||
|
strcpy(String, gSubMenu_OFF_ON[gSubMenuSelection]);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case MENU_STEP:
|
case MENU_STEP:
|
||||||
sprintf(String, "%d.%02uKHz", StepFrequencyTable[gSubMenuSelection] / 100, abs(StepFrequencyTable[gSubMenuSelection]) % 100);
|
sprintf(String, "%d.%02uKHz", StepFrequencyTable[gSubMenuSelection] / 100, abs(StepFrequencyTable[gSubMenuSelection]) % 100);
|
||||||
break;
|
break;
|
||||||
|
@ -55,6 +55,9 @@ enum
|
|||||||
MENU_STE,
|
MENU_STE,
|
||||||
MENU_RP_STE,
|
MENU_RP_STE,
|
||||||
MENU_MIC,
|
MENU_MIC,
|
||||||
|
#ifdef ENABLE_AUDIO_BAR
|
||||||
|
MENU_MIC_BAR,
|
||||||
|
#endif
|
||||||
#ifdef ENABLE_COMPANDER
|
#ifdef ENABLE_COMPANDER
|
||||||
MENU_COMPAND,
|
MENU_COMPAND,
|
||||||
#endif
|
#endif
|
||||||
@ -99,7 +102,7 @@ enum
|
|||||||
MENU_F_CALI // reference xtal calibration
|
MENU_F_CALI // reference xtal calibration
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const char MenuList[][7];
|
extern const char *MenuList[];
|
||||||
|
|
||||||
extern const char gSubMenu_TXP[3][5];
|
extern const char gSubMenu_TXP[3][5];
|
||||||
extern const char gSubMenu_SFT_D[3][4];
|
extern const char gSubMenu_SFT_D[3][4];
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#ifdef GIT_HASH
|
#ifdef GIT_HASH
|
||||||
#define VER GIT_HASH
|
#define VER GIT_HASH
|
||||||
#else
|
#else
|
||||||
#define VER "230920"
|
#define VER "230921"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char Version[] = "OEFW-"VER;
|
const char Version[] = "OEFW-"VER;
|
||||||
|
12
win_make.bat
12
win_make.bat
@ -15,13 +15,17 @@ del /S /Q *.d >nul 2>nul
|
|||||||
:: If you have python installed, you can create a 'packed' .bin from the compiled firmware.bin file.
|
:: If you have python installed, you can create a 'packed' .bin from the compiled firmware.bin file.
|
||||||
:: The Quangsheng windows upload-to-radio program requires a 'packed' .bin file.
|
:: The Quangsheng windows upload-to-radio program requires a 'packed' .bin file.
|
||||||
::
|
::
|
||||||
:: if you don't have python installed, then comment out the python line below, in which case you'll need
|
:: if you don't have python installed, then comment out the python line(s) below, in which case you'll need
|
||||||
:: to upload the standard firmware.bin file another way.
|
:: to upload the standard unpacked firmware.bin file another way.
|
||||||
|
::
|
||||||
:: I wrote a windows version of k5prog to do this easily in windows ..
|
:: I wrote a windows version of k5prog to do this easily in windows ..
|
||||||
:: https://github.com/OneOfEleven/k5prog-win
|
:: https://github.com/OneOfEleven/k5prog-win
|
||||||
::
|
|
||||||
::python -m pip install --upgrade pip crcmod
|
::python -m pip install --upgrade pip crcmod
|
||||||
fw-pack.py firmware.bin 230920 firmware.packed.bin
|
::python3 -m pip install --upgrade pip crcmod
|
||||||
|
|
||||||
|
::python fw-pack.py firmware.bin 230921 firmware.packed.bin
|
||||||
|
::python3 fw-pack.py firmware.bin 230921 firmware.packed.bin
|
||||||
|
|
||||||
::arm-none-eabi-size firmware
|
::arm-none-eabi-size firmware
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user