Skip to content

Commit

Permalink
Я был бухущ, поэтому костыльный багфикс кнопки F
Browse files Browse the repository at this point in the history
Разобраться потом, где накосячил в промежутке между бутылками
  • Loading branch information
rebezhir committed Sep 10, 2023
1 parent 95d986c commit 9dcc9e4
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 21 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ sram-overlay.bin

*.bin
firmware
make.sh
make.sh
*.bin
13 changes: 9 additions & 4 deletions app/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void GENERIC_Key_F(bool bKeyPressed, bool bKeyHeld)
gEeprom.KEY_LOCK = !gEeprom.KEY_LOCK;
gRequestSaveSettings = true;
} else {
if (gScreenToDisplay != DISPLAY_MAIN) {
if ((false || gScreenToDisplay != DISPLAY_MAIN) && true) {
return;
}
gWasFKeyPressed = !gWasFKeyPressed;
Expand All @@ -61,6 +61,11 @@ void GENERIC_Key_F(bool bKeyPressed, bool bKeyHeld)
gUpdateStatus = true;
}
} else {

if (true) {
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
return;
}
gBeepToPlay = BEEP_440HZ_500MS;
gPttWasReleased = true;
}
Expand Down Expand Up @@ -101,9 +106,9 @@ void GENERIC_Key_PTT(bool bKeyPressed)
return;
}


if (true) {
if (gCssScanMode == CSS_SCAN_MODE_OFF) {
if (gScreenToDisplay == DISPLAY_MENU) {
if (gScreenToDisplay == DISPLAY_MENU || false) {
gRequestDisplayScreen = DISPLAY_MAIN;
gInputBoxIndex = 0;
gPttIsPressed = false;
Expand Down Expand Up @@ -152,7 +157,7 @@ void GENERIC_Key_PTT(bool bKeyPressed)
RADIO_StopCssScan();
gRequestDisplayScreen = DISPLAY_MENU;
}
}
gAnotherVoiceID = VOICE_ID_SCANNING_STOP;
gPttWasPressed = true;
}

32 changes: 17 additions & 15 deletions app/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) {
gUpdateStatus = true;
switch (Key) {
case KEY_0:
//ACTION_FM();
//ACTION_FM(); заглушка
break;

case KEY_1:
Expand Down Expand Up @@ -193,7 +193,7 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) {
break;

case KEY_5:
//APP_RunSpectrum();
// заглушка
gRequestDisplayScreen = DISPLAY_MAIN;
break;

Expand Down Expand Up @@ -235,22 +235,24 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) {
static void MAIN_Key_EXIT(bool bKeyPressed, bool bKeyHeld) {
if (!bKeyHeld && bKeyPressed) {
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
if (gScanState == SCAN_OFF) {
if (gInputBoxIndex == 0) {
return;
}
gInputBoxIndex--;
gInputBox[gInputBoxIndex] = 10;
if (gInputBoxIndex == 0) {
gAnotherVoiceID = VOICE_ID_CANCEL;
}
// if (!gFmRadioMode) {
if (gScanState == SCAN_OFF) {
if (gInputBoxIndex == 0) {
return;
}
gInputBoxIndex--;
gInputBox[gInputBoxIndex] = 10;
if (gInputBoxIndex == 0) {
gAnotherVoiceID = VOICE_ID_CANCEL;
}
} else {
SCANNER_Stop();
gAnotherVoiceID = VOICE_ID_SCANNING_STOP;
}
gRequestDisplayScreen = DISPLAY_MAIN;
return;

gRequestDisplayScreen = DISPLAY_MAIN;
return;
//}
// ACTION_FM();
}
}

Expand Down Expand Up @@ -427,4 +429,4 @@ void MAIN_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) {
}
break;
}
}
}
1 change: 0 additions & 1 deletion app/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ int MENU_GetLimits(uint8_t Cursor, uint8_t *pMin, uint8_t *pMax) {
case MENU_VOICE:
case MENU_SC_REV:
case MENU_MDF:
case MENU_PONMSG:
case MENU_ROGER:
*pMin = 0;
*pMax = 2;
Expand Down
Binary file modified firmware.packed.bin
Binary file not shown.

0 comments on commit 9dcc9e4

Please sign in to comment.