0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-18 22:29:50 +03:00

Stop TX transmitting out of allowed frequency range when alarm is activated

This commit is contained in:
OneOfEleven
2023-10-06 19:31:29 +01:00
parent 5397b3ee88
commit b385b53af0
23 changed files with 423 additions and 388 deletions

View File

@ -36,8 +36,8 @@ static const struct {
// We are very fortunate.
// The key and pin defines fit together in a single u8, making this very efficient
struct {
uint8_t key : 5; // Key 23 is highest
uint8_t pin : 3; // Pin 6 is highest
KEY_Code_t key : 5;
uint8_t pin : 3; // Pin 6 is highest
} pins[4];
} keyboard[] = {

View File

@ -21,28 +21,29 @@
#include <stdbool.h>
#include <stdint.h>
typedef enum {
KEY_INVALID = 0,
KEY_0,
KEY_1,
KEY_2,
KEY_3,
KEY_4,
KEY_5,
KEY_6,
KEY_7,
KEY_8,
KEY_9,
KEY_MENU,
KEY_UP,
KEY_DOWN,
KEY_EXIT,
KEY_STAR,
KEY_F,
KEY_PTT,
KEY_SIDE2,
KEY_SIDE1
} KEY_Code_t;
enum KEY_Code_e {
KEY_0 = 0, // 0
KEY_1, // 1
KEY_2, // 2
KEY_3, // 3
KEY_4, // 4
KEY_5, // 5
KEY_6, // 6
KEY_7, // 7
KEY_8, // 8
KEY_9, // 9
KEY_MENU, // A
KEY_UP, // B
KEY_DOWN, // C
KEY_EXIT, // D
KEY_STAR, // *
KEY_F, // #
KEY_PTT, //
KEY_SIDE2, //
KEY_SIDE1, //
KEY_INVALID //
};
typedef enum KEY_Code_e KEY_Code_t;
extern KEY_Code_t gKeyReading0;
extern KEY_Code_t gKeyReading1;

View File

@ -146,7 +146,7 @@ void ST7565_Init(const bool full)
{
SPI0_Init();
ST7565_Configure_GPIO_B11();
ST7565_HardwareReset();
SPI_ToggleMasterMode(&SPI0->CR, false);
@ -199,7 +199,7 @@ void ST7565_Init(const bool full)
ST7565_FillScreen(0x00);
}
void ST7565_Configure_GPIO_B11(void)
void ST7565_HardwareReset(void)
{
GPIO_SetBit(&GPIOB->DATA, GPIOB_PIN_ST7565_RES);
SYSTEM_DelayMs(1);

View File

@ -31,7 +31,7 @@ void ST7565_BlitFullScreen(void);
void ST7565_BlitStatusLine(void);
void ST7565_FillScreen(uint8_t Value);
void ST7565_Init(const bool full);
void ST7565_Configure_GPIO_B11(void);
void ST7565_HardwareReset(void);
void ST7565_SelectColumnAndLine(uint8_t Column, uint8_t Line);
void ST7565_WriteByte(uint8_t Value);