diff --git a/README.md b/README.md index b1eb7cd..c09c6cc 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ENABLE_STATUSBAR_PERCENTAGE := 1 show the battery percentage on the top * Better backlight times (inc always on) * Nicer/cleaner big numeric font than original Quansheng big numeric font * Various menu re-wordings (trying to reduce 'WTH does that mean ?') -* Extra menu items (including hidden frequency calibration) +* Extra menu items (including hidden ones) * plus others # Compiler diff --git a/app/menu.c b/app/menu.c index 30b5e60..b88dd0b 100644 --- a/app/menu.c +++ b/app/menu.c @@ -266,6 +266,7 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax) case MENU_500TX: case MENU_350EN: case MENU_SCREN: + case MENU_TX_EN: *pMin = 0; *pMax = ARRAY_SIZE(gSubMenu_OFF_ON) - 1; break; @@ -684,6 +685,11 @@ void MENU_AcceptSetting(void) gFlagReconfigureVfos = true; return; + case MENU_TX_EN: + gSetting_TX_EN = gSubMenuSelection; + gRequestSaveSettings = true; + return; + case MENU_F_CALI: gEeprom.BK4819_XTAL_FREQ_LOW = gSubMenuSelection; BK4819_WriteRegister(BK4819_REG_3B, 22656 + gEeprom.BK4819_XTAL_FREQ_LOW); @@ -1026,6 +1032,10 @@ void MENU_ShowCurrentSetting(void) gSubMenuSelection = gSetting_ScrambleEnable; break; + case MENU_TX_EN: + gSubMenuSelection = gSetting_TX_EN; + break; + case MENU_F_CALI: gSubMenuSelection = gEeprom.BK4819_XTAL_FREQ_LOW; break; diff --git a/board.c b/board.c index c0f5a87..1115888 100644 --- a/board.c +++ b/board.c @@ -713,6 +713,7 @@ void BOARD_EEPROM_Init(void) gSetting_500TX = (Data[4] < 2) ? Data[4] : false; gSetting_350EN = (Data[5] < 2) ? Data[5] : true; gSetting_ScrambleEnable = (Data[6] < 2) ? Data[6] : true; + gSetting_TX_EN = (Data[7] & (1u << 0)) ? true : false; if (!gEeprom.VFO_OPEN) { diff --git a/firmware b/firmware index 7223312..f2fa5cf 100644 Binary files a/firmware and b/firmware differ diff --git a/firmware.bin b/firmware.bin index 88bc89c..0741317 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index 485eebe..f145ae3 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/helper/boot.c b/helper/boot.c index a8c06ab..eb2314d 100644 --- a/helper/boot.c +++ b/helper/boot.c @@ -66,8 +66,11 @@ void BOOT_ProcessMode(BOOT_Mode_t Mode) { if (Mode == BOOT_MODE_F_LOCK) { - //gMenuListCount += 6; // enable the last 6 menu items - gMenuListCount += 7; // enable the last 7 menu items + // enable all the menu items + gMenuListCount = 0; + while (MenuList[gMenuListCount][0] != 0) + gMenuListCount++; + gMenuCursor = MENU_350TX; gSubMenuSelection = gSetting_350TX; GUI_SelectNextDisplay(DISPLAY_MENU); diff --git a/main.c b/main.c index 2ea1eba..255f369 100644 --- a/main.c +++ b/main.c @@ -117,8 +117,9 @@ void Main(void) // count the number of menu list items while (MenuList[gMenuListCount][0] != 0) gMenuListCount++; + // disable the N menu items //gMenuListCount -= 6; - gMenuListCount -= 7; + gMenuListCount -= 8; UI_DisplayWelcome(); BACKLIGHT_TurnOn(); diff --git a/misc.c b/misc.c index eb64a15..80f2a43 100644 --- a/misc.c +++ b/misc.c @@ -61,6 +61,7 @@ bool gSetting_KILLED; bool gSetting_200TX; bool gSetting_500TX; bool gSetting_350EN; +bool gSetting_TX_EN; uint8_t gSetting_F_LOCK; bool gSetting_ScrambleEnable; diff --git a/misc.h b/misc.h index 8292878..1a362cd 100644 --- a/misc.h +++ b/misc.h @@ -118,6 +118,7 @@ extern bool gSetting_KILLED; extern bool gSetting_200TX; extern bool gSetting_500TX; extern bool gSetting_350EN; +extern bool gSetting_TX_EN; extern uint8_t gSetting_F_LOCK; extern bool gSetting_ScrambleEnable; diff --git a/radio.c b/radio.c index 2f252a7..1bbbc14 100644 --- a/radio.c +++ b/radio.c @@ -908,6 +908,9 @@ void RADIO_PrepareTX(void) State = VFO_STATE_TX_DISABLE; else #endif + if (!gSetting_TX_EN) + State = VFO_STATE_TX_DISABLE; + else if (!FREQUENCY_Check(gCurrentVfo)) { if (gCurrentVfo->BUSY_CHANNEL_LOCK && gCurrentFunction == FUNCTION_RECEIVE) diff --git a/settings.c b/settings.c index 666123c..01426b3 100644 --- a/settings.c +++ b/settings.c @@ -163,13 +163,15 @@ void SETTINGS_SaveSettings(void) EEPROM_WriteBuffer(0x0F18, State); memset(State, 0xFF, sizeof(State)); - State[0] = gSetting_F_LOCK; - State[1] = gSetting_350TX; - State[2] = gSetting_KILLED; - State[3] = gSetting_200TX; - State[4] = gSetting_500TX; - State[5] = gSetting_350EN; - State[6] = gSetting_ScrambleEnable; + State[0] = gSetting_F_LOCK; + State[1] = gSetting_350TX; + State[2] = gSetting_KILLED; + State[3] = gSetting_200TX; + State[4] = gSetting_500TX; + State[5] = gSetting_350EN; + State[6] = gSetting_ScrambleEnable; + State[7] = 0xff; + if (!gSetting_TX_EN) State[7] &= ~(1u << 0); EEPROM_WriteBuffer(0x0F40, State); } diff --git a/ui/menu.c b/ui/menu.c index f3144ee..6f24d23 100644 --- a/ui/menu.c +++ b/ui/menu.c @@ -104,15 +104,16 @@ const char MenuList[][7] = // enabled if pressing PTT and upper side button at power-on. "F-LOCK", - "T-200", // was "200TX" - "T-350", // was "350TX" - "T-500", // was "500TX" + "TX-200", // was "200TX" + "TX-350", // was "350TX" + "TX-500", // was "500TX" "350-EN", // was "350EN" "SCR-EN", // was "SCREN" + "TX-EN", // enable TX "F-CALI", // reference xtal calibration - "" // end of list + "" // end of list - DO NOT DELETE THIS ! }; const char gSubMenu_TXP[3][5] = @@ -434,6 +435,7 @@ void UI_DisplayMenu(void) case MENU_500TX: case MENU_350EN: case MENU_SCREN: + case MENU_TX_EN: strcpy(String, gSubMenu_OFF_ON[gSubMenuSelection]); break; diff --git a/ui/menu.h b/ui/menu.h index b39b3b6..f5e8932 100644 --- a/ui/menu.h +++ b/ui/menu.h @@ -83,7 +83,7 @@ enum MENU_DEL_CH, MENU_RESET, - // items after here are hidden + // items after here are normally hidden MENU_F_LOCK, MENU_200TX, @@ -92,6 +92,7 @@ enum MENU_350EN, MENU_SCREN, + MENU_TX_EN, // enable TX MENU_F_CALI // reference xtal calibration }; diff --git a/ui/status.c b/ui/status.c index d767e1a..5f13423 100644 --- a/ui/status.c +++ b/ui/status.c @@ -114,29 +114,32 @@ void UI_DisplayStatus(const bool test_display) } else if (!gChargingWithTypeC) - { // battery voltage/percentage + { // battery voltage or percentage - #if defined(ENABLE_STATUSBAR_VOLTAGE) + #ifdef ENABLE_STATUSBAR_VOLTAGE char s[6]; sprintf(s, "%u.%02u", gBatteryVoltageAverage / 100, gBatteryVoltageAverage % 100); UI_PrintStringSmallBuffer(s, line); + //line += 8 * 4; #elif defined(ENABLE_STATUSBAR_PERCENTAGE) char s[6]; - const uint16_t volts = (gBatteryVoltageAverage < gMin_bat_v) ? gMin_bat_v : - (gBatteryVoltageAverage > gMax_bat_v) ? gMax_bat_v : - gBatteryVoltageAverage; + const uint16_t volts = (gBatteryVoltageAverage < gMin_bat_v) ? gMin_bat_v : gBatteryVoltageAverage; sprintf(s, "%u%%", (100 * (volts - gMin_bat_v)) / (gMax_bat_v - gMin_bat_v)); UI_PrintStringSmallBuffer(s, line); + //line += 8 * 4; #endif } +// else +// line += sizeof(BITMAP_F_Key); + + line = gStatusLine + LCD_WIDTH - sizeof(BITMAP_BatteryLevel5) - sizeof(BITMAP_USB_C); // point to right side of the screen // USB-C charge indicator if (gChargingWithTypeC || test_display) memmove(line, BITMAP_USB_C, sizeof(BITMAP_USB_C)); -// line += sizeof(BITMAP_USB_C); + line += sizeof(BITMAP_USB_C); // BATTERY LEVEL indicator - line = gStatusLine + LCD_WIDTH - sizeof(BITMAP_BatteryLevel5); // point to the far right side of the screen if (gBatteryDisplayLevel >= 5 || test_display) memmove(line, BITMAP_BatteryLevel5, sizeof(BITMAP_BatteryLevel5)); else