From 923e5f16b51eda3e9b796b96db1b4519f6182fe5 Mon Sep 17 00:00:00 2001 From: Armel FAUVEAU Date: Fri, 31 Oct 2025 01:28:11 +0100 Subject: [PATCH] Bandscope fix --- App/app/spectrum.c | 11 +++++------ App/app/spectrum.h | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/App/app/spectrum.c b/App/app/spectrum.c index b01a2bba..653e9a5f 100644 --- a/App/app/spectrum.c +++ b/App/app/spectrum.c @@ -32,7 +32,7 @@ #endif #ifdef ENABLE_FEAT_F4HWN_SPECTRUM -#include "driver/eeprom.h" +#include "driver/py25q16.h" #endif struct FrequencyBandInfo @@ -121,8 +121,7 @@ uint16_t statuslineUpdateTimer = 0; static void LoadSettings() { uint8_t Data[8] = {0}; - // 1FF0..0x1FF7 - EEPROM_ReadBuffer(0x1FF0, Data, 8); + PY25Q16_ReadBuffer(0x00c000, Data, sizeof(Data)); settings.scanStepIndex = ((Data[3] & 0xF0) >> 4); @@ -150,11 +149,11 @@ static void SaveSettings() { uint8_t Data[8] = {0}; // 1FF0..0x1FF7 - EEPROM_ReadBuffer(0x1FF0, Data, 8); + PY25Q16_ReadBuffer(0x00c000, Data, sizeof(Data)); Data[3] = (settings.scanStepIndex << 4) | (settings.stepsCount << 2) | settings.listenBw; - EEPROM_WriteBuffer(0x1FF0, Data); + PY25Q16_WriteBuffer(0x00c000, Data, sizeof(Data), true); } #endif @@ -273,7 +272,7 @@ static void GUI_DisplaySmallest(const char *pString, uint8_t x, uint8_t y, KEY_Code_t GetKey() { KEY_Code_t btn = KEYBOARD_Poll(); - if (btn == KEY_INVALID && !GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT)) + if (btn == KEY_INVALID && GPIO_IsPttPressed()) { btn = KEY_PTT; } diff --git a/App/app/spectrum.h b/App/app/spectrum.h index 1f155130..b7862a9b 100644 --- a/App/app/spectrum.h +++ b/App/app/spectrum.h @@ -19,7 +19,7 @@ #include "../bitmaps.h" #include "../board.h" -#include "../bsp/dp32g030/gpio.h" +#include "py32f0xx.h" #include "../driver/bk4819-regs.h" #include "../driver/bk4819.h" #include "../driver/gpio.h"