Fix Bandscope + Game

This commit is contained in:
Armel FAUVEAU committed 2025-10-31 22:31:10 +01:00
1 parent 52a56f6eb2
commit c901b2edc5
6 files changed
+42 -24

No files matched your search

+4 -4
View File
@@ -23,7 +23,7 @@
static uint32_t randSeed = 1;
static uint8_t blockAnim = 0;
bool isInitialized = false;
static bool isInitialized = false;
bool isPaused = false;
bool isBeep = false;
@@ -36,7 +36,7 @@ int16_t ballCount = BALL_NUMBER;
char str[12];
KeyboardState kbd = {KEY_INVALID, KEY_INVALID, 0};
static KeyboardState kbd = {KEY_INVALID, KEY_INVALID, 0};
Brick brick[BRICK_NUMBER];
Racket racket;
@@ -403,7 +403,7 @@ static void OnKeyDown(uint8_t key)
// Key
KEY_Code_t GetKey()
static KEY_Code_t GetKey()
{
KEY_Code_t btn = KEYBOARD_Poll();
if (btn == KEY_INVALID && GPIO_IsPttPressed())
@@ -414,7 +414,7 @@ KEY_Code_t GetKey()
}
// HandleUserInput
bool HandleUserInput()
static bool HandleUserInput()
{
// Store previous key state
kbd.prev = kbd.current;
+4 -7
View File
@@ -14,6 +14,10 @@
* limitations under the License.
*/
#pragma once
#include "keyboard_state.h"
#include "../bitmaps.h"
#include "../board.h"
#include "py32f0xx.h"
@@ -66,13 +70,6 @@ typedef struct {
int8_t dy; // move y
} Ball;
typedef struct KeyboardState
{
KEY_Code_t current;
KEY_Code_t prev;
uint8_t counter;
} KeyboardState;
void initWall(void);
void drawWall(void);
void initRacket(void);
+24
View File
@@ -0,0 +1,24 @@
/* Copyright 2025 Armel F4HWN
* https://github.com/armel
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "../driver/keyboard.h"
typedef struct {
KEY_Code_t current;
KEY_Code_t prev;
uint8_t counter;
} KeyboardState;
+4 -4
View File
@@ -50,7 +50,7 @@ const uint16_t RSSI_MAX_VALUE = 65535;
static uint32_t initialFreq;
static char String[32];
bool isInitialized = false;
static bool isInitialized = false;
bool isListening = true;
bool monitorMode = false;
bool redrawStatus = true;
@@ -64,7 +64,7 @@ State currentState = SPECTRUM, previousState = SPECTRUM;
PeakInfo peak;
ScanInfo scanInfo;
KeyboardState kbd = {KEY_INVALID, KEY_INVALID, 0};
static KeyboardState kbd = {KEY_INVALID, KEY_INVALID, 0};
#ifdef ENABLE_SCAN_RANGES
static uint16_t blacklistFreqs[15];
@@ -268,7 +268,7 @@ static void GUI_DisplaySmallest(const char *pString, uint8_t x, uint8_t y,
// Utility functions
KEY_Code_t GetKey()
static KEY_Code_t GetKey()
{
KEY_Code_t btn = KEYBOARD_Poll();
if (btn == KEY_INVALID && GPIO_IsPttPressed())
@@ -1495,7 +1495,7 @@ static void Render()
ST7565_BlitFullScreen();
}
bool HandleUserInput()
static bool HandleUserInput()
{
kbd.prev = kbd.current;
kbd.current = GetKey();
+4 -7
View File
@@ -17,6 +17,10 @@
#ifndef SPECTRUM_H
#define SPECTRUM_H
#pragma once
#include "keyboard_state.h"
#include "../bitmaps.h"
#include "../board.h"
#include "py32f0xx.h"
@@ -156,13 +160,6 @@ typedef struct SpectrumSettings
bool backlightState;
} SpectrumSettings;
typedef struct KeyboardState
{
KEY_Code_t current;
KEY_Code_t prev;
uint8_t counter;
} KeyboardState;
typedef struct ScanInfo
{
uint16_t rssi, rssiMin, rssiMax;
+2 -2
View File
@@ -38,8 +38,8 @@
static const uint16_t FSK_RogerTable[7] = {0xF1A2, 0x7446, 0x61A4, 0x6544, 0x4E8A, 0xE044, 0xEA84};
static const uint8_t DTMF_TONE1_GAIN = 65;
static const uint8_t DTMF_TONE2_GAIN = 93;
//static const uint8_t DTMF_TONE1_GAIN = 65;
//static const uint8_t DTMF_TONE2_GAIN = 93;
static uint16_t gBK4819_GpioOutState;