diff --git a/Makefile b/Makefile index f97ba7b..08a3e36 100644 --- a/Makefile +++ b/Makefile @@ -99,6 +99,7 @@ CFLAGS += -DDISABLE_AIRCOPY CFLAGS += -DKEEP_MEM_NAME CFLAGS += -DDISABLE_ALARM CFLAGS += -DCHAN_NAME_FREQ +CFLAGS += -DSINGLE_VFO_CHAN #CFLAGS += -DBAND_SCOPE ifeq ($(DEBUG),1) diff --git a/README.md b/README.md index 1e388e9..b6ce7b0 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ You can edit those changes by (currently) editing the MakeFile, look for these l * CFLAGS += -DKEEP_MEM_NAME .. maintain the memory channel's name when re-saving the memory channel * CFLAGS += -DDISABLE_ALARM .. remove the ALARM transmit option from the firmware * CFLAGS += -DCHAN_NAME_FREQ .. show the channel frequency (as well as channel number/name) +* CFLAGS += -DSINGLE_VFO_CHAN .. only show a single VFO/CHANNEL if dual watch is disabled * #CFLAGS += -DBAND_SCOPE .. not yet implemented To enable the custom option just uncomment the line by removing the starting '#'. diff --git a/firmware b/firmware index 946d78e..b7e296f 100644 Binary files a/firmware and b/firmware differ diff --git a/firmware.bin b/firmware.bin index ada096a..c07ad41 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index 6d4914c..9b269fa 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/font.c b/font.c index 37b4791..e529cee 100644 --- a/font.c +++ b/font.c @@ -355,109 +355,109 @@ const uint8_t gFont6x8[96][6] = }; /* // ASCII 5x7 font -const uint8_t gFont5x7[5 * 16 * 6] = +const uint8_t gFont5x7[96][5] = { - 0x00, 0x00, 0x00, 0x00, 0x00, // ' ' - 0x00, 0x00, 0x5F, 0x00, 0x00, - 0x00, 0x07, 0x00, 0x07, 0x00, - 0x14, 0x7F, 0x14, 0x7F, 0x14, - 0x24, 0x2A, 0x7F, 0x2A, 0x12, - 0x23, 0x13, 0x08, 0x64, 0x62, - 0x36, 0x49, 0x56, 0x20, 0x50, - 0x00, 0x08, 0x07, 0x03, 0x00, - 0x00, 0x1C, 0x22, 0x41, 0x00, - 0x00, 0x41, 0x22, 0x1C, 0x00, - 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, - 0x08, 0x08, 0x3E, 0x08, 0x08, - 0x00, 0x80, 0x70, 0x30, 0x00, - 0x08, 0x08, 0x08, 0x08, 0x08, - 0x00, 0x00, 0x60, 0x60, 0x00, - 0x20, 0x10, 0x08, 0x04, 0x02, + {0x00, 0x00, 0x00, 0x00, 0x00}, // ' ' + {0x00, 0x00, 0x5F, 0x00, 0x00}, + {0x00, 0x07, 0x00, 0x07, 0x00}, + {0x14, 0x7F, 0x14, 0x7F, 0x14}, + {0x24, 0x2A, 0x7F, 0x2A, 0x12}, + {0x23, 0x13, 0x08, 0x64, 0x62}, + {0x36, 0x49, 0x56, 0x20, 0x50}, + {0x00, 0x08, 0x07, 0x03, 0x00}, + {0x00, 0x1C, 0x22, 0x41, 0x00}, + {0x00, 0x41, 0x22, 0x1C, 0x00}, + {0x2A, 0x1C, 0x7F, 0x1C, 0x2A}, + {0x08, 0x08, 0x3E, 0x08, 0x08}, + {0x00, 0x80, 0x70, 0x30, 0x00}, + {0x08, 0x08, 0x08, 0x08, 0x08}, + {0x00, 0x00, 0x60, 0x60, 0x00}, + {0x20, 0x10, 0x08, 0x04, 0x02}, -// 0x3E, 0x51, 0x49, 0x45, 0x3E, // '0' - 0x3E, 0x41, 0x41, 0x41, 0x3E, // '0' - 0x00, 0x42, 0x7F, 0x40, 0x00, - 0x72, 0x49, 0x49, 0x49, 0x46, - 0x21, 0x41, 0x49, 0x4D, 0x33, - 0x18, 0x14, 0x12, 0x7F, 0x10, - 0x27, 0x45, 0x45, 0x45, 0x39, - 0x3C, 0x4A, 0x49, 0x49, 0x31, - 0x41, 0x21, 0x11, 0x09, 0x07, - 0x36, 0x49, 0x49, 0x49, 0x36, - 0x46, 0x49, 0x49, 0x29, 0x1E, - 0x00, 0x00, 0x14, 0x00, 0x00, - 0x00, 0x40, 0x34, 0x00, 0x00, - 0x00, 0x08, 0x14, 0x22, 0x41, - 0x14, 0x14, 0x14, 0x14, 0x14, - 0x00, 0x41, 0x22, 0x14, 0x08, - 0x02, 0x01, 0x59, 0x09, 0x06, +// {0x3E, 0x51, 0x49, 0x45, 0x3E}, // '0' + {0x3E, 0x41, 0x41, 0x41, 0x3E}, // '0' + {0x00, 0x42, 0x7F, 0x40, 0x00}, + {0x72, 0x49, 0x49, 0x49, 0x46}, + {0x21, 0x41, 0x49, 0x4D, 0x33}, + {0x18, 0x14, 0x12, 0x7F, 0x10}, + {0x27, 0x45, 0x45, 0x45, 0x39}, + {0x3C, 0x4A, 0x49, 0x49, 0x31}, + {0x41, 0x21, 0x11, 0x09, 0x07}, + {0x36, 0x49, 0x49, 0x49, 0x36}, + {0x46, 0x49, 0x49, 0x29, 0x1E}, + {0x00, 0x00, 0x14, 0x00, 0x00}, + {0x00, 0x40, 0x34, 0x00, 0x00}, + {0x00, 0x08, 0x14, 0x22, 0x41}, + {0x14, 0x14, 0x14, 0x14, 0x14}, + {0x00, 0x41, 0x22, 0x14, 0x08}, + {0x02, 0x01, 0x59, 0x09, 0x06}, - 0x3E, 0x41, 0x5D, 0x59, 0x4E, // '@' - 0x7C, 0x12, 0x11, 0x12, 0x7C, // 'A' - 0x7F, 0x49, 0x49, 0x49, 0x36, - 0x3E, 0x41, 0x41, 0x41, 0x22, - 0x7F, 0x41, 0x41, 0x41, 0x3E, - 0x7F, 0x49, 0x49, 0x49, 0x41, - 0x7F, 0x09, 0x09, 0x09, 0x01, - 0x3E, 0x41, 0x41, 0x51, 0x73, - 0x7F, 0x08, 0x08, 0x08, 0x7F, - 0x00, 0x41, 0x7F, 0x41, 0x00, - 0x20, 0x40, 0x41, 0x3F, 0x01, - 0x7F, 0x08, 0x14, 0x22, 0x41, - 0x7F, 0x40, 0x40, 0x40, 0x40, - 0x7F, 0x02, 0x1C, 0x02, 0x7F, - 0x7F, 0x04, 0x08, 0x10, 0x7F, - 0x3E, 0x41, 0x41, 0x41, 0x3E, + {0x3E, 0x41, 0x5D, 0x59, 0x4E}, // '@' + {0x7C, 0x12, 0x11, 0x12, 0x7C}, // 'A' + {0x7F, 0x49, 0x49, 0x49, 0x36}, + {0x3E, 0x41, 0x41, 0x41, 0x22}, + {0x7F, 0x41, 0x41, 0x41, 0x3E}, + {0x7F, 0x49, 0x49, 0x49, 0x41}, + {0x7F, 0x09, 0x09, 0x09, 0x01}, + {0x3E, 0x41, 0x41, 0x51, 0x73}, + {0x7F, 0x08, 0x08, 0x08, 0x7F}, + {0x00, 0x41, 0x7F, 0x41, 0x00}, + {0x20, 0x40, 0x41, 0x3F, 0x01}, + {0x7F, 0x08, 0x14, 0x22, 0x41}, + {0x7F, 0x40, 0x40, 0x40, 0x40}, + {0x7F, 0x02, 0x1C, 0x02, 0x7F}, + {0x7F, 0x04, 0x08, 0x10, 0x7F}, + {0x3E, 0x41, 0x41, 0x41, 0x3E}, - 0x7F, 0x09, 0x09, 0x09, 0x06, - 0x3E, 0x41, 0x51, 0x21, 0x5E, - 0x7F, 0x09, 0x19, 0x29, 0x46, - 0x26, 0x49, 0x49, 0x49, 0x32, - 0x03, 0x01, 0x7F, 0x01, 0x03, - 0x3F, 0x40, 0x40, 0x40, 0x3F, - 0x1F, 0x20, 0x40, 0x20, 0x1F, - 0x3F, 0x40, 0x38, 0x40, 0x3F, - 0x63, 0x14, 0x08, 0x14, 0x63, - 0x03, 0x04, 0x78, 0x04, 0x03, - 0x61, 0x59, 0x49, 0x4D, 0x43, - 0x00, 0x7F, 0x41, 0x41, 0x41, - 0x02, 0x04, 0x08, 0x10, 0x20, - 0x00, 0x41, 0x41, 0x41, 0x7F, - 0x04, 0x02, 0x01, 0x02, 0x04, - 0x40, 0x40, 0x40, 0x40, 0x40, + {0x7F, 0x09, 0x09, 0x09, 0x06}, + {0x3E, 0x41, 0x51, 0x21, 0x5E}, + {0x7F, 0x09, 0x19, 0x29, 0x46}, + {0x26, 0x49, 0x49, 0x49, 0x32}, + {0x03, 0x01, 0x7F, 0x01, 0x03}, + {0x3F, 0x40, 0x40, 0x40, 0x3F}, + {0x1F, 0x20, 0x40, 0x20, 0x1F}, + {0x3F, 0x40, 0x38, 0x40, 0x3F}, + {0x63, 0x14, 0x08, 0x14, 0x63}, + {0x03, 0x04, 0x78, 0x04, 0x03}, + {0x61, 0x59, 0x49, 0x4D, 0x43}, + {0x00, 0x7F, 0x41, 0x41, 0x41}, + {0x02, 0x04, 0x08, 0x10, 0x20}, + {0x00, 0x41, 0x41, 0x41, 0x7F}, + {0x04, 0x02, 0x01, 0x02, 0x04}, + {0x40, 0x40, 0x40, 0x40, 0x40}, - 0x00, 0x03, 0x07, 0x08, 0x00, - 0x20, 0x54, 0x54, 0x78, 0x40, - 0x7F, 0x28, 0x44, 0x44, 0x38, - 0x38, 0x44, 0x44, 0x44, 0x28, - 0x38, 0x44, 0x44, 0x28, 0x7F, - 0x38, 0x54, 0x54, 0x54, 0x18, - 0x00, 0x08, 0x7E, 0x09, 0x02, - 0x18, 0xA4, 0xA4, 0x9C, 0x78, - 0x7F, 0x08, 0x04, 0x04, 0x78, - 0x00, 0x44, 0x7D, 0x40, 0x00, - 0x20, 0x40, 0x40, 0x3D, 0x00, - 0x7F, 0x10, 0x28, 0x44, 0x00, - 0x00, 0x41, 0x7F, 0x40, 0x00, - 0x7C, 0x04, 0x78, 0x04, 0x78, - 0x7C, 0x08, 0x04, 0x04, 0x78, - 0x38, 0x44, 0x44, 0x44, 0x38, + {0x00, 0x03, 0x07, 0x08, 0x00}, + {0x20, 0x54, 0x54, 0x78, 0x40}, + {0x7F, 0x28, 0x44, 0x44, 0x38}, + {0x38, 0x44, 0x44, 0x44, 0x28}, + {0x38, 0x44, 0x44, 0x28, 0x7F}, + {0x38, 0x54, 0x54, 0x54, 0x18}, + {0x00, 0x08, 0x7E, 0x09, 0x02}, + {0x18, 0xA4, 0xA4, 0x9C, 0x78}, + {0x7F, 0x08, 0x04, 0x04, 0x78}, + {0x00, 0x44, 0x7D, 0x40, 0x00}, + {0x20, 0x40, 0x40, 0x3D, 0x00}, + {0x7F, 0x10, 0x28, 0x44, 0x00}, + {0x00, 0x41, 0x7F, 0x40, 0x00}, + {0x7C, 0x04, 0x78, 0x04, 0x78}, + {0x7C, 0x08, 0x04, 0x04, 0x78}, + {0x38, 0x44, 0x44, 0x44, 0x38}, - 0xFC, 0x18, 0x24, 0x24, 0x18, - 0x18, 0x24, 0x24, 0x18, 0xFC, - 0x7C, 0x08, 0x04, 0x04, 0x08, - 0x48, 0x54, 0x54, 0x54, 0x24, - 0x04, 0x04, 0x3F, 0x44, 0x24, - 0x3C, 0x40, 0x40, 0x20, 0x7C, - 0x1C, 0x20, 0x40, 0x20, 0x1C, - 0x3C, 0x40, 0x30, 0x40, 0x3C, - 0x44, 0x28, 0x10, 0x28, 0x44, - 0x4C, 0x90, 0x90, 0x90, 0x7C, - 0x44, 0x64, 0x54, 0x4C, 0x44, - 0x00, 0x08, 0x36, 0x41, 0x00, - 0x00, 0x00, 0x77, 0x00, 0x00, - 0x00, 0x41, 0x36, 0x08, 0x00, - 0x02, 0x01, 0x02, 0x04, 0x02, - 0x3C, 0x26, 0x23, 0x26, 0x3C + {0xFC, 0x18, 0x24, 0x24, 0x18}, + {0x18, 0x24, 0x24, 0x18, 0xFC}, + {0x7C, 0x08, 0x04, 0x04, 0x08}, + {0x48, 0x54, 0x54, 0x54, 0x24}, + {0x04, 0x04, 0x3F, 0x44, 0x24}, + {0x3C, 0x40, 0x40, 0x20, 0x7C}, + {0x1C, 0x20, 0x40, 0x20, 0x1C}, + {0x3C, 0x40, 0x30, 0x40, 0x3C}, + {0x44, 0x28, 0x10, 0x28, 0x44}, + {0x4C, 0x90, 0x90, 0x90, 0x7C}, + {0x44, 0x64, 0x54, 0x4C, 0x44}, + {0x00, 0x08, 0x36, 0x41, 0x00}, + {0x00, 0x00, 0x77, 0x00, 0x00}, + {0x00, 0x41, 0x36, 0x08, 0x00}, + {0x02, 0x01, 0x02, 0x04, 0x02}, + {0x3C, 0x26, 0x23, 0x26, 0x3C} }; */ \ No newline at end of file diff --git a/font.h b/font.h index d594427..c525ff6 100644 --- a/font.h +++ b/font.h @@ -25,7 +25,7 @@ extern const uint8_t gFontSmallDigits[11][7]; //extern const uint64_t gFont8x8[16 * 6]; extern const uint8_t gFont6x8[96][6]; -//extern const uint8_t gFont5x7[5 * 16 * 6]; +//extern const uint8_t gFont5x7[96][5]; #endif diff --git a/radio.c b/radio.c index 8ff49ab..b3af4b4 100644 --- a/radio.c +++ b/radio.c @@ -497,7 +497,7 @@ void RADIO_SelectVfos(void) gTxVfo = &gEeprom.VfoInfo[gEeprom.TX_CHANNEL]; if (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) - gEeprom.RX_CHANNEL = gEeprom.TX_CHANNEL; + gEeprom.RX_CHANNEL = gEeprom.TX_CHANNEL; else gEeprom.RX_CHANNEL = (gEeprom.TX_CHANNEL == 0) ? 1 : 0; diff --git a/ui/helper.c b/ui/helper.c index 6d9c9e5..8adfee0 100644 --- a/ui/helper.c +++ b/ui/helper.c @@ -96,11 +96,11 @@ void UI_PrintStringSmall(const char *pString, uint8_t Start, uint8_t End, uint8_ { if (pString[i] >= 32) { - const unsigned int Index = ((unsigned int)pString[i] - 32) * 5; - if (Index < sizeof(gFont5x7)) + const unsigned int Index = ((unsigned int)pString[i] - 32); + if (Index < ARRAY_SIZE(gFont5x7)) { - const unsigned int ofs = (unsigned int)Start + (i * 8); - memcpy(gFrameBuffer[Line] + ofs, &gFont5x7[Index], 5); + const unsigned int ofs = (unsigned int)Start + (i * 6); + memcpy(gFrameBuffer[Line] + ofs, &gFont5x7[Index], ARRAY_SIZE(gFont5x7[Index])); } } } @@ -114,8 +114,8 @@ void UI_PrintStringSmall(const char *pString, uint8_t Start, uint8_t End, uint8_ const unsigned int Index = (unsigned int)pString[i] - 32; if (Index < ARRAY_SIZE(gFont6x8)) { - const unsigned int ofs = (unsigned int)Start + (i * 8); - memcpy(gFrameBuffer[Line] + ofs, &gFont6x8[Index], 6); + const unsigned int ofs = (unsigned int)Start + (i * 7); + memcpy(gFrameBuffer[Line] + ofs, &gFont6x8[Index], ARRAY_SIZE(gFont6x8[Index])); } } } diff --git a/ui/main.c b/ui/main.c index 539c1bf..17ee218 100644 --- a/ui/main.c +++ b/ui/main.c @@ -43,7 +43,11 @@ void UI_DisplayMain(void) return; } +//#ifndef SINGLE_VFO_CHAN for (vfo_num = 0; vfo_num < 2; vfo_num++) +//#else +// vfo_num = 0; +//#endif { uint8_t Channel = gEeprom.TX_CHANNEL; bool bIsSameVfo = !!(Channel == vfo_num); @@ -274,7 +278,11 @@ void UI_DisplayMain(void) { case MDF_FREQUENCY: NUMBER_ToDigits(frequency_Hz, String); + + // show the first lot of the frequency digits UI_DisplayFrequency(String, 31, vfo_num * 4, false, false); + // show the remaining 2 frequency digits + UI_DisplaySmallDigits(2, String + 6, 112, Line + 1); if (IS_MR_CHANNEL(gEeprom.ScreenChannel[vfo_num])) { @@ -285,12 +293,11 @@ void UI_DisplayMain(void) memcpy(pLine0 + 120, BITMAP_ScanList, sizeof(BITMAP_ScanList)); } - UI_DisplaySmallDigits(2, String + 6, 112, Line + 1); - frequency_Hz = 0; break; case MDF_CHANNEL: + sprintf(String, "CH-%03d", gEeprom.ScreenChannel[vfo_num] + 1); UI_PrintString(String, 31, 112, vfo_num * 4, 8, true); frequency_Hz = 0; break; @@ -313,13 +320,13 @@ void UI_DisplayMain(void) if (gEeprom.VfoInfo[vfo_num].Name[0] == 0 || gEeprom.VfoInfo[vfo_num].Name[0] == 0xFF) { // channel number sprintf(String, "CH-%03d", gEeprom.ScreenChannel[vfo_num] + 1); - UI_PrintStringSmall(gEeprom.VfoInfo[vfo_num].Name, 31 + 8, 0, (vfo_num * 4) + 1, false); + UI_PrintStringSmall(gEeprom.VfoInfo[vfo_num].Name, 31 + 16, 0, (vfo_num * 4) + 0, false); } else { // channel name memset(String, 0, sizeof(String)); memcpy(String, gEeprom.VfoInfo[vfo_num].Name, 8); - UI_PrintStringSmall(gEeprom.VfoInfo[vfo_num].Name, 31 + 8, 0, (vfo_num * 4) + 1, false); + UI_PrintStringSmall(gEeprom.VfoInfo[vfo_num].Name, 31 + 16, 0, (vfo_num * 4) + 0, false); } break; #endif @@ -460,13 +467,13 @@ void UI_DisplayMain(void) #ifdef CHAN_NAME_FREQ if (frequency_Hz > 0) - { // show the channel frequency above the channel number/name + { // show the channel frequency below the channel number/name #if 0 NUMBER_ToDigits(frequency_Hz, String); // 8 digits - UI_DisplayFrequencySmall(String, 31 + 8, (vfo_num * 4) + 0, false); + UI_DisplayFrequencySmall(String, 31 + 8, (vfo_num * 4) + 1, false); #else sprintf(String, "%9.5f", frequency_Hz * 0.00001); - UI_PrintStringSmall(String, 31 + 8, 0, (vfo_num * 4) + 0, false); + UI_PrintStringSmall(String, 31 + 16, 0, (vfo_num * 4) + 1, false); #endif } #endif