Skip to content

Commit

Permalink
change mesenger key to no location 0x1D20
Browse files Browse the repository at this point in the history
  • Loading branch information
spm81 committed Mar 13, 2024
1 parent 936f516 commit 9b2b5fb
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 18 deletions.
3 changes: 3 additions & 0 deletions app/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,10 @@ void APP_CheckKeys(void) {

void APP_TimeSlice10ms(void) {
#if defined(ENABLE_MISSED_CALL_NOTIFICATION_AND_BLINKING_LED)
if(gSetting_Missed_Call_NBL)
{
gFlashLightNotifCounter++;
}
#endif
gFlashLightBlinkCounter++;

Expand Down
14 changes: 14 additions & 0 deletions app/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ int MENU_GetLimits(uint8_t Cursor, uint8_t *pMin, uint8_t *pMax) {
break;
#ifdef ENABLE_DOCK
case MENU_REMOTE_UI:
#endif
#if defined(ENABLE_MISSED_CALL_NOTIFICATION_AND_BLINKING_LED)
case MENU_MISSED_CALL_NBLL:
#endif
case MENU_BCL:
case MENU_BEEP:
Expand Down Expand Up @@ -397,6 +400,11 @@ void MENU_AcceptSetting(void) {
break;
#endif

#if defined(ENABLE_MISSED_CALL_NOTIFICATION_AND_BLINKING_LED)
case MENU_MISSED_CALL_NBLL:
gSetting_Missed_Call_NBL = gSubMenuSelection;
break;
#endif
case MENU_BEEP:
gEeprom.BEEP_CONTROL = gSubMenuSelection;
break;
Expand Down Expand Up @@ -790,6 +798,12 @@ void MENU_ShowCurrentSetting(void) {
break;
#endif

#if defined(ENABLE_MISSED_CALL_NOTIFICATION_AND_BLINKING_LED)
case MENU_MISSED_CALL_NBLL:
gSubMenuSelection = gSetting_Missed_Call_NBL;
break;
#endif

case MENU_BEEP:
gSubMenuSelection = gEeprom.BEEP_CONTROL;
break;
Expand Down
2 changes: 1 addition & 1 deletion app/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ static void CMD_0602(const uint8_t *pBuffer)

void UART_SendUiElement(uint8_t type, uint32_t value1, uint32_t value2, uint32_t value3, uint32_t Length, const void* data)
{
if(gSetting_Remote_UI)
if(gSetting_Remote_UI)
{
const uint8_t id = 0xB5;
UART_Send(&id, 1);
Expand Down
22 changes: 14 additions & 8 deletions board.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,23 +796,29 @@ for (int i = 0; i < 2; i++) {
EEPROM_ReadBuffer(0x0D60, gMR_ChannelAttributes, sizeof(gMR_ChannelAttributes));

// 0F30..0F3F
//EEPROM_ReadBuffer(0x0F30, gCustomAesKey, sizeof(gCustomAesKey));
EEPROM_ReadBuffer(0x0F30, gCustomAesKey, sizeof(gCustomAesKey));

for (int i = 0; i < 4; i++) {
if (gCustomAesKey[i] != 0xFFFFFFFFU) {
bHasCustomAesKey = true;
return;
}
}
/*
#ifdef ENABLE_MESSENGER_ENCRYPTION
// 0F30..0F3F - load encryption key
//EEPROM_ReadBuffer(0x0F30, gEeprom.ENC_KEY, sizeof(gEeprom.ENC_KEY));
EEPROM_ReadBuffer(0x1BBA, gEeprom.ENC_KEY, 5);
EEPROM_ReadBuffer(0x1BCA, gEeprom.ENC_KEY + 5, 5);
#endif
*/
#ifdef ENABLE_MESSENGER_ENCRYPTION
// 1D20..1D2F - load encryption key
EEPROM_ReadBuffer(0x1D20, gEeprom.ENC_KEY, sizeof(gEeprom.ENC_KEY));
#endif

/*for (i = 0; i < 4; i++) {
if (gCustomAesKey[i] != 0xFFFFFFFFU) {
bHasCustomAesKey = true;
return;
}
}*/
#ifdef ENABLE_LIVESEEK_MHZ_KEYPAD
#ifdef ENABLE_LIVESEEK_MHZ_KEYPAD

//KD8CEC WORK ===================================
EEPROM_ReadBuffer(CEC_EEPROM_START1 + 0, Data, 8);
Expand Down
3 changes: 3 additions & 0 deletions functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,12 @@ void FUNCTION_Select(FUNCTION_Type_t Function) {
BK4819_Conditional_RX_TurnOn_and_GPIO6_Enable();
gRxIdleMode = false;
#if defined(ENABLE_MISSED_CALL_NOTIFICATION_AND_BLINKING_LED)
if(gSetting_Missed_Call_NBL)
{
if (Function == FUNCTION_INCOMING) {
gMissedCalls++;
}
}
#endif
UI_DisplayStatus();
}
Expand Down
3 changes: 3 additions & 0 deletions helper/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ void BOOT_ProcessMode(BOOT_Mode_t Mode)
#ifdef ENABLE_DOCK
gMenuListCount++;
#endif
#if defined(ENABLE_MISSED_CALL_NOTIFICATION_AND_BLINKING_LED)
gMenuListCount++;
#endif
#ifdef ENABLE_MESSENGER
gMenuListCount += 2;
#ifdef ENABLE_MESSENGER_ROGERBEEP_NOTIFICATION
Expand Down
3 changes: 3 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ void Main(void) {
#ifdef ENABLE_DOCK
gMenuListCount++;
#endif
#if defined(ENABLE_MISSED_CALL_NOTIFICATION_AND_BLINKING_LED)
gMenuListCount++;
#endif
#ifdef ENABLE_MESSENGER
gMenuListCount += 2;
#ifdef ENABLE_MESSENGER_ROGERBEEP_NOTIFICATION
Expand Down
1 change: 1 addition & 0 deletions misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ volatile bool gScheduleFM;
#if defined(ENABLE_MISSED_CALL_NOTIFICATION_AND_BLINKING_LED)
uint8_t gMissedCalls;
volatile uint8_t gFlashLightNotifCounter;
bool gSetting_Missed_Call_NBL = true;
#endif

uint16_t gCurrentRSSI;
Expand Down
1 change: 1 addition & 0 deletions misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ extern volatile bool gScheduleFM;
#if defined(ENABLE_MISSED_CALL_NOTIFICATION_AND_BLINKING_LED)
extern uint8_t gMissedCalls;
extern volatile uint8_t gFlashLightNotifCounter;
extern bool gSetting_Missed_Call_NBL;
#endif
#ifdef ENABLE_DOCK
extern bool gSetting_Remote_UI;
Expand Down
15 changes: 8 additions & 7 deletions settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,14 @@ void SETTINGS_SaveVfoIndices(void)
void SETTINGS_SaveEncryptionKey()
{

// EEPROM_WriteBuffer(0x0F30, gEeprom.ENC_KEY);
// EEPROM_WriteBuffer(0x0F38, gEeprom.ENC_KEY + 8);
// gRecalculateEncKey = true;

EEPROM_WriteBufferMCFW(0x1BBA, gEeprom.ENC_KEY, 5);
EEPROM_WriteBufferMCFW(0x1BCA, gEeprom.ENC_KEY + 5, 5);
gRecalculateEncKey = true;
EEPROM_WriteBuffer(0x1D20, gEeprom.ENC_KEY);
EEPROM_WriteBuffer(0x1D28, gEeprom.ENC_KEY + 8);
gRecalculateEncKey = true;

//Old Config
//EEPROM_WriteBufferMCFW(0x1BBA, gEeprom.ENC_KEY, 5);
//EEPROM_WriteBufferMCFW(0x1BCA, gEeprom.ENC_KEY + 5, 5);
//gRecalculateEncKey = true;

}

Expand Down
6 changes: 6 additions & 0 deletions ui/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ static const char MenuList[][8] = {
"Upconv",
#ifdef ENABLE_DOCK
"Remote",
#endif
#if defined(ENABLE_MISSED_CALL_NOTIFICATION_AND_BLINKING_LED)
"M Call",
#endif
"Tx 350",
"F Lock",
Expand Down Expand Up @@ -440,6 +443,9 @@ void UI_DisplayMenu(void) {
#ifdef ENABLE_DOCK
case MENU_REMOTE_UI:
#endif
#if defined(ENABLE_MISSED_CALL_NOTIFICATION_AND_BLINKING_LED)
case MENU_MISSED_CALL_NBLL:
#endif
#ifdef ENABLE_MESSENGER_ENCRYPTION
case MENU_MSG_ENC:
#endif
Expand Down
3 changes: 3 additions & 0 deletions ui/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ enum {
MENU_UPCONVERTER,
#ifdef ENABLE_DOCK
MENU_REMOTE_UI,
#endif
#if defined(ENABLE_MISSED_CALL_NOTIFICATION_AND_BLINKING_LED)
MENU_MISSED_CALL_NBLL,
#endif
MENU_350TX,
MENU_F_LOCK,
Expand Down
5 changes: 3 additions & 2 deletions ui/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ void UI_DisplayStatus(void) {
UI_DisplayBattery(gBatteryDisplayLevel);
}
#if defined(ENABLE_MISSED_CALL_NOTIFICATION_AND_BLINKING_LED)

if(gSetting_Missed_Call_NBL)
{
const uint8_t BITMAP_MISSED = 65;

if (gMissedCalls > 0) { // Indicador de chamada perdida
Expand All @@ -82,7 +83,7 @@ if (gMissedCalls > 0) { // Indicador de chamada perdida
gStatusLine[BITMAP_MISSED + 10] |= 0b00001100;
gStatusLine[BITMAP_MISSED + 11] |= 0b00001110;
}

}

#endif
#ifdef ENABLE_MESSENGER
Expand Down

0 comments on commit 9b2b5fb

Please sign in to comment.