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

lots of renames

This commit is contained in:
OneOfEleven
2023-10-08 17:14:13 +01:00
parent 83c3c8ce1c
commit 1ab74dcba1
56 changed files with 1874 additions and 1871 deletions

View File

@ -22,15 +22,15 @@
// this is decremented once every 500ms
uint16_t gBacklightCountdown = 0;
void BACKLIGHT_TurnOn(void)
void backlight_turn_on(void)
{
if (gEeprom.BACKLIGHT == 0)
if (g_eeprom.backlight == 0)
return;
// turn the backlight ON
GPIO_SetBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT);
switch (gEeprom.BACKLIGHT)
switch (g_eeprom.backlight)
{
default:
case 1: // 5 sec

View File

@ -21,7 +21,7 @@
extern uint16_t gBacklightCountdown;
void BACKLIGHT_TurnOn(void);
void backlight_turn_on(void);
#endif

View File

@ -31,7 +31,7 @@ static const uint16_t FSK_RogerTable[7] = {0xF1A2, 0x7446, 0x61A4, 0x6544, 0x4E8
static uint16_t gBK4819_GpioOutState;
bool gRxIdleMode;
bool g_rx_idle_mode;
__inline uint16_t scale_freq(const uint16_t freq)
{
@ -713,12 +713,12 @@ void BK4819_SetFrequency(uint32_t Frequency)
}
void BK4819_SetupSquelch(
uint8_t SquelchOpenRSSIThresh,
uint8_t SquelchCloseRSSIThresh,
uint8_t SquelchOpenNoiseThresh,
uint8_t SquelchCloseNoiseThresh,
uint8_t SquelchCloseGlitchThresh,
uint8_t SquelchOpenGlitchThresh)
uint8_t squelch_open_RSSI_thresh,
uint8_t squelch_close_RSSI_thresh,
uint8_t squelch_open_noise_thresh,
uint8_t squelch_close_noise_thresh,
uint8_t squelch_close_glitch_thresh,
uint8_t squelch_open_glitch_thresh)
{
// REG_70
//
@ -742,7 +742,7 @@ void BK4819_SetupSquelch(
//
// 0 ~ 255
//
BK4819_WriteRegister(BK4819_REG_4D, 0xA000 | SquelchCloseGlitchThresh);
BK4819_WriteRegister(BK4819_REG_4D, 0xA000 | squelch_close_glitch_thresh);
// REG_4E
//
@ -765,13 +765,13 @@ void BK4819_SetupSquelch(
(1u << 14) | // 1 ???
(3u << 11) | // *5 squelch = open delay .. 0 ~ 7
(2u << 9) | // *3 squelch = close delay .. 0 ~ 3
SquelchOpenGlitchThresh); // 0 ~ 255
squelch_open_glitch_thresh); // 0 ~ 255
#else
// faster (but twitchier)
(1u << 14) | // 1 ???
(2u << 11) | // *5 squelch = open delay .. 0 ~ 7
(1u << 9) | // *3 squelch = close delay .. 0 ~ 3
SquelchOpenGlitchThresh); // 0 ~ 255
squelch_open_glitch_thresh); // 0 ~ 255
#endif
// REG_4F
@ -784,7 +784,7 @@ void BK4819_SetupSquelch(
// <6:0> 46 Ex-noise threshold for Squelch = open
// 0 ~ 127
//
BK4819_WriteRegister(BK4819_REG_4F, ((uint16_t)SquelchCloseNoiseThresh << 8) | SquelchOpenNoiseThresh);
BK4819_WriteRegister(BK4819_REG_4F, ((uint16_t)squelch_close_noise_thresh << 8) | squelch_open_noise_thresh);
// REG_78
//
@ -792,7 +792,7 @@ void BK4819_SetupSquelch(
//
// <7:0> 70 RSSI threshold for Squelch = close 0.5dB/step
//
BK4819_WriteRegister(BK4819_REG_78, ((uint16_t)SquelchOpenRSSIThresh << 8) | SquelchCloseRSSIThresh);
BK4819_WriteRegister(BK4819_REG_78, ((uint16_t)squelch_open_RSSI_thresh << 8) | squelch_close_RSSI_thresh);
BK4819_SetAF(BK4819_AF_MUTE);
@ -1196,7 +1196,7 @@ void BK4819_ExitSubAu(void)
void BK4819_Conditional_RX_TurnOn_and_GPIO6_Enable(void)
{
if (gRxIdleMode)
if (g_rx_idle_mode)
{
BK4819_ToggleGpioOut(BK4819_GPIO6_PIN2, true);
BK4819_RX_TurnOn();
@ -1670,7 +1670,7 @@ uint8_t BK4819_GetDTMF_5TONE_Code(void)
return (BK4819_ReadRegister(BK4819_REG_0B) >> 8) & 0x0F;
}
uint8_t BK4819_GetCDCSSCodeType(void)
uint8_t BK4819_get_CDCSS_code_type(void)
{
return (BK4819_ReadRegister(BK4819_REG_0C) >> 14) & 3u;
}

View File

@ -62,7 +62,7 @@ enum BK4819_CssScanResult_t
typedef enum BK4819_CssScanResult_t BK4819_CssScanResult_t;
extern bool gRxIdleMode;
extern bool g_rx_idle_mode;
void BK4819_Init(void);
uint16_t BK4819_ReadRegister(BK4819_REGISTER_t Register);
@ -150,7 +150,7 @@ void BK4819_StopScan(void);
uint8_t BK4819_GetDTMF_5TONE_Code(void);
uint8_t BK4819_GetCDCSSCodeType(void);
uint8_t BK4819_get_CDCSS_code_type(void);
uint8_t BK4819_GetCTCShift(void);
uint8_t BK4819_GetCTCType(void);

View File

@ -22,10 +22,10 @@
#include "driver/i2c.h"
#include "misc.h"
KEY_Code_t gKeyReading0 = KEY_INVALID;
KEY_Code_t gKeyReading1 = KEY_INVALID;
uint16_t gDebounceCounter = 0;
bool gWasFKeyPressed = false;
key_code_t g_key_reading_0 = KEY_INVALID;
key_code_t g_key_reading_1 = KEY_INVALID;
uint16_t g_debounce_counter = 0;
bool g_was_f_key_pressed = false;
static const struct {
@ -36,7 +36,7 @@ static const struct {
// We are very fortunate.
// The key and pin defines fit together in a single u8, making this very efficient
struct {
KEY_Code_t key : 5;
key_code_t key : 5;
uint8_t pin : 3; // Pin 6 is highest
} pins[4];
@ -92,9 +92,9 @@ static const struct {
}
};
KEY_Code_t KEYBOARD_Poll(void)
key_code_t KEYBOARD_Poll(void)
{
KEY_Code_t Key = KEY_INVALID;
key_code_t Key = KEY_INVALID;
// if (!GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT))
// return KEY_PTT;

View File

@ -21,7 +21,7 @@
#include <stdbool.h>
#include <stdint.h>
enum KEY_Code_e {
enum key_code_e {
KEY_0 = 0, // 0
KEY_1, // 1
KEY_2, // 2
@ -43,14 +43,14 @@ enum KEY_Code_e {
KEY_SIDE1, //
KEY_INVALID //
};
typedef enum KEY_Code_e KEY_Code_t;
typedef enum key_code_e key_code_t;
extern KEY_Code_t gKeyReading0;
extern KEY_Code_t gKeyReading1;
extern uint16_t gDebounceCounter;
extern bool gWasFKeyPressed;
extern key_code_t g_key_reading_0;
extern key_code_t g_key_reading_1;
extern uint16_t g_debounce_counter;
extern bool g_was_f_key_pressed;
KEY_Code_t KEYBOARD_Poll(void);
key_code_t KEYBOARD_Poll(void);
#endif