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

Bug fixes if FM radio enabled

This commit is contained in:
OneOfEleven 2023-09-25 13:27:52 +01:00
parent ed321778c0
commit bcfe977b36
16 changed files with 96 additions and 54 deletions

View File

@ -1,13 +1,13 @@
# compile options (see Readme.md) # compile options (see README.md for descriptions)
# '0' = disable # 0 = disable
# '1' = enable # 1 = enable
# #
ENABLE_SWD := 0 ENABLE_SWD := 0
ENABLE_OVERLAY := 1 ENABLE_OVERLAY := 1
ENABLE_UART := 1 ENABLE_UART := 1
ENABLE_AIRCOPY := 0 ENABLE_AIRCOPY := 0
ENABLE_FMRADIO := 0 ENABLE_FMRADIO := 1
ENABLE_NOAA := 0 ENABLE_NOAA := 0
ENABLE_VOICE := 0 ENABLE_VOICE := 0
ENABLE_ALARM := 0 ENABLE_ALARM := 0
@ -137,7 +137,10 @@ OBJCOPY = arm-none-eabi-objcopy
SIZE = arm-none-eabi-size SIZE = arm-none-eabi-size
# the user might not have/want git installed # the user might not have/want git installed
# can set own version string here (max 7 chars here)
GIT_HASH := $(shell git rev-parse --short HEAD) GIT_HASH := $(shell git rev-parse --short HEAD)
#GIT_HASH := 230925b
$(info GIT_HASH = $(GIT_HASH)) $(info GIT_HASH = $(GIT_HASH))
ASFLAGS = -c -mcpu=cortex-m0 ASFLAGS = -c -mcpu=cortex-m0

View File

@ -16,12 +16,12 @@ ENABLE_SWD := 0 only needed if using CPU's SWD port (de
ENABLE_OVERLAY := 1 cpu FLASH stuff ENABLE_OVERLAY := 1 cpu FLASH stuff
ENABLE_UART := 1 without this you can't configure radio via PC ENABLE_UART := 1 without this you can't configure radio via PC
ENABLE_AIRCOPY := 0 easier to just enter frequency ENABLE_AIRCOPY := 0 easier to just enter frequency
ENABLE_FMRADIO := 0 WBFM VHF band 2 RX ENABLE_FMRADIO := 1 WBFM VHF band 2 RX
ENABLE_NOAA := 0 Everything NOAA ENABLE_NOAA := 0 everything NOAA
ENABLE_VOICE := 0 want to hear voices ? ENABLE_VOICE := 0 want to hear voices ?
ENABLE_ALARM := 0 TX alarms ENABLE_ALARM := 0 TX alarms
ENABLE_BIG_FREQ := 0 big font frequencies ENABLE_BIG_FREQ := 0 big font frequencies
ENABLE_SMALL_BOLD := 1 bold channel name/no. (name + freq channel display mode) ENABLE_SMALL_BOLD := 1 bold channel name/no. (when name + freq channel display mode)
ENABLE_KEEP_MEM_NAME := 1 maintain channel name when (re)saving memory channel ENABLE_KEEP_MEM_NAME := 1 maintain channel name when (re)saving memory channel
ENABLE_WIDE_RX := 1 full 18MHz to 1300MHz RX (though frontend not tuned over full range) ENABLE_WIDE_RX := 1 full 18MHz to 1300MHz RX (though frontend not tuned over full range)
ENABLE_TX_WHEN_AM := 0 allow TX (always FM) when RX is set to AM ENABLE_TX_WHEN_AM := 0 allow TX (always FM) when RX is set to AM
@ -29,11 +29,12 @@ ENABLE_CTCSS_TAIL_PHASE_SHIFT := 1 standard CTCSS tail phase shift rather
ENABLE_MAIN_KEY_HOLD := 1 initial F-key press not needed, instead hold down keys 0-9 to access the functions ENABLE_MAIN_KEY_HOLD := 1 initial F-key press not needed, instead hold down keys 0-9 to access the functions
ENABLE_BOOT_BEEPS := 0 give user audio feedback on volume knob position at boot-up ENABLE_BOOT_BEEPS := 0 give user audio feedback on volume knob position at boot-up
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 := 0 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_NO_SCAN_TIMEOUT := 1 remove the 32 sec timeout from the CTCSS/DCS scan (press exit butt to end scan)
ENABLE_AM_FIX := 1 dynamically adjust the front end gains when in AM mode to helo prevent AM demodulator saturation - ignore the on-screen RSSI (for now) ENABLE_AM_FIX := 1 dynamically adjust the front end gains when in AM mode to helo prevent AM demodulator saturation - ignore the on-screen RSSI (for now)
ENABLE_AM_FIX_SHOW_DATA := 1 show debug data for the AM fix ENABLE_AM_FIX_SHOW_DATA := 1 show debug data for the AM fix
ENABLE_SQUELCH1_LOWER := 1 adjusts squelch setting '1' to be more sensitive - I plan to let user adjust it in the menu ENABLE_SQUELCH1_LOWER := 0 adjusts squelch setting '1' to be more sensitive - I plan to let user adjust it in the menu
ENABLE_AUDIO_BAR := 0 experimental, display an audo bar level when TX'ing ENABLE_AUDIO_BAR := 0 experimental, 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
@ -45,7 +46,7 @@ ENABLE_AUDIO_BAR := 0 experimental, display an audo bar level
* Added new bugs * Added new bugs
* Mic menu includes max gain possible * Mic menu includes max gain possible
* AM RX everywhere (left the TX as is) * AM RX everywhere (left the TX as is)
* An attempt to improve the AM RX audio (demodulator getting saturated/overloaded) * An attempt to improve the AM RX audio (demodulator getting saturated/overloaded in Quansheng firmware)
* keypad-5/NOAA button now toggles scanlist-1 on/off for current channel when held down - IF NOAA not used * keypad-5/NOAA button now toggles scanlist-1 on/off for current channel when held down - IF NOAA not used
* Better backlight times (inc always on) * Better backlight times (inc always on)
* Live DTMF decoder option, though the decoder needs some coeff tuning changes to decode other radios it seems * Live DTMF decoder option, though the decoder needs some coeff tuning changes to decode other radios it seems

View File

@ -352,7 +352,7 @@ const uint8_t orig_pga = 6; // -3dB
return; return;
case FUNCTION_FOREGROUND: case FUNCTION_FOREGROUND:
return; // return;
// only adjust stuff if we're in one of these modes // only adjust stuff if we're in one of these modes
case FUNCTION_RECEIVE: case FUNCTION_RECEIVE:

View File

@ -94,7 +94,7 @@ static void ACTION_Monitor(void)
#ifdef ENABLE_NOAA #ifdef ENABLE_NOAA
if (gEeprom.DUAL_WATCH == DUAL_WATCH_OFF && gIsNoaaMode) if (gEeprom.DUAL_WATCH == DUAL_WATCH_OFF && gIsNoaaMode)
{ {
gNOAA_Countdown_10ms = 500; // 5 sec gNOAA_Countdown_10ms = NOAA_countdown_10ms;
gScheduleNOAA = false; gScheduleNOAA = false;
} }
#endif #endif
@ -155,6 +155,7 @@ void ACTION_Scan(bool bRestart)
#endif #endif
} }
} }
return; return;
} }
#endif #endif

View File

@ -102,7 +102,7 @@ static void APP_CheckForIncoming(void)
#ifdef ENABLE_NOAA #ifdef ENABLE_NOAA
if (gIsNoaaMode) if (gIsNoaaMode)
{ {
gNOAA_Countdown_10ms = 20; // 200ms gNOAA_Countdown_10ms = NOAA_countdown_3_10ms;
gScheduleNOAA = false; gScheduleNOAA = false;
} }
#endif #endif
@ -965,7 +965,8 @@ void APP_Update(void)
APP_HandleFunction(); APP_HandleFunction();
#ifdef ENABLE_FMRADIO #ifdef ENABLE_FMRADIO
if (gFmRadioCountdown_500ms > 0) // if (gFmRadioCountdown_500ms > 0)
if (gFmRadioMode && gFmRadioCountdown_500ms > 0) // 1of11
return; return;
#endif #endif
@ -1058,7 +1059,7 @@ void APP_Update(void)
gCurrentFunction != FUNCTION_MONITOR && gCurrentFunction != FUNCTION_MONITOR &&
gCurrentFunction != FUNCTION_RECEIVE && gCurrentFunction != FUNCTION_RECEIVE &&
gCurrentFunction != FUNCTION_TRANSMIT) gCurrentFunction != FUNCTION_TRANSMIT)
{ { // switch to FM radio mode
FM_Play(); FM_Play();
gScheduleFM = false; gScheduleFM = false;
} }
@ -1362,9 +1363,8 @@ void APP_TimeSlice10ms(void)
else else
{ // transmitting { // transmitting
#ifdef ENABLE_AUDIO_BAR #ifdef ENABLE_AUDIO_BAR
if (gSetting_mic_bar && (gFlashLightBlinkCounter % (100 / 10)) == 0) // once every 100ms if (gSetting_mic_bar && (gFlashLightBlinkCounter % (150 / 10)) == 0) // once every 150ms
UI_DisplayAudioBar(); UI_DisplayAudioBar();
//gUpdateDisplay = true;
#endif #endif
if (gUpdateDisplay) if (gUpdateDisplay)
@ -1380,7 +1380,8 @@ void APP_TimeSlice10ms(void)
// Skipping authentic device checks // Skipping authentic device checks
#ifdef ENABLE_FMRADIO #ifdef ENABLE_FMRADIO
if (gFmRadioCountdown_500ms > 0) // if (gFmRadioCountdown_500ms > 0)
if (gFmRadioMode && gFmRadioCountdown_500ms > 0) // 1of11
return; return;
#endif #endif
@ -1454,10 +1455,10 @@ void APP_TimeSlice10ms(void)
} }
#ifdef ENABLE_FMRADIO #ifdef ENABLE_FMRADIO
if (gFmRadioMode && gFM_RestoreCountdown > 0) if (gFmRadioMode && gFM_RestoreCountdown_10ms > 0)
{
if (--gFM_RestoreCountdown == 0)
{ {
if (--gFM_RestoreCountdown_10ms == 0)
{ // switch back to FM radio mode
FM_Start(); FM_Start();
GUI_SelectNextDisplay(DISPLAY_FM); GUI_SelectNextDisplay(DISPLAY_FM);
} }
@ -1630,6 +1631,7 @@ void APP_TimeSlice500ms(void)
if (gFmRadioCountdown_500ms > 0) if (gFmRadioCountdown_500ms > 0)
{ {
gFmRadioCountdown_500ms--; gFmRadioCountdown_500ms--;
if (gFmRadioMode) // 1of11
return; return;
} }
#endif #endif
@ -1743,7 +1745,7 @@ void APP_TimeSlice500ms(void)
{ {
RADIO_SetVfoState(VFO_STATE_NORMAL); RADIO_SetVfoState(VFO_STATE_NORMAL);
if (gCurrentFunction != FUNCTION_RECEIVE && gCurrentFunction != FUNCTION_TRANSMIT && gCurrentFunction != FUNCTION_MONITOR && gFmRadioMode) if (gCurrentFunction != FUNCTION_RECEIVE && gCurrentFunction != FUNCTION_TRANSMIT && gCurrentFunction != FUNCTION_MONITOR && gFmRadioMode)
{ { // switch back to FM radio mode
FM_Start(); FM_Start();
GUI_SelectNextDisplay(DISPLAY_FM); GUI_SelectNextDisplay(DISPLAY_FM);
} }

View File

@ -46,7 +46,7 @@ uint8_t gFM_ChannelPosition;
bool gFM_FoundFrequency; bool gFM_FoundFrequency;
bool gFM_AutoScan; bool gFM_AutoScan;
uint8_t gFM_ResumeCountdown_500ms; uint8_t gFM_ResumeCountdown_500ms;
uint16_t gFM_RestoreCountdown; uint16_t gFM_RestoreCountdown_10ms;
bool FM_CheckValidChannel(uint8_t Channel) bool FM_CheckValidChannel(uint8_t Channel)
{ {
@ -95,7 +95,7 @@ void FM_TurnOff(void)
{ {
gFmRadioMode = false; gFmRadioMode = false;
gFM_ScanState = FM_SCAN_OFF; gFM_ScanState = FM_SCAN_OFF;
gFM_RestoreCountdown = 0; gFM_RestoreCountdown_10ms = 0;
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH); GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH);
@ -657,7 +657,7 @@ void FM_Start(void)
{ {
gFmRadioMode = true; gFmRadioMode = true;
gFM_ScanState = FM_SCAN_OFF; gFM_ScanState = FM_SCAN_OFF;
gFM_RestoreCountdown = 0; gFM_RestoreCountdown_10ms = 0;
BK1080_Init(gEeprom.FM_FrequencyPlaying, true); BK1080_Init(gEeprom.FM_FrequencyPlaying, true);

View File

@ -40,7 +40,7 @@ extern uint16_t gFM_FrequencyDeviation;
extern bool gFM_FoundFrequency; extern bool gFM_FoundFrequency;
extern bool gFM_AutoScan; extern bool gFM_AutoScan;
extern uint8_t gFM_ResumeCountdown_500ms; extern uint8_t gFM_ResumeCountdown_500ms;
extern uint16_t gFM_RestoreCountdown; extern uint16_t gFM_RestoreCountdown_10ms;
bool FM_CheckValidChannel(uint8_t Channel); bool FM_CheckValidChannel(uint8_t Channel);
uint8_t FM_FindNextChannel(uint8_t Channel, uint8_t Direction); uint8_t FM_FindNextChannel(uint8_t Channel, uint8_t Direction);

View File

@ -50,6 +50,12 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
case KEY_0: case KEY_0:
#ifdef ENABLE_FMRADIO #ifdef ENABLE_FMRADIO
ACTION_FM(); ACTION_FM();
#else
// TODO: do something useful with the key
#endif #endif
break; break;

Binary file not shown.

Binary file not shown.

View File

@ -116,7 +116,7 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
#if defined(ENABLE_FMRADIO) #if defined(ENABLE_FMRADIO)
if (gFmRadioMode) if (gFmRadioMode)
gFM_RestoreCountdown = 500; gFM_RestoreCountdown_10ms = fm_restore_countdown_10ms;
#endif #endif
if (gDTMF_CallState == DTMF_CALL_STATE_CALL_OUT || gDTMF_CallState == DTMF_CALL_STATE_RECEIVED) if (gDTMF_CallState == DTMF_CALL_STATE_CALL_OUT || gDTMF_CallState == DTMF_CALL_STATE_RECEIVED)
@ -201,6 +201,6 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
gSchedulePowerSave = false; gSchedulePowerSave = false;
#if defined(ENABLE_FMRADIO) #if defined(ENABLE_FMRADIO)
gFM_RestoreCountdown = 0; gFM_RestoreCountdown_10ms = 0;
#endif #endif
} }

6
misc.c
View File

@ -22,6 +22,7 @@ const uint8_t fm_resume_countdown_500ms = 2500 / 500; // 2.5 second
const uint8_t fm_radio_countdown_500ms = 2000 / 500; // 2 seconds const uint8_t fm_radio_countdown_500ms = 2000 / 500; // 2 seconds
const uint16_t fm_play_countdown_scan_10ms = 100 / 10; // 100ms const uint16_t fm_play_countdown_scan_10ms = 100 / 10; // 100ms
const uint16_t fm_play_countdown_noscan_10ms = 1200 / 10; // 1.2 seconds const uint16_t fm_play_countdown_noscan_10ms = 1200 / 10; // 1.2 seconds
const uint16_t fm_restore_countdown_10ms = 5000 / 10; // 5 seconds
const uint8_t menu_timeout_500ms = 20000 / 500; // 20 seconds const uint8_t menu_timeout_500ms = 20000 / 500; // 20 seconds
@ -38,7 +39,6 @@ const uint16_t key_debounce_10ms = 20 / 10; // 20ms
const uint8_t scan_delay_10ms = 210 / 10; // 210ms const uint8_t scan_delay_10ms = 210 / 10; // 210ms
// 10ms count down resolution
const uint16_t dual_watch_count_after_tx_10ms = 3600 / 10; // 3.6 sec after TX ends const uint16_t dual_watch_count_after_tx_10ms = 3600 / 10; // 3.6 sec after TX ends
const uint16_t dual_watch_count_after_rx_10ms = 1000 / 10; // 1 sec after RX ends ? const uint16_t dual_watch_count_after_rx_10ms = 1000 / 10; // 1 sec after RX ends ?
const uint16_t dual_watch_count_after_1_10ms = 5000 / 10; // 5 sec const uint16_t dual_watch_count_after_1_10ms = 5000 / 10; // 5 sec
@ -52,6 +52,10 @@ const uint16_t battery_save_count_10ms = 10000 / 10; // 10 seconds
const uint16_t power_save1_10ms = 100 / 10; // 100ms const uint16_t power_save1_10ms = 100 / 10; // 100ms
const uint16_t power_save2_10ms = 200 / 10; // 200ms const uint16_t power_save2_10ms = 200 / 10; // 200ms
const uint16_t NOAA_countdown_10ms = 5000 / 10; // 5 seconds
const uint16_t NOAA_countdown_2_10ms = 500 / 10; // 500ms
const uint16_t NOAA_countdown_3_10ms = 200 / 10; // 200ms
const uint16_t gMax_bat_v = 840; // 8.4V const uint16_t gMax_bat_v = 840; // 8.4V
const uint16_t gMin_bat_v = 660; // 6.6V const uint16_t gMin_bat_v = 660; // 6.6V

5
misc.h
View File

@ -87,6 +87,7 @@ extern const uint8_t fm_resume_countdown_500ms;
extern const uint8_t fm_radio_countdown_500ms; extern const uint8_t fm_radio_countdown_500ms;
extern const uint16_t fm_play_countdown_scan_10ms; extern const uint16_t fm_play_countdown_scan_10ms;
extern const uint16_t fm_play_countdown_noscan_10ms; extern const uint16_t fm_play_countdown_noscan_10ms;
extern const uint16_t fm_restore_countdown_10ms;
extern const uint8_t menu_timeout_500ms; extern const uint8_t menu_timeout_500ms;
@ -108,6 +109,10 @@ extern const uint16_t battery_save_count_10ms;
extern const uint16_t power_save1_10ms; extern const uint16_t power_save1_10ms;
extern const uint16_t power_save2_10ms; extern const uint16_t power_save2_10ms;
extern const uint16_t NOAA_countdown_10ms;
extern const uint16_t NOAA_countdown_2_10ms;
extern const uint16_t NOAA_countdown_3_10ms;
extern const uint16_t dual_watch_count_after_tx_10ms; extern const uint16_t dual_watch_count_after_tx_10ms;
extern const uint16_t dual_watch_count_after_rx_10ms; extern const uint16_t dual_watch_count_after_rx_10ms;
extern const uint16_t dual_watch_count_after_1_10ms; extern const uint16_t dual_watch_count_after_1_10ms;

10
radio.c
View File

@ -595,8 +595,8 @@ void RADIO_SetupRegisters(bool bSwitchToFunction0)
case BK4819_FILTER_BW_WIDE: case BK4819_FILTER_BW_WIDE:
case BK4819_FILTER_BW_NARROW: case BK4819_FILTER_BW_NARROW:
#ifdef ENABLE_AM_FIX #ifdef ENABLE_AM_FIX
// BK4819_SetFilterBandwidth(Bandwidth, gRxVfo->IsAM && gSetting_AM_fix); BK4819_SetFilterBandwidth(Bandwidth, gRxVfo->IsAM && gSetting_AM_fix);
BK4819_SetFilterBandwidth(Bandwidth, false); // BK4819_SetFilterBandwidth(Bandwidth, false);
#else #else
BK4819_SetFilterBandwidth(Bandwidth, false); BK4819_SetFilterBandwidth(Bandwidth, false);
#endif #endif
@ -815,7 +815,7 @@ void RADIO_SetupRegisters(bool bSwitchToFunction0)
{ {
gIsNoaaMode = true; gIsNoaaMode = true;
gNoaaChannel = gRxVfo->CHANNEL_SAVE - NOAA_CHANNEL_FIRST; gNoaaChannel = gRxVfo->CHANNEL_SAVE - NOAA_CHANNEL_FIRST;
gNOAA_Countdown_10ms = 50; // 500ms gNOAA_Countdown_10ms = NOAA_countdown_2_10ms;
gScheduleNOAA = false; gScheduleNOAA = false;
} }
else else
@ -844,8 +844,8 @@ void RADIO_SetTxParameters(void)
case BK4819_FILTER_BW_WIDE: case BK4819_FILTER_BW_WIDE:
case BK4819_FILTER_BW_NARROW: case BK4819_FILTER_BW_NARROW:
#ifdef ENABLE_AM_FIX #ifdef ENABLE_AM_FIX
// BK4819_SetFilterBandwidth(Bandwidth, gCurrentVfo->IsAM && gSetting_AM_fix); BK4819_SetFilterBandwidth(Bandwidth, gCurrentVfo->IsAM && gSetting_AM_fix);
BK4819_SetFilterBandwidth(Bandwidth, false); // BK4819_SetFilterBandwidth(Bandwidth, false);
#else #else
BK4819_SetFilterBandwidth(Bandwidth, false); BK4819_SetFilterBandwidth(Bandwidth, false);
#endif #endif

View File

@ -42,7 +42,6 @@
#ifdef ENABLE_AUDIO_BAR #ifdef ENABLE_AUDIO_BAR
void UI_DisplayAudioBar(void) void UI_DisplayAudioBar(void)
{ {
// if (gCurrentFunction == FUNCTION_TRANSMIT && gSetting_mic_bar)
if (gSetting_mic_bar) if (gSetting_mic_bar)
{ {
const unsigned int line = 3; const unsigned int line = 3;
@ -51,6 +50,8 @@
#if 1 #if 1
// TX audio level // TX audio level
if (gCurrentFunction != FUNCTION_TRANSMIT)
return;
// TODO: logify this to make the bar visible with the mostly small value // TODO: logify this to make the bar visible with the mostly small value
@ -76,6 +77,7 @@
pLine[i] = 0x3e; pLine[i] = 0x3e;
#endif #endif
if (gCurrentFunction == FUNCTION_TRANSMIT)
ST7565_BlitFullScreen(); ST7565_BlitFullScreen();
} }
} }

View File

@ -1,22 +1,27 @@
@echo off @echo off
:: Compile directly in windows without the need of a linux virtual machine: :: 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 not) need to manualy add gcc path to you OS environment PATH, ie .. :: 3. You may (or may not) need to manualy add a path to you OS environment PATH, ie ..
:: C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin :: 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 :: 4. You may (or may not) need to reboot windows after installing the above
:: ::
:: Then you can run this bat from the directory you saved this source code too. :: You can then run this bat from the directory you saved this source code too.
::
:: You will need to edit the line below that runs the make.exe file to point to it's actual location if
:: it's different from mine.
:: delete any left over files from any previous compile
:: Delete any left over files from any previous compile
::
del /S /Q *.o >nul 2>nul del /S /Q *.o >nul 2>nul
del /S /Q *.d >nul 2>nul del /S /Q *.d >nul 2>nul
del /Q firmware >nul 2>nul del /Q firmware >nul 2>nul
@ -28,16 +33,20 @@ del /Q *.bin >nul 2>nul
@set PATH="C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\arm-none-eabi\bin";%PATH% @set PATH="C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\arm-none-eabi\bin";%PATH%
@set PATH="C:\Program Files (x86)\GnuWin32\bin\";%PATH% @set PATH="C:\Program Files (x86)\GnuWin32\bin\";%PATH%
:: do the compile :: Do the compile
::
::"C:\Program Files (x86)\GnuWin32\bin\make" ::"C:\Program Files (x86)\GnuWin32\bin\make"
make make
:: delete the unused created when compiling files :: Delete the spent files
:: ::
del /S /Q *.o >nul 2>nul del /S /Q *.o >nul 2>nul
del /S /Q *.d >nul 2>nul del /S /Q *.d >nul 2>nul
del /Q firmware >nul 2>nul del /Q firmware >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 Quansheng windows upload-to-radio program requires a 'packed' .bin file. :: The Quansheng windows upload-to-radio program requires a 'packed' .bin file.
:: ::
@ -47,13 +56,22 @@ del /Q firmware >nul 2>nul
:: I wrote a GUI version of k5prog to do this easily in windows .. :: I wrote a GUI version of k5prog to do this easily in windows ..
:: https://github.com/OneOfEleven/k5prog-win :: https://github.com/OneOfEleven/k5prog-win
:: these just install the required initial python module if you want to create the packed firmware bin file, either
:: only needs running once, ever.
:: These two lines just install the required initial python module if you want to create the packed
:: firmware bin file, either only needs running once, ever.
:: ::
::python -m pip install --upgrade pip crcmod ::python -m pip install --upgrade pip crcmod
::python3 -m pip install --upgrade pip crcmod ::python3 -m pip install --upgrade pip crcmod
:: show the compiled .bin file size :: show the compiled .bin file size
::
::arm-none-eabi-size firmware ::arm-none-eabi-size firmware
pause pause
@echo on