Fix the spectrum labels, bandscope build, OOK on F+7, save flash
- Spectrum: GUI_DisplaySmallest() now draws with gFontSmall (7 px per character) for the status bar; the spectrum layout needs the 3x5 font (4 px), so it gets its own renderer again. Its labels were overlapping. - make BANDSCOPE=1: spectrum instead of the FM radio. Both do not fit in 60 KB together (FM radio is 4.9 KB). Debug log off and -finline-limit=1 in that edition; it fits with a few bytes to spare. - OOK sender on F+7 / long 7 (the VOX key is free, VOX is not built); F+EXIT is back to only cancelling F. - POCSAG deviation tuning keys behind POCSAG_DEVIATION_TUNING (default 0). - Smaller code: shared end of SMS/POCSAG transmissions, non-inlined fast SPI wait, compact OOK field tables, sprintf message header, shorter OOK strings. - Makefile: EXTRA_CFLAGS for passing defines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
No files matched your search
+19
-18
@@ -217,8 +217,10 @@ static void DrawVLine(int sy, int ey, int nx, bool fill) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef ENABLE_FEAT_F4HWN
|
||||
static void GUI_DisplaySmallest(const char *pString, uint8_t x, uint8_t y,
|
||||
// The spectrum layout is made for the 3x5 font (4 px per character). The shared
|
||||
// GUI_DisplaySmallest() in ui/helper.c draws with gFontSmall (7 px) for the
|
||||
// status bar, which makes the spectrum labels overlap, so it keeps its own.
|
||||
static void SPECTRUM_DisplaySmallest(const char *pString, uint8_t x, uint8_t y,
|
||||
bool statusbar, bool fill)
|
||||
{
|
||||
uint8_t c;
|
||||
@@ -246,7 +248,6 @@ static void GUI_DisplaySmallest(const char *pString, uint8_t x, uint8_t y,
|
||||
x += 4;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Utility functions
|
||||
|
||||
@@ -794,7 +795,7 @@ static void DrawStatus() {
|
||||
#else
|
||||
sprintf(String, "%d/%d", settings.dbMin, settings.dbMax);
|
||||
#endif
|
||||
GUI_DisplaySmallest(String, 50, 20, true, true);
|
||||
SPECTRUM_DisplaySmallest(String, 50, 20, true, true);
|
||||
|
||||
BOARD_ADC_GetBatteryInfo(&gBatteryVoltages[gBatteryCheckCounter++ % 4],
|
||||
&gBatteryCurrent);
|
||||
@@ -806,7 +807,7 @@ static void DrawStatus() {
|
||||
unsigned perc = BATTERY_VoltsToPercent(voltage);
|
||||
|
||||
// sprintf(String, "%d %d", voltage, perc);
|
||||
// GUI_DisplaySmallest(String, 48, 1, true, true);
|
||||
// SPECTRUM_DisplaySmallest(String, 48, 1, true, true);
|
||||
|
||||
gStatusLine[116] = 0b00011100;
|
||||
gStatusLine[117] = 0b00111110;
|
||||
@@ -835,7 +836,7 @@ static void ShowChannelName(uint32_t f) {
|
||||
SETTINGS_FetchChannelName(String, i);
|
||||
if (String[0] != 0) {
|
||||
UI_PrintStringSmallBufferNormal(String, gStatusLine + 36);
|
||||
//GUI_DisplaySmallest(String, 127, 1, true, true);
|
||||
//SPECTRUM_DisplaySmallest(String, 127, 1, true, true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -860,9 +861,9 @@ static void DrawF(uint32_t f) {
|
||||
UI_PrintStringSmallNormal(String, 8, 127, 0);
|
||||
|
||||
sprintf(String, "%3s", gModulationStr[settings.modulationType]);
|
||||
GUI_DisplaySmallest(String, 95, 1, false, true);
|
||||
SPECTRUM_DisplaySmallest(String, 95, 1, false, true);
|
||||
sprintf(String, "%4sk", bwOptions[settings.listenBw]);
|
||||
GUI_DisplaySmallest(String, 90, 10, false, true);
|
||||
SPECTRUM_DisplaySmallest(String, 90, 10, false, true);
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_SPECTRUM
|
||||
ShowChannelName(f);
|
||||
@@ -873,26 +874,26 @@ static void DrawNums() {
|
||||
|
||||
if (currentState == SPECTRUM) {
|
||||
sprintf(String, "%ux", GetStepsCount());
|
||||
GUI_DisplaySmallest(String, 0, 1, false, true);
|
||||
SPECTRUM_DisplaySmallest(String, 0, 1, false, true);
|
||||
sprintf(String, "%u.%02uk", GetScanStep() / 100, GetScanStep() % 100);
|
||||
GUI_DisplaySmallest(String, 0, 7, false, true);
|
||||
SPECTRUM_DisplaySmallest(String, 0, 7, false, true);
|
||||
}
|
||||
|
||||
if (IsCenterMode()) {
|
||||
sprintf(String, "%lu.%05lu \x7F%lu.%02luk", currentFreq / 100000,
|
||||
currentFreq % 100000, settings.frequencyChangeStep / 100,
|
||||
settings.frequencyChangeStep % 100);
|
||||
GUI_DisplaySmallest(String, 36, 39, false, true);
|
||||
SPECTRUM_DisplaySmallest(String, 36, 39, false, true);
|
||||
} else {
|
||||
sprintf(String, "%lu.%05lu", GetFStart() / 100000, GetFStart() % 100000);
|
||||
GUI_DisplaySmallest(String, 0, 49, false, true);
|
||||
SPECTRUM_DisplaySmallest(String, 0, 49, false, true);
|
||||
|
||||
sprintf(String, "\x7F%lu.%02luk", settings.frequencyChangeStep / 100,
|
||||
settings.frequencyChangeStep % 100);
|
||||
GUI_DisplaySmallest(String, 48, 10, false, true);
|
||||
SPECTRUM_DisplaySmallest(String, 48, 10, false, true);
|
||||
|
||||
sprintf(String, "%lu.%05lu", GetFEnd() / 100000, GetFEnd() % 100000);
|
||||
GUI_DisplaySmallest(String, 93, 49, false, true);
|
||||
SPECTRUM_DisplaySmallest(String, 93, 49, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1184,9 +1185,9 @@ static void RenderStill() {
|
||||
int dbm = Rssi2DBm(scanInfo.rssi);
|
||||
uint8_t s = DBm2S(dbm);
|
||||
sprintf(String, "S: %u", s);
|
||||
GUI_DisplaySmallest(String, 4, 25, false, true);
|
||||
SPECTRUM_DisplaySmallest(String, 4, 25, false, true);
|
||||
sprintf(String, "%d dBm", dbm);
|
||||
GUI_DisplaySmallest(String, 28, 25, false, true);
|
||||
SPECTRUM_DisplaySmallest(String, 28, 25, false, true);
|
||||
|
||||
if (!monitorMode) {
|
||||
uint8_t x = Rssi2PX(settings.rssiTriggerLevel, 0, 121);
|
||||
@@ -1211,10 +1212,10 @@ static void RenderStill() {
|
||||
}
|
||||
}
|
||||
sprintf(String, "%s", registerSpecs[idx].name);
|
||||
GUI_DisplaySmallest(String, offset + 2, row * 8 + 2, false,
|
||||
SPECTRUM_DisplaySmallest(String, offset + 2, row * 8 + 2, false,
|
||||
menuState != idx);
|
||||
sprintf(String, "%u", GetRegMenuValue(idx));
|
||||
GUI_DisplaySmallest(String, offset + 2, (row + 1) * 8 + 1, false,
|
||||
SPECTRUM_DisplaySmallest(String, offset + 2, (row + 1) * 8 + 1, false,
|
||||
menuState != idx);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user