Update Spectrum Analyzer RenderStill values

This commit is contained in:
Armel FAUVEAU committed 2025-04-25 04:10:23 +02:00
1 parent 5899766b75
commit 7761729a41
2 files changed
+32 -2

No files matched your search

+29 -2
View File
@@ -103,11 +103,18 @@ RegisterSpec registerSpecs[] = {
{},
{"LNAs", BK4819_REG_13, 8, 0b11, 1},
{"LNA", BK4819_REG_13, 5, 0b111, 1},
{"PGA", BK4819_REG_13, 0, 0b111, 1},
{"IF", BK4819_REG_3D, 0, 0xFFFF, 0x2aaa},
{"VGA", BK4819_REG_13, 0, 0b111, 1},
{"BPF", BK4819_REG_3D, 0, 0xFFFF, 0x2aaa},
// {"MIX", 0x13, 3, 0b11, 1}, // TODO: hidden
};
#ifdef ENABLE_FEAT_F4HWN_SPECTRUM
const int8_t LNAsOptions[] = {-19, -16, -11, 0};
const int8_t LNAOptions[] = {-24, -19, -14, -9, -6, -4, -2, 0};
const int8_t VGAOptions[] = {-33, -27, -21, -15, -9, -6, -3, 0};
const char *BPFOptions[] = {"8.46", "7.25", "6.35", "5.64", "5.08", "4.62", "4.23"};
#endif
uint16_t statuslineUpdateTimer = 0;
#ifdef ENABLE_FEAT_F4HWN_SPECTRUM
@@ -1387,7 +1394,27 @@ static void RenderStill()
sprintf(String, "%s", registerSpecs[idx].name);
GUI_DisplaySmallest(String, offset + 2, row * 8 + 2, false,
menuState != idx);
#ifdef ENABLE_FEAT_F4HWN_SPECTRUM
if(idx == 1)
{
sprintf(String, "%ddB", LNAsOptions[GetRegMenuValue(idx)]);
}
else if(idx == 2)
{
sprintf(String, "%ddB", LNAOptions[GetRegMenuValue(idx)]);
}
else if(idx == 3)
{
sprintf(String, "%ddB", VGAOptions[GetRegMenuValue(idx)]);
}
else if(idx == 4)
{
sprintf(String, "%skHz", BPFOptions[(GetRegMenuValue(idx) / 0x2aaa)]);
}
#else
sprintf(String, "%u", GetRegMenuValue(idx));
#endif
GUI_DisplaySmallest(String, offset + 2, (row + 1) * 8 + 1, false,
menuState != idx);
}