Skip to content

Commit

Permalink
Merge pull request #69 from kamilsss655/rc19.2
Browse files Browse the repository at this point in the history
Rc19.2
  • Loading branch information
kamilsss655 authored Jan 14, 2024
2 parents d0f97a8 + 5a2d803 commit cc03ef8
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 54 deletions.
50 changes: 27 additions & 23 deletions app/fm.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,35 +59,39 @@ static void Key_EXIT()

static void Key_UP_DOWN(bool direction)
{
BK1080_TuneNext(direction);
BK1080_TuneNext(direction);
gEeprom.FM_FrequencyPlaying = BK1080_GetFrequency();
// save
gRequestSaveSettings = true;
}

void FM_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
{
switch (Key)
{
case KEY_UP:
Key_UP_DOWN(true);
break;
case KEY_DOWN:
Key_UP_DOWN(false);
break;;
case KEY_EXIT:
Key_EXIT();
break;
case KEY_F:
GENERIC_Key_F(bKeyPressed, bKeyHeld);
break;
case KEY_PTT:
GENERIC_Key_PTT(bKeyPressed);
break;
default:
if (!bKeyHeld && bKeyPressed)
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
break;
{
uint8_t state = bKeyPressed + 2 * bKeyHeld;

if (state == 0) {
switch (Key)
{
case KEY_UP:
Key_UP_DOWN(true);
break;
case KEY_DOWN:
Key_UP_DOWN(false);
break;
case KEY_EXIT:
Key_EXIT();
break;
case KEY_F:
GENERIC_Key_F(bKeyPressed, bKeyHeld);
break;
case KEY_PTT:
GENERIC_Key_PTT(bKeyPressed);
break;
default:
if (!bKeyHeld && bKeyPressed)
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
break;
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions app/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1281,6 +1281,9 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
uint32_t Password;
Password = StrToUL(INPUTBOX_GetAscii());
gSubMenuSelection = Password;

gInputBoxIndex = 0;
return;
}
#endif

Expand Down
4 changes: 3 additions & 1 deletion app/spectrum.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@ uint16_t GetRssi() {
// SYSTICK_DelayUs(800);
// testing autodelay based on Glitch value

while ((BK4819_ReadRegister(0x63) & 0b11111111) >= 255) {
// testing resolution to sticky squelch issue
while (!isListening && (BK4819_ReadRegister(0x63) & 0b11111111) >= 255) {
SYSTICK_DelayUs(100);
}
rssi = BK4819_GetRSSI();
Expand Down Expand Up @@ -399,6 +400,7 @@ static void ToggleRX(bool on) {
} else {
if(appMode!=CHANNEL_MODE)
BK4819_WriteRegister(0x43, GetBWRegValueForScan());
isListening = false;
}
}

Expand Down
4 changes: 2 additions & 2 deletions driver/bk1080.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ void BK1080_TuneNext(bool direction)

// wait until we find the channel
while((BK1080_ReadRegister(BK1080_REG_10) >> 14) == 0){
SYSTEM_DelayMs(2);
SYSTEM_DelayMs(5);
}

//read found freq
reg_11 = BK1080_GetFrequency();
reg_11 = BK1080_ReadRegister(BK1080_REG_11);

// tune bit 0
BK1080_WriteRegister(BK1080_REG_03_CHANNEL, (0u << 15));
Expand Down
40 changes: 17 additions & 23 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,36 +153,30 @@ void Main(void)
}
else
{
UI_DisplayWelcome();

BACKLIGHT_TurnOn();

if (gEeprom.POWER_ON_DISPLAY_MODE != POWER_ON_DISPLAY_MODE_NONE)
{ // 2.55 second boot-up screen
while (boot_counter_10ms > 0)
#ifdef ENABLE_PWRON_PASSWORD
if (gEeprom.POWER_ON_PASSWORD < PASSWORD_OFF)
{
if (KEYBOARD_Poll() != KEY_INVALID)
{ // halt boot beeps
boot_counter_10ms = 0;
break;
}
#ifdef ENABLE_BOOT_BEEPS
if ((boot_counter_10ms % 25) == 0)
AUDIO_PlayBeep(BEEP_880HZ_40MS_OPTIONAL);
#endif
bIsInLockScreen = true;
UI_DisplayLock();
bIsInLockScreen = false;
}
}
gEeprom.PASSWORD_WRONG_ATTEMPTS = 0;
gFlagSaveSettings = true;
#endif

#ifdef ENABLE_PWRON_PASSWORD
if (gEeprom.POWER_ON_PASSWORD < PASSWORD_OFF)
UI_DisplayWelcome();

if (gEeprom.POWER_ON_DISPLAY_MODE != POWER_ON_DISPLAY_MODE_NONE)
{ // 2.55 second boot-up screen
SYSTEM_DelayMs(2550);
}
else
{
bIsInLockScreen = true;
UI_DisplayLock();
bIsInLockScreen = false;
//debounce keys
SYSTEM_DelayMs(300);
}
gEeprom.PASSWORD_WRONG_ATTEMPTS = 0;
gFlagSaveSettings = true;
#endif

BOOT_ProcessMode(BootMode);

Expand Down
6 changes: 2 additions & 4 deletions ui/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,20 +568,18 @@ void UI_DisplayMenu(void)
{
if((unsigned int)gSubMenuSelection >= PASSWORD_OFF)
{
sprintf(String, "OFF");
strcpy(String, "OFF");
}
else
{
sprintf(String, "****");
strcpy(String, "****");
}
}
else
{
const char * ascii = INPUTBOX_GetAscii();
sprintf(String, "%.4s ",ascii);
}
UI_PrintString(String, menu_item_x1, menu_item_x2, 1, 8);
already_printed = true;
break;
#endif

Expand Down
2 changes: 1 addition & 1 deletion ui/welcome.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void UI_DisplayWelcome(void)

if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_NONE)
{
ST7565_FillScreen(0xFF);
ST7565_BlitFullScreen();
}
else
if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_FULL_SCREEN)
Expand Down

0 comments on commit cc03ef8

Please sign in to comment.