FIX #65: code refactoring

This commit is contained in:
Krzysiek Egzmont 2023-10-30 13:26:16 +01:00
parent f7c25b482d
commit a41628410e
3 changed files with 20 additions and 19 deletions

View File

@ -211,6 +211,7 @@ endif
# catch any and all warnings # catch any and all warnings
CFLAGS += -Wextra CFLAGS += -Wextra
#CFLAGS += -Wpedantic
CFLAGS += -DPRINTF_INCLUDE_CONFIG_H CFLAGS += -DPRINTF_INCLUDE_CONFIG_H
CFLAGS += -DGIT_HASH=\"$(GIT_HASH)\" CFLAGS += -DGIT_HASH=\"$(GIT_HASH)\"

View File

@ -206,23 +206,23 @@ static void ToggleAFBit(bool on) {
} }
static void BackupRegisters() { static void BackupRegisters() {
R30 = BK4819_ReadRegister(0x30); R30 = BK4819_ReadRegister(BK4819_REG_30);
R37 = BK4819_ReadRegister(0x37); R37 = BK4819_ReadRegister(BK4819_REG_37);
R3D = BK4819_ReadRegister(0x3D); R3D = BK4819_ReadRegister(0x3D);
R43 = BK4819_ReadRegister(0x43); R43 = BK4819_ReadRegister(BK4819_REG_43);
R47 = BK4819_ReadRegister(0x47); R47 = BK4819_ReadRegister(BK4819_REG_47);
R48 = BK4819_ReadRegister(0x48); R48 = BK4819_ReadRegister(BK4819_REG_48);
R7E = BK4819_ReadRegister(0x7E); R7E = BK4819_ReadRegister(BK4819_REG_7E);
} }
static void RestoreRegisters() { static void RestoreRegisters() {
BK4819_WriteRegister(0x30, R30); BK4819_WriteRegister(BK4819_REG_30, R30);
BK4819_WriteRegister(0x37, R37); BK4819_WriteRegister(BK4819_REG_37, R37);
BK4819_WriteRegister(0x3D, R3D); BK4819_WriteRegister(0x3D, R3D);
BK4819_WriteRegister(0x43, R43); BK4819_WriteRegister(BK4819_REG_43, R43);
BK4819_WriteRegister(0x47, R47); BK4819_WriteRegister(BK4819_REG_47, R47);
BK4819_WriteRegister(0x48, R48); BK4819_WriteRegister(BK4819_REG_48, R48);
BK4819_WriteRegister(0x7E, R7E); BK4819_WriteRegister(BK4819_REG_7E, R7E);
} }
static void SetModulation(ModulationType type) { static void SetModulation(ModulationType type) {
@ -233,7 +233,7 @@ static void SetModulation(ModulationType type) {
if (type == MOD_USB) { if (type == MOD_USB) {
BK4819_WriteRegister(0x3D, 0b0010101101000101); BK4819_WriteRegister(0x3D, 0b0010101101000101);
BK4819_WriteRegister(BK4819_REG_37, 0x160F); BK4819_WriteRegister(BK4819_REG_37, 0x160F);
BK4819_WriteRegister(0x48, 0b0000001110101000); BK4819_WriteRegister(BK4819_REG_48, 0b0000001110101000);
} }
} }