From 857dcec36d3f6186e21b654f0f19108f87b44482 Mon Sep 17 00:00:00 2001 From: Armel FAUVEAU Date: Thu, 14 Mar 2024 06:10:25 +0100 Subject: [PATCH] Add Last QRG --- driver/backlight.c | 35 +++++++++++++++-------------- ui/helper.c | 2 ++ ui/helper.h | 2 +- ui/main.c | 55 +++++++++++++++++++++++++++------------------- ui/menu.c | 7 +++++- ui/welcome.c | 11 ++++++---- 6 files changed, 67 insertions(+), 45 deletions(-) diff --git a/driver/backlight.c b/driver/backlight.c index bd92d9c..4b0cfde 100644 --- a/driver/backlight.c +++ b/driver/backlight.c @@ -58,6 +58,17 @@ void BACKLIGHT_InitHardware() 0; } +static void BACKLIGHT_Sound(void) +{ + if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_SOUND || gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_ALL) + { + AUDIO_PlayBeep(BEEP_880HZ_60MS_TRIPLE_BEEP); + AUDIO_PlayBeep(BEEP_880HZ_60MS_TRIPLE_BEEP); + gK5startup = false; + } +} + + void BACKLIGHT_TurnOn(void) { #ifdef ENABLE_FEAT_F4HWN @@ -65,17 +76,13 @@ void BACKLIGHT_TurnOn(void) #endif if (gEeprom.BACKLIGHT_TIME == 0) { - #ifdef ENABLE_FEAT_F4HWN - if(gK5startup == true) { - if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_SOUND || gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_ALL) - { - AUDIO_PlayBeep(BEEP_880HZ_60MS_TRIPLE_BEEP); - AUDIO_PlayBeep(BEEP_880HZ_60MS_TRIPLE_BEEP); - } - } - gK5startup = false; - #endif BACKLIGHT_TurnOff(); + #ifdef ENABLE_FEAT_F4HWN + if(gK5startup == true) + { + BACKLIGHT_Sound(); + } + #endif return; } @@ -89,13 +96,7 @@ void BACKLIGHT_TurnOn(void) SYSTEM_DelayMs(50); } - if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_SOUND || gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_ALL) - { - AUDIO_PlayBeep(BEEP_880HZ_60MS_TRIPLE_BEEP); - AUDIO_PlayBeep(BEEP_880HZ_60MS_TRIPLE_BEEP); - } - - gK5startup = false; + BACKLIGHT_Sound(); } else { diff --git a/ui/helper.c b/ui/helper.c index 47b470b..e462970 100644 --- a/ui/helper.c +++ b/ui/helper.c @@ -199,6 +199,7 @@ static void sort(int16_t *a, int16_t *b) } #ifdef ENABLE_FEAT_F4HWN + /* void UI_DrawLineDottedBuffer(uint8_t (*buffer)[128], int16_t x1, int16_t y1, int16_t x2, int16_t y2, bool black) { if(x2==x1) { @@ -218,6 +219,7 @@ static void sort(int16_t *a, int16_t *b) } } } + */ void PutPixel(uint8_t x, uint8_t y, bool fill) { UI_DrawPixelBuffer(gFrameBuffer, x, y, fill); diff --git a/ui/helper.h b/ui/helper.h index b90afc6..294c744 100644 --- a/ui/helper.h +++ b/ui/helper.h @@ -33,7 +33,7 @@ void UI_DisplayPopup(const char *string); void UI_DrawPixelBuffer(uint8_t (*buffer)[128], uint8_t x, uint8_t y, bool black); #ifdef ENABLE_FEAT_F4HWN - void UI_DrawLineDottedBuffer(uint8_t (*buffer)[128], int16_t x1, int16_t y1, int16_t x2, int16_t y2, bool black); + //void UI_DrawLineDottedBuffer(uint8_t (*buffer)[128], int16_t x1, int16_t y1, int16_t x2, int16_t y2, bool black); void PutPixel(uint8_t x, uint8_t y, bool fill); void PutPixelStatus(uint8_t x, uint8_t y, bool fill); void GUI_DisplaySmallest(const char *pString, uint8_t x, uint8_t y, bool statusbar, bool fill); diff --git a/ui/main.c b/ui/main.c index 38393d5..fd77268 100644 --- a/ui/main.c +++ b/ui/main.c @@ -45,10 +45,12 @@ center_line_t center_line = CENTER_LINE_NONE; #ifdef ENABLE_FEAT_F4HWN - static bool RxBlink; + static int8_t RxBlink; static int8_t RxBlinkLed = 0; static int8_t RxBlinkLedCounter; static int8_t RxLine; + static uint32_t RxOnVfofrequency; + bool isMainOnlyInputDTMF = false; static bool isMainOnly(bool checkGui) @@ -264,6 +266,7 @@ void DisplayRSSIBar(const bool now) const unsigned int bar_x = 2 + txt_width + 4; // X coord of bar graph #ifdef ENABLE_FEAT_F4HWN + /* const char empty[] = { 0b00000000, 0b00000000, @@ -273,6 +276,7 @@ void DisplayRSSIBar(const bool now) 0b00000000, 0b00000000, }; + */ unsigned int line; if (isMainOnly(false)) @@ -284,28 +288,29 @@ void DisplayRSSIBar(const bool now) line = 3; } - char rx[4]; + //char rx[4]; //sprintf(String, "%d", RxBlink); //UI_PrintStringSmallBold(String, 80, 0, RxLine); if(RxLine >= 0 && center_line != CENTER_LINE_IN_USE) { - if(RxBlink == true) + switch(RxBlink) { - sprintf(rx, "%s", "RX"); - //UI_PrintStringSmallBold("RX", 14, 0, RxLine); - RxBlink = false; + case 0: + UI_PrintStringSmallBold("RX", 14, 0, RxLine); + break; + case 1: + UI_PrintStringSmallBold("RX", 14, 0, RxLine); + RxBlink = 2; + break; + case 2: + for (uint8_t i = 14; i < 30; i++) + { + gFrameBuffer[RxLine][i] = 0x00; + } + RxBlink = 1; + break; } - else - { - sprintf(rx, "%s", " "); - memcpy(gFrameBuffer[RxLine] + 14, &empty, ARRAY_SIZE(empty)); - memcpy(gFrameBuffer[RxLine] + 21, &empty, ARRAY_SIZE(empty)); - - //UI_PrintStringSmallBold(" ", 14, 0, RxLine); - RxBlink = true; - } - UI_PrintStringSmallBold(rx, 14, 0, RxLine); ST7565_BlitLine(RxLine); } #else @@ -753,6 +758,8 @@ void UI_DisplayMain(void) memcpy(p_line0 + 0, BITMAP_VFO_NotDefault, sizeof(BITMAP_VFO_NotDefault)); } + uint32_t frequency = gEeprom.VfoInfo[vfo_num].pRX->Frequency; + if (gCurrentFunction == FUNCTION_TRANSMIT) { // transmitting @@ -776,14 +783,15 @@ void UI_DisplayMain(void) #ifdef ENABLE_FEAT_F4HWN RxBlinkLed = 1; RxBlinkLedCounter = 0; + RxLine = line; + RxOnVfofrequency = frequency; if(!isMainVFO) { - RxLine = line; + RxBlink = 1; } else { - RxLine = -1; - UI_PrintStringSmallBold("RX", 14, 0, line); + RxBlink = 0; } #else UI_PrintStringSmallBold("RX", 14, 0, line); @@ -792,6 +800,12 @@ void UI_DisplayMain(void) #ifdef ENABLE_FEAT_F4HWN else { + if(RxOnVfofrequency == frequency && !isMainOnly(false)) + { + UI_PrintStringSmallNormal(">>", 14, 0, line); + //memcpy(p_line0 + 14, BITMAP_VFO_Default, sizeof(BITMAP_VFO_Default)); + } + if(RxBlinkLed == 1) RxBlinkLed = 2; } @@ -841,9 +855,6 @@ void UI_DisplayMain(void) state = VFO_STATE_ALARM; } #endif - - uint32_t frequency = gEeprom.VfoInfo[vfo_num].pRX->Frequency; - if (state != VFO_STATE_NORMAL) { if (state < ARRAY_SIZE(VfoStateStr)) diff --git a/ui/menu.c b/ui/menu.c index 56d72a6..102f2e8 100644 --- a/ui/menu.c +++ b/ui/menu.c @@ -469,7 +469,12 @@ void UI_DisplayMenu(void) #ifdef ENABLE_FEAT_F4HWN UI_DrawLineBuffer(gFrameBuffer, 50, 0, 50, 55, 1); // Be ware, status zone = 8 lines, the rest = 56 ->total 64 - UI_DrawLineDottedBuffer(gFrameBuffer, 0, 46, 50, 46, 1); + //UI_DrawLineDottedBuffer(gFrameBuffer, 0, 46, 50, 46, 1); + + for (uint8_t i = 0; i < 50; i += 2) + { + gFrameBuffer[5][i] = 0x40; + } #endif #ifndef ENABLE_CUSTOM_MENU_LAYOUT diff --git a/ui/welcome.c b/ui/welcome.c index c6fd7f6..93f694b 100644 --- a/ui/welcome.c +++ b/ui/welcome.c @@ -55,8 +55,8 @@ void UI_DisplayWelcome(void) UI_DisplayClear(); #ifdef ENABLE_FEAT_F4HWN - ST7565_BlitStatusLine(); // blank status line - ST7565_BlitFullScreen(); + //ST7565_BlitStatusLine(); // blank status line + //ST7565_BlitFullScreen(); if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_NONE || gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_SOUND) { ST7565_FillScreen(0x00); @@ -105,13 +105,16 @@ void UI_DisplayWelcome(void) #ifdef ENABLE_FEAT_F4HWN UI_PrintStringSmallNormal(Version, 0, 128, 4); + for (uint8_t i = 0; i < 128; i++) + { + gFrameBuffer[3][i] ^= 0x80; + } + for (uint8_t i = 18; i < 110; i++) { gFrameBuffer[4][i] ^= 0xFF; } - UI_DrawLineBuffer(gFrameBuffer, 0, 31, 126, 31, 1); - UI_PrintStringSmallNormal(Based, 0, 127, 5); UI_PrintStringSmallNormal(Credits, 0, 127, 6); #else