diff --git a/Makefile b/Makefile index 298f113..83c740a 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,6 @@ ENABLE_VOICE := 0 ENABLE_ALARM := 0 ENABLE_BIG_FREQ := 0 ENABLE_KEEP_MEM_NAME := 1 -ENABLE_CHAN_NAME_FREQ := 1 ENABLE_WIDE_RX := 1 ENABLE_TX_WHEN_AM := 0 ENABLE_CTCSS_TAIL_PHASE_SHIFT := 1 @@ -171,9 +170,6 @@ endif ifeq ($(ENABLE_KEEP_MEM_NAME),1) CFLAGS += -DKEEP_MEM_NAME endif -ifeq ($(ENABLE_CHAN_NAME_FREQ),1) - CFLAGS += -DENABLE_CHAN_NAME_FREQ -endif ifeq ($(ENABLE_WIDE_RX),1) CFLAGS += -DENABLE_WIDE_RX endif diff --git a/README.md b/README.md index 51f26f5..6a374f9 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,6 @@ ENABLE_VOICE := 0 want to hear voices ? ENABLE_ALARM := 0 TX alarms ENABLE_BIG_FREQ := 0 big font frequencies ENABLE_KEEP_MEM_NAME := 1 maintain channel name when (re)saving memory channel -ENABLE_CHAN_NAME_FREQ := 1 show channel frequency below channel name/number ENABLE_WIDE_RX := 1 full 18MHz to 1300MHz RX (though frontend not tuned over full range) ENABLE_TX_WHEN_AM := 0 allow TX (always FM) when RX is set to AM ENABLE_CTCSS_TAIL_PHASE_SHIFT := 1 standard CTCSS tail phase shift rather than QS's own 55Hz tone method diff --git a/bitmaps.c b/bitmaps.c index 6063924..a346eee 100644 --- a/bitmaps.c +++ b/bitmaps.c @@ -540,11 +540,11 @@ const uint8_t BITMAP_ScanList[6] = */ const uint8_t BITMAP_ScanList1[6] = { // 1 symbol + 0b00000000, 0b00000000, 0b01000010, 0b01111110, 0b01000010, - 0b00000000, 0b00000000 }; diff --git a/board.c b/board.c index cd98cf9..dd5412c 100644 --- a/board.c +++ b/board.c @@ -541,17 +541,13 @@ void BOARD_EEPROM_Init(void) // 0E78..0E7F EEPROM_ReadBuffer(0x0E78, Data, 8); - #ifndef ENABLE_CHAN_NAME_FREQ - gEeprom.CHANNEL_DISPLAY_MODE = (Data[1] < 3) ? Data[1] : MDF_FREQUENCY; - #else - gEeprom.CHANNEL_DISPLAY_MODE = (Data[1] < 4) ? Data[1] : MDF_FREQUENCY; - #endif - gEeprom.CROSS_BAND_RX_TX = (Data[2] < 3) ? Data[2] : CROSS_BAND_OFF; - gEeprom.BATTERY_SAVE = (Data[3] < 5) ? Data[3] : 4; - gEeprom.DUAL_WATCH = (Data[4] < 3) ? Data[4] : DUAL_WATCH_CHAN_A; - gEeprom.BACKLIGHT = (Data[5] < 6) ? Data[5] : 4; - gEeprom.TAIL_NOTE_ELIMINATION = (Data[6] < 2) ? Data[6] : false; - gEeprom.VFO_OPEN = (Data[7] < 2) ? Data[7] : true; + gEeprom.CHANNEL_DISPLAY_MODE = (Data[1] < 4) ? Data[1] : MDF_FREQUENCY; // 4 instead of 3 - extra display mode + gEeprom.CROSS_BAND_RX_TX = (Data[2] < 3) ? Data[2] : CROSS_BAND_OFF; + gEeprom.BATTERY_SAVE = (Data[3] < 5) ? Data[3] : 4; + gEeprom.DUAL_WATCH = (Data[4] < 3) ? Data[4] : DUAL_WATCH_CHAN_A; + gEeprom.BACKLIGHT = (Data[5] < 6) ? Data[5] : 4; + gEeprom.TAIL_NOTE_ELIMINATION = (Data[6] < 2) ? Data[6] : false; + gEeprom.VFO_OPEN = (Data[7] < 2) ? Data[7] : true; // 0E80..0E87 EEPROM_ReadBuffer(0x0E80, Data, 8); diff --git a/firmware b/firmware index f076d82..e55c912 100644 Binary files a/firmware and b/firmware differ diff --git a/firmware.bin b/firmware.bin index 06ca925..6f71534 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index 4ddb2fa..2e9b6f8 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/radio.c b/radio.c index 883cfe3..461ffc8 100644 --- a/radio.c +++ b/radio.c @@ -383,7 +383,7 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg) memset(gEeprom.VfoInfo[VFO].Name, 0, sizeof(gEeprom.VfoInfo[VFO].Name)); if (IS_MR_CHANNEL(Channel)) - { // 16 bytes allocated to the channel name but only 12 used + { // 16 bytes allocated to the channel name but only 10 used EEPROM_ReadBuffer(0x0F50 + (Channel * 16), gEeprom.VfoInfo[VFO].Name + 0, 8); EEPROM_ReadBuffer(0x0F58 + (Channel * 16), gEeprom.VfoInfo[VFO].Name + 8, 2); } diff --git a/radio.h b/radio.h index ef83bf3..a9dad79 100644 --- a/radio.h +++ b/radio.h @@ -127,7 +127,7 @@ typedef struct VFO_Info_t #ifdef ENABLE_COMPANDER uint8_t Compander; #endif - char Name[16]; + char Name[10 + 1]; } VFO_Info_t; extern VFO_Info_t *gTxVfo; diff --git a/ui/main.c b/ui/main.c index 57d32b3..4117dd7 100644 --- a/ui/main.c +++ b/ui/main.c @@ -42,8 +42,8 @@ void UI_DisplayMain(void) if (gEeprom.KEY_LOCK && gKeypadLocked > 0) { // tell user how to unlock the keyboard - UI_PrintString("Long press #", 0, LCD_WIDTH - 1, 1, 8); - UI_PrintString("to unlock", 0, LCD_WIDTH - 1, 3, 8); + UI_PrintString("Long press #", 0, LCD_WIDTH, 1, 8); + UI_PrintString("to unlock", 0, LCD_WIDTH, 3, 8); ST7565_BlitFullScreen(); return; } @@ -244,13 +244,21 @@ void UI_DisplayMain(void) if (IS_MR_CHANNEL(gEeprom.ScreenChannel[vfo_num])) { // channel mode - { // show the scanlist symbols - const uint8_t Attributes = gMR_ChannelAttributes[gEeprom.ScreenChannel[vfo_num]]; + // show the scanlist symbols + const uint8_t Attributes = gMR_ChannelAttributes[gEeprom.ScreenChannel[vfo_num]]; +// #ifdef ENABLE_BIG_FREQ + // side-by-side if (Attributes & MR_CH_SCANLIST1) memmove(pLine0 + 113, BITMAP_ScanList1, sizeof(BITMAP_ScanList1)); if (Attributes & MR_CH_SCANLIST2) memmove(pLine0 + 120, BITMAP_ScanList2, sizeof(BITMAP_ScanList2)); - } +// #else +// // top-bottom .. makes room for full 10 characters of channel name +// if (Attributes & MR_CH_SCANLIST1) +// memmove(pLine0 + 120, BITMAP_ScanList1, sizeof(BITMAP_ScanList1)); +// if (Attributes & MR_CH_SCANLIST2) +// memmove(pLine0 + 120 + LCD_WIDTH, BITMAP_ScanList2, sizeof(BITMAP_ScanList2)); +// #endif switch (gEeprom.CHANNEL_DISPLAY_MODE) { @@ -260,17 +268,17 @@ void UI_DisplayMain(void) // show the main large frequency digits UI_DisplayFrequency(String, 31, Line, false, false); // show the remaining 2 small frequency digits - UI_DisplaySmallDigits(2, String + 6, 112, Line + 1, true); + UI_DisplaySmallDigits(2, String + 7, 112, Line + 1, true); #else // show the frequency in the main font sprintf(String, "%03u.%05u", frequency / 100000, frequency % 100000); - UI_PrintString(String, 31, 112, Line, 8); + UI_PrintString(String, 32, 0, Line, 8); #endif break; case MDF_CHANNEL: // show the channel number sprintf(String, "CH-%03u", gEeprom.ScreenChannel[vfo_num] + 1); - UI_PrintString(String, 31, 112, Line, 8); + UI_PrintString(String, 32, 0, Line, 8); frequency = 0; break; @@ -284,28 +292,26 @@ void UI_DisplayMain(void) memset(String, 0, sizeof(String)); memmove(String, gEeprom.VfoInfo[vfo_num].Name, 10); } - UI_PrintString(String, 31, 112, Line, 8); +// UI_PrintString(String, 32, 112, Line, 8); + UI_PrintString(String, 32, 0, Line, 8); break; - #ifdef ENABLE_CHAN_NAME_FREQ - case MDF_NAME_FREQ: // show the channel name and frequency - if (gEeprom.VfoInfo[vfo_num].Name[0] <= 32 || gEeprom.VfoInfo[vfo_num].Name[0] >= 127) - { // no channel name, show channel number instead - sprintf(String, "CH-%03u", gEeprom.ScreenChannel[vfo_num] + 1); - } - else - { // channel name - memset(String, 0, sizeof(String)); - memmove(String, gEeprom.VfoInfo[vfo_num].Name, 10); - } - UI_PrintStringSmall(String, 31 + 8, 0, Line); + case MDF_NAME_FREQ: // show the channel name and frequency + if (gEeprom.VfoInfo[vfo_num].Name[0] <= 32 || gEeprom.VfoInfo[vfo_num].Name[0] >= 127) + { // no channel name, show channel number instead + sprintf(String, "CH-%03u", gEeprom.ScreenChannel[vfo_num] + 1); + } + else + { // channel name + memset(String, 0, sizeof(String)); + memmove(String, gEeprom.VfoInfo[vfo_num].Name, 10); + } + UI_PrintStringSmall(String, 32, 0, Line); - // show the channel frequency below the channel number/name - sprintf(String, "%03u.%05u", frequency / 100000, frequency % 100000); - UI_PrintStringSmall(String, 31 + 8, 0, Line + 1); - - break; - #endif + // show the channel frequency below the channel number/name + sprintf(String, "%03u.%05u", frequency / 100000, frequency % 100000); + UI_PrintStringSmall(String, 32, 0, Line + 1); + break; } } else @@ -313,13 +319,13 @@ void UI_DisplayMain(void) #ifdef ENABLE_BIG_FREQ NUMBER_ToDigits(frequency, String); // 8 digits // show the main large frequency digits - UI_DisplayFrequency(String, 31, Line, false, false); + UI_DisplayFrequency(String, 32, Line, false, false); // show the remaining 2 small frequency digits - UI_DisplaySmallDigits(2, String + 6, 112, Line + 1, true); + UI_DisplaySmallDigits(2, String + 7, 112, Line + 1, true); #else // show the frequency in the main font sprintf(String, "%03u.%05u", frequency / 100000, frequency % 100000); - UI_PrintString(String, 31, 112, Line, 8); + UI_PrintString(String, 32, 0, Line, 8); #endif } } diff --git a/ui/menu.c b/ui/menu.c index 718101f..9045e1b 100644 --- a/ui/menu.c +++ b/ui/menu.c @@ -175,22 +175,13 @@ const char gSubMenu_SC_REV[3][3] = "SE" }; -#ifndef ENABLE_CHAN_NAME_FREQ - const char gSubMenu_MDF[3][5] = - { - "FREQ", - "CHAN", - "NAME" - }; -#else - const char gSubMenu_MDF[4][8] = - { - "FREQ", - "CHAN", - "NAME", - "NAM+FRE" - }; -#endif +const char gSubMenu_MDF[4][8] = +{ + "FREQ", + "CHAN", + "NAME", + "NAM+FRE" +}; #ifdef ENABLE_ALARM const char gSubMenu_AL_MOD[2][5] = diff --git a/ui/menu.h b/ui/menu.h index 914cee2..343b880 100644 --- a/ui/menu.h +++ b/ui/menu.h @@ -109,11 +109,7 @@ extern const char gSubMenu_CHAN[3][7]; extern const char gSubMenu_VOICE[3][4]; #endif extern const char gSubMenu_SC_REV[3][3]; -#ifndef ENABLE_CHAN_NAME_FREQ - extern const char gSubMenu_MDF[3][5]; -#else - extern const char gSubMenu_MDF[4][8]; -#endif +extern const char gSubMenu_MDF[4][8]; #ifdef ENABLE_ALARM extern const char gSubMenu_AL_MOD[2][5]; #endif