Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Fixed RSSI calibration.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dual Tachyon authored and Dual Tachyon committed Oct 14, 2023
1 parent c79781a commit 5532003
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 21 deletions.
4 changes: 2 additions & 2 deletions app/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ void MENU_AcceptSetting(void)
if (gEeprom.VOX_SWITCH) {
gEeprom.VOX_LEVEL = gSubMenuSelection - 1;
}
BOARD_EEPROM_LoadMoreSettings();
BOARD_EEPROM_LoadCalibration();
gFlagReconfigureVfos = true;
gRequestSaveSettings = true;
gUpdateStatus = true;
Expand Down Expand Up @@ -412,7 +412,7 @@ void MENU_AcceptSetting(void)

case MENU_MIC:
gEeprom.MIC_SENSITIVITY = gSubMenuSelection;
BOARD_EEPROM_LoadMoreSettings();
BOARD_EEPROM_LoadCalibration();
gRequestSaveSettings = true;
gFlagReconfigureVfos = true;
return;
Expand Down
10 changes: 5 additions & 5 deletions board.c
Original file line number Diff line number Diff line change
Expand Up @@ -706,14 +706,14 @@ void BOARD_EEPROM_Init(void)
bHasCustomAesKey = false;
}

void BOARD_EEPROM_LoadMoreSettings(void)
void BOARD_EEPROM_LoadCalibration(void)
{
uint8_t Mic;

EEPROM_ReadBuffer(0x1EC0, gEEPROM_1EC0_0, 8);
memcpy(gEEPROM_1EC0_1, gEEPROM_1EC0_0, 8);
memcpy(gEEPROM_1EC0_2, gEEPROM_1EC0_0, 8);
memcpy(gEEPROM_1EC0_3, gEEPROM_1EC0_0, 8);
EEPROM_ReadBuffer(0x1EC0, gEEPROM_RSSI_CALIB[3], 8);
memcpy(gEEPROM_RSSI_CALIB[4], gEEPROM_RSSI_CALIB[3], 8);
memcpy(gEEPROM_RSSI_CALIB[5], gEEPROM_RSSI_CALIB[3], 8);
memcpy(gEEPROM_RSSI_CALIB[6], gEEPROM_RSSI_CALIB[3], 8);

EEPROM_ReadBuffer(0x1EC8, gEEPROM_RSSI_CALIB[0], 8);
memcpy(gEEPROM_RSSI_CALIB[1], gEEPROM_RSSI_CALIB[0], 8);
Expand Down
2 changes: 1 addition & 1 deletion board.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void BOARD_ADC_Init(void);
void BOARD_ADC_GetBatteryInfo(uint16_t *pVoltage, uint16_t *pCurrent);
void BOARD_Init(void);
void BOARD_EEPROM_Init(void);
void BOARD_EEPROM_LoadMoreSettings(void);
void BOARD_EEPROM_LoadCalibration(void);
void BOARD_FactoryReset(bool bIsAll);

#endif
Expand Down
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void Main(void)
BK4819_Init();
BOARD_ADC_GetBatteryInfo(&gBatteryCurrentVoltage, &gBatteryCurrent);
BOARD_EEPROM_Init();
BOARD_EEPROM_LoadMoreSettings();
BOARD_EEPROM_LoadCalibration();

RADIO_ConfigureChannel(0, 2);
RADIO_ConfigureChannel(1, 2);
Expand Down
7 changes: 1 addition & 6 deletions misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,7 @@ bool bHasCustomAesKey;
uint32_t gChallenge[4];
uint8_t gTryCount;

uint8_t gEEPROM_1EC0_0[8];
uint8_t gEEPROM_1EC0_1[8];
uint8_t gEEPROM_1EC0_2[8];
uint8_t gEEPROM_1EC0_3[8];

uint16_t gEEPROM_RSSI_CALIB[3][4];
uint16_t gEEPROM_RSSI_CALIB[7][4];

uint16_t gEEPROM_1F8A;
uint16_t gEEPROM_1F8C;
Expand Down
7 changes: 1 addition & 6 deletions misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,7 @@ extern bool bHasCustomAesKey;
extern uint32_t gChallenge[4];
extern uint8_t gTryCount;

extern uint8_t gEEPROM_1EC0_0[8];
extern uint8_t gEEPROM_1EC0_1[8];
extern uint8_t gEEPROM_1EC0_2[8];
extern uint8_t gEEPROM_1EC0_3[8];

extern uint16_t gEEPROM_RSSI_CALIB[3][4];
extern uint16_t gEEPROM_RSSI_CALIB[7][4];

extern uint16_t gEEPROM_1F8A;
extern uint16_t gEEPROM_1F8C;
Expand Down

0 comments on commit 5532003

Please sign in to comment.