Debug refactoring

This commit is contained in:
Armel FAUVEAU
2025-02-13 01:03:57 +01:00
parent 4596b966a3
commit ebf5a1bbec
5 changed files with 22 additions and 17 deletions

View File

@@ -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

View File

@@ -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 \

4
misc.c
View File

@@ -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;

4
misc.h
View File

@@ -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;

View File

@@ -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
#ifdef ENABLE_FEAT_F4HWN_DEBUG
// Only for debug
// Only for debug
// Only for debug
bool debug = false;
if(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