diff --git a/Makefile b/Makefile index 2e84de4..1ba972b 100644 --- a/Makefile +++ b/Makefile @@ -55,6 +55,7 @@ ENABLE_FEAT_F4HWN_RESET_CHANNEL ?= 0 ENABLE_FEAT_F4HWN_PMR ?= 0 ENABLE_FEAT_F4HWN_GMRS_FRS_MURS ?= 0 ENABLE_FEAT_F4HWN_CA ?= 1 +ENABLE_FEAT_F4HWN_DEBUG ?= 0 ENABLE_REGA ?= 0 # ---- DEBUGGING ---- @@ -470,6 +471,9 @@ endif ifeq ($(ENABLE_FEAT_F4HWN_CA),1) CFLAGS += -DENABLE_FEAT_F4HWN_CA endif +ifeq ($(ENABLE_FEAT_F4HWN_DEBUG),1) + CFLAGS += -DENABLE_FEAT_F4HWN_DEBUG +endif LDFLAGS = LDFLAGS += -z noexecstack -mcpu=cortex-m0 -nostartfiles -Wl,-T,firmware.ld -Wl,--gc-sections diff --git a/compile-with-docker.sh b/compile-with-docker.sh index e47359d..865a8f7 100755 --- a/compile-with-docker.sh +++ b/compile-with-docker.sh @@ -35,7 +35,7 @@ bandscope() { docker run --rm -v "${PWD}/compiled-firmware/:/app/compiled-firmware" $IMAGE_NAME /bin/bash -c "rm ./compiled-firmware/*; cd /app && make -s \ ENABLE_SPECTRUM=1 \ ENABLE_FMRADIO=0 \ - ENABLE_AIRCOPY=1 \ + ENABLE_AIRCOPY=0 \ ENABLE_FEAT_F4HWN_PMR=0 \ ENABLE_FEAT_F4HWN_GMRS_FRS_MURS=0 \ ENABLE_NOAA=0 \ diff --git a/misc.c b/misc.c index 5cd0809..46cd47d 100644 --- a/misc.c +++ b/misc.c @@ -130,7 +130,9 @@ enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx; #endif bool gSetting_set_tmr = 0; bool gSetting_set_ptt_session; - uint8_t gDebug; + #ifdef ENABLE_FEAT_F4HWN_DEBUG + uint8_t gDebug; + #endif uint8_t gDW = 0; uint8_t gCB = 0; bool gSaveRxMode = false; diff --git a/misc.h b/misc.h index 5654740..6b65c0d 100644 --- a/misc.h +++ b/misc.h @@ -183,7 +183,9 @@ extern enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx; #endif extern bool gSetting_set_tmr; extern bool gSetting_set_ptt_session; - extern uint8_t gDebug; + #ifdef ENABLE_FEAT_F4HWN_DEBUG + extern uint8_t gDebug; + #endif extern uint8_t gDW; extern uint8_t gCB; extern bool gSaveRxMode; diff --git a/ui/status.c b/ui/status.c index f2ce468..bd723c6 100644 --- a/ui/status.c +++ b/ui/status.c @@ -35,6 +35,7 @@ #include "ui/status.h" #ifdef ENABLE_FEAT_F4HWN_RX_TX_TIMER +#ifndef ENABLE_FEAT_F4HWN_DEBUG static void convertTime(uint8_t *line, uint8_t type) { uint16_t t = (type == 0) ? (gTxTimerCountdown_500ms / 2) : (3600 - gRxTimerCountdown_500ms / 2); @@ -51,6 +52,7 @@ static void convertTime(uint8_t *line, uint8_t type) gUpdateStatus = true; } #endif +#endif void UI_DisplayStatus() { @@ -122,28 +124,23 @@ void UI_DisplayStatus() } x += 10; // font character width - // Only for debug - // Only for debug - // Only for debug - - bool debug = false; - if(debug) - { + #ifdef ENABLE_FEAT_F4HWN_DEBUG + // Only for debug + // Only for debug + // Only for debug + sprintf(str, "%d", gDebug); UI_PrintStringSmallBufferNormal(str, line + x + 1); x += 16; - } - else - { - - #ifdef ENABLE_VOICE + #else + #ifdef ENABLE_VOICE // VOICE indicator if (gEeprom.VOICE_PROMPT != VOICE_PROMPT_OFF){ memcpy(line + x, BITMAP_VoicePrompt, sizeof(BITMAP_VoicePrompt)); x1 = x + sizeof(BITMAP_VoicePrompt); } x += sizeof(BITMAP_VoicePrompt); - #endif + #endif if(!SCANNER_IsScanning()) { #ifdef ENABLE_FEAT_F4HWN_RX_TX_TIMER @@ -185,7 +182,7 @@ void UI_DisplayStatus() } } x += sizeof(gFontDWR) + 3; - } + #endif #ifdef ENABLE_VOX // VOX indicator