Add debug helper in status

This commit is contained in:
Armel FAUVEAU
2024-03-25 01:28:49 +01:00
parent d95491b73d
commit 8ec757dbfe
4 changed files with 59 additions and 26 deletions

1
misc.c
View File

@@ -115,6 +115,7 @@ enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx;
bool gSetting_set_met = 0; bool gSetting_set_met = 0;
bool gSetting_set_gui = 0; bool gSetting_set_gui = 0;
bool gSetting_set_ptt_session; bool gSetting_set_ptt_session;
uint8_t gDebug;
#endif #endif
#ifdef ENABLE_AUDIO_BAR #ifdef ENABLE_AUDIO_BAR

2
misc.h
View File

@@ -349,6 +349,8 @@ extern volatile uint8_t boot_counter_10ms;
extern uint8_t gBacklightBrightnessOld; extern uint8_t gBacklightBrightnessOld;
extern uint8_t gPttOnePushCounter; extern uint8_t gPttOnePushCounter;
extern uint32_t gBlinkCounter; extern uint32_t gBlinkCounter;
extern uint8_t gDebug;
#endif #endif
int32_t NUMBER_AddWithWraparound(int32_t Base, int32_t Add, int32_t LowerLimit, int32_t UpperLimit); int32_t NUMBER_AddWithWraparound(int32_t Base, int32_t Add, int32_t LowerLimit, int32_t UpperLimit);

24
radio.c
View File

@@ -474,24 +474,38 @@ void RADIO_ConfigureSquelchAndOutputPower(VFO_Info_t *pInfo)
#ifdef ENABLE_FEAT_F4HWN #ifdef ENABLE_FEAT_F4HWN
// make low and mid even lower // make low and mid even lower
uint8_t shift[] = {0, 0, 0, 0, 0};
/*
if(Band == 5)
{
shift[0] = 3;
shift[1] = 3;
shift[2] = 4;
shift[3] = 7;
shift[4] = 8;
}
*/
if (pInfo->OUTPUT_POWER == OUTPUT_POWER_LOW) { if (pInfo->OUTPUT_POWER == OUTPUT_POWER_LOW) {
for(uint8_t p = 0; p < 3; p++ ) for(uint8_t p = 0; p < 3; p++ )
{ {
switch (gSetting_set_low) { switch (gSetting_set_low) {
case 0: case 0:
Txp[p] = (Txp[p] * 4) / 25; Txp[p] = (Txp[p] * 4) / 25 - shift[gSetting_set_low];
break; break;
case 1: case 1:
Txp[p] = (Txp[p] * 4) / 19; Txp[p] = (Txp[p] * 4) / 19 + shift[gSetting_set_low];
break; break;
case 2: case 2:
Txp[p] = (Txp[p] * 4) / 13; Txp[p] = (Txp[p] * 4) / 13 + shift[gSetting_set_low];
break; break;
case 3: case 3:
Txp[p] = (Txp[p] * 4) / 10; Txp[p] = (Txp[p] * 4) / 10 + shift[gSetting_set_low];
break; break;
case 4: case 4:
Txp[p] = (Txp[p] * 4) / 7; Txp[p] = (Txp[p] * 4) / 7 + shift[gSetting_set_low];
break; break;
} }

View File

@@ -101,32 +101,48 @@ void UI_DisplayStatus()
} }
x += 10; // font character width x += 10; // font character width
#ifdef ENABLE_VOICE // Only for debug
// VOICE indicator // Only for debug
if (gEeprom.VOICE_PROMPT != VOICE_PROMPT_OFF){ // Only for debug
memcpy(line + x, BITMAP_VoicePrompt, sizeof(BITMAP_VoicePrompt));
x1 = x + sizeof(BITMAP_VoicePrompt); bool debug = false;
if(debug)
{
char sDebug[8] = "";
sprintf(sDebug, "%d", gDebug);
UI_PrintStringSmallBufferNormal(sDebug, line + x + 1);
x += 16;
} }
x += sizeof(BITMAP_VoicePrompt); else
#endif {
if(!SCANNER_IsScanning()) { #ifdef ENABLE_VOICE
uint8_t dw = (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) * 2; // VOICE indicator
if(dw == 1 || dw == 3) { // DWR - dual watch + respond if (gEeprom.VOICE_PROMPT != VOICE_PROMPT_OFF){
if(gDualWatchActive) memcpy(line + x, BITMAP_VoicePrompt, sizeof(BITMAP_VoicePrompt));
memcpy(line + x + (dw==1?0:2), gFontDWR, sizeof(gFontDWR) - (dw==1?0:5)); x1 = x + sizeof(BITMAP_VoicePrompt);
}
x += sizeof(BITMAP_VoicePrompt);
#endif
if(!SCANNER_IsScanning()) {
uint8_t dw = (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) * 2;
if(dw == 1 || dw == 3) { // DWR - dual watch + respond
if(gDualWatchActive)
memcpy(line + x + (dw==1?0:2), gFontDWR, sizeof(gFontDWR) - (dw==1?0:5));
else
memcpy(line + x + 3, gFontHold, sizeof(gFontHold));
}
else if(dw == 2) { // XB - crossband
memcpy(line + x + 2, gFontXB, sizeof(gFontXB));
}
else else
memcpy(line + x + 3, gFontHold, sizeof(gFontHold)); {
} memcpy(line + x + 2, gFontMO, sizeof(gFontMO));
else if(dw == 2) { // XB - crossband }
memcpy(line + x + 2, gFontXB, sizeof(gFontXB));
}
else
{
memcpy(line + x + 2, gFontMO, sizeof(gFontMO));
} }
x += sizeof(gFontDWR) + 3;
} }
x += sizeof(gFontDWR) + 3;
#ifdef ENABLE_VOX #ifdef ENABLE_VOX
// VOX indicator // VOX indicator