From 47de0d6951b4c92f4c74ca48c0c886c4e6a5c7c1 Mon Sep 17 00:00:00 2001 From: Armel FAUVEAU Date: Sun, 10 Nov 2024 20:11:01 +0100 Subject: [PATCH] F_Lock shift --- app/spectrum.c | 36 +++++++++++++++++++++++++----------- compile-with-docker.sh | 1 - main.c | 6 +++--- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/app/spectrum.c b/app/spectrum.c index 4cf9f3c..d09491d 100644 --- a/app/spectrum.c +++ b/app/spectrum.c @@ -867,23 +867,37 @@ uint8_t Rssi2Y(uint16_t rssi) return DrawingEndY - Rssi2PX(rssi, 0, DrawingEndY); } -static void DrawSpectrum() -{ - uint8_t ox = 0; - for (uint8_t i = 0; i < 128; ++i) +#ifdef ENABLE_FEAT_F4HWN_SPECTRUM + static void DrawSpectrum() { - uint16_t rssi = rssiHistory[i >> settings.stepsCount]; - if (rssi != RSSI_MAX_VALUE) + uint8_t ox = 0; + for (uint8_t i = 0; i < 128; ++i) { - uint8_t x = i * 128 / GetStepsCount(); - for (uint8_t xx = ox; xx < x; xx++) + uint16_t rssi = rssiHistory[i >> settings.stepsCount]; + if (rssi != RSSI_MAX_VALUE) { - DrawVLine(Rssi2Y(rssi), DrawingEndY, xx, true); + uint8_t x = i * 128 / GetStepsCount(); + for (uint8_t xx = ox; xx < x; xx++) + { + DrawVLine(Rssi2Y(rssi), DrawingEndY, xx, true); + } + ox = x; } - ox = x; } } -} +#else + static void DrawSpectrum() + { + for (uint8_t x = 0; x < 128; ++x) + { + uint16_t rssi = rssiHistory[x >> settings.stepsCount]; + if (rssi != RSSI_MAX_VALUE) + { + DrawVLine(Rssi2Y(rssi), DrawingEndY, x, true); + } + } + } +#endif static void DrawStatus() { diff --git a/compile-with-docker.sh b/compile-with-docker.sh index 4c7160a..0dcba60 100755 --- a/compile-with-docker.sh +++ b/compile-with-docker.sh @@ -39,7 +39,6 @@ voxless() { ENABLE_FEAT_F4HWN_RESTORE_SCAN=0 \ ENABLE_FEAT_F4HWN_CHARGING_C=0 \ ENABLE_FEAT_F4HWN_NARROWER=0 \ - ENABLE_FEAT_F4HWN_CONTRAST=0 \ TARGET=f4hwn.voxless \ && cp f4hwn.voxless* compiled-firmware/" } diff --git a/main.c b/main.c index 95d5e49..db7ee7c 100644 --- a/main.c +++ b/main.c @@ -139,12 +139,12 @@ void Main(void) gEeprom.KEY_LOCK = 0; SETTINGS_SaveSettings(); #ifndef ENABLE_VOX - gMenuCursor = 64; // move to hidden section, fix me if change... !!! Remove VOX and Mic Bar + gMenuCursor = 65; // move to hidden section, fix me if change... !!! Remove VOX and Mic Bar #else #ifdef ENABLE_FEAT_F4HWN_SLEEP - gMenuCursor = 67; // move to hidden section, fix me if change... !!! + gMenuCursor = 68; // move to hidden section, fix me if change... !!! #else - gMenuCursor = 66; // move to hidden section, fix me if change... !!! + gMenuCursor = 67; // move to hidden section, fix me if change... !!! #endif #endif gSubMenuSelection = gSetting_F_LOCK;