From b2015430ea80622dca04441eb8fcb116cecf1ca7 Mon Sep 17 00:00:00 2001 From: OneOfEleven Date: Sun, 24 Sep 2023 01:36:43 +0100 Subject: [PATCH] Added small bold font option --- Makefile | 4 + README.md | 1 + am_fix.c | 16 +++ am_fix.h | 16 +++ app/main.c | 44 ++------ font.c | 291 +++++++++++++++++++++++++++++++++++----------------- font.h | 3 + ui/helper.c | 32 +++++- ui/helper.h | 3 + ui/main.c | 7 +- version.c | 2 +- 11 files changed, 282 insertions(+), 137 deletions(-) diff --git a/Makefile b/Makefile index d6f7956..ce3327d 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ ENABLE_NOAA := 0 ENABLE_VOICE := 0 ENABLE_ALARM := 0 ENABLE_BIG_FREQ := 0 +ENABLE_SMALL_BOLD := 1 ENABLE_KEEP_MEM_NAME := 1 ENABLE_WIDE_RX := 1 ENABLE_TX_WHEN_AM := 0 @@ -165,6 +166,9 @@ endif ifeq ($(ENABLE_BIG_FREQ),1) CFLAGS += -DENABLE_BIG_FREQ endif +ifeq ($(ENABLE_SMALL_BOLD),1) + CFLAGS += -DENABLE_SMALL_BOLD +endif ifeq ($(ENABLE_NOAA),1) CFLAGS += -DENABLE_NOAA endif diff --git a/README.md b/README.md index 6900a99..9c56230 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ ENABLE_NOAA := 0 Everything NOAA ENABLE_VOICE := 0 want to hear voices ? ENABLE_ALARM := 0 TX alarms ENABLE_BIG_FREQ := 0 big font frequencies +ENABLE_SMALL_BOLD := 1 bold channel name/no. (name + freq channel display mode) ENABLE_KEEP_MEM_NAME := 1 maintain channel name when (re)saving memory channel 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 diff --git a/am_fix.c b/am_fix.c index e8ad599..6813366 100644 --- a/am_fix.c +++ b/am_fix.c @@ -1,4 +1,20 @@ +/* Copyright 2023 OneOfEleven + * https://github.com/DualTachyon + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #include #include "app/generic.h" diff --git a/am_fix.h b/am_fix.h index cf0f849..7f98d4d 100644 --- a/am_fix.h +++ b/am_fix.h @@ -1,4 +1,20 @@ +/* Copyright 2023 OneOfEleven + * https://github.com/DualTachyon + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #ifndef AM_FIXH #include diff --git a/app/main.c b/app/main.c index fde510d..2f088ff 100644 --- a/app/main.c +++ b/app/main.c @@ -176,42 +176,14 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep) gRequestSaveVFO = true; gVfoConfigureMode = VFO_CONFIGURE_RELOAD; #else - #if 0 - // toggle wide/narrow - // TODO: FIX ME .. not working for VFO, works for channel - switch (gTxVfo->CHANNEL_BANDWIDTH) - { - case BANDWIDTH_WIDE: - gTxVfo->CHANNEL_BANDWIDTH = BANDWIDTH_NARROW; - break; - default: - case BANDWIDTH_NARROW: - gTxVfo->CHANNEL_BANDWIDTH = BANDWIDTH_WIDE; - break; - } - if (IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE)) - { - gRequestSaveChannel = 2; - } - else - //if (IS_FREQ_CHANNEL(gTxVfo->CHANNEL_SAVE)) - { - gRequestSaveVFO = true; - gVfoConfigureMode = VFO_CONFIGURE_RELOAD; - } - BK4819_SetFilterBandwidth(gTxVfo->CHANNEL_BANDWIDTH, ); - gUpdateDisplay = true; - gRequestDisplayScreen = gScreenToDisplay; - #else - // toggle scanlist-1 - if (gScreenToDisplay != DISPLAY_SCANNER) - { - gTxVfo->SCANLIST1_PARTICIPATION = gTxVfo->SCANLIST1_PARTICIPATION ? 0 : 1; - SETTINGS_UpdateChannel(gTxVfo->CHANNEL_SAVE, gTxVfo, true); - gVfoConfigureMode = VFO_CONFIGURE_1; - gFlagResetVfos = true; - } - #endif + // toggle scanlist-1 + if (gScreenToDisplay != DISPLAY_SCANNER) + { + gTxVfo->SCANLIST1_PARTICIPATION = gTxVfo->SCANLIST1_PARTICIPATION ? 0 : 1; + SETTINGS_UpdateChannel(gTxVfo->CHANNEL_SAVE, gTxVfo, true); + gVfoConfigureMode = VFO_CONFIGURE_1; + gFlagResetVfos = true; + } #endif break; diff --git a/font.c b/font.c index 76e9add..768ed94 100644 --- a/font.c +++ b/font.c @@ -167,99 +167,200 @@ const uint8_t gFontSmallDigits[11][7] = */ const uint8_t gFontSmall[95][7] = { - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // ' ' - {0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x00}, // '!' - {0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00}, // '"' - {0x00, 0x14, 0x3E, 0x14, 0x3E, 0x14, 0x00}, // '#' - {0x00, 0x26, 0x49, 0x7F, 0x49, 0x32, 0x00}, // '$' - {0x00, 0x63, 0x13, 0x08, 0x04, 0x62, 0x61}, // '%' - {0x00, 0x30, 0x4B, 0x4D, 0x55, 0x22, 0x50}, // '&' - {0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00}, // ''' - {0x00, 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00}, // '(' - {0x00, 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00}, // ')' - {0x00, 0x00, 0x2A, 0x1C, 0x1C, 0x2A, 0x00}, // '*' - {0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00}, // '+' - {0x00, 0x00, 0x40, 0x60, 0x20, 0x00, 0x00}, // ',' - {0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x00}, // '-' - {0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00}, // '.' - {0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02}, // '/' - {0x00, 0x3E, 0x41, 0x41, 0x41, 0x41, 0x3E}, // '0' - {0x00, 0x00, 0x40, 0x42, 0x7F, 0x40, 0x40}, // '1' - {0x00, 0x62, 0x51, 0x51, 0x49, 0x49, 0x46}, // '2' - {0x00, 0x22, 0x41, 0x49, 0x49, 0x49, 0x36}, // '3' - {0x00, 0x18, 0x14, 0x12, 0x11, 0x7F, 0x10}, // '4' - {0x00, 0x27, 0x45, 0x45, 0x45, 0x45, 0x39}, // '5' - {0x00, 0x3E, 0x49, 0x49, 0x49, 0x49, 0x32}, // '6' - {0x00, 0x01, 0x01, 0x71, 0x09, 0x05, 0x03}, // '7' - {0x00, 0x36, 0x49, 0x49, 0x49, 0x49, 0x36}, // '8' - {0x00, 0x46, 0x49, 0x49, 0x49, 0x29, 0x1E}, // '9' - {0x00, 0x00, 0x00, 0x6C, 0x6C, 0x00, 0x00}, // ':' - {0x00, 0x00, 0x40, 0x6C, 0x2C, 0x00, 0x00}, // ';' - {0x00, 0x08, 0x14, 0x22, 0x41, 0x00, 0x00}, // '<' - {0x00, 0x14, 0x14, 0x14, 0x14, 0x14, 0x00}, // '=' - {0x00, 0x00, 0x41, 0x22, 0x14, 0x08, 0x00}, // '>' - {0x00, 0x02, 0x01, 0x51, 0x09, 0x06, 0x00}, // '?' - {0x00, 0x30, 0x4A, 0x4A, 0x52, 0x3C, 0x00}, // '@' - {0x00, 0x7E, 0x09, 0x09, 0x09, 0x09, 0x7E}, // 'A' - {0x00, 0x7F, 0x49, 0x49, 0x49, 0x49, 0x36}, // 'B' - {0x00, 0x3E, 0x41, 0x41, 0x41, 0x41, 0x22}, // 'C' - {0x00, 0x7F, 0x41, 0x41, 0x41, 0x41, 0x3E}, // 'D' - {0x00, 0x7F, 0x49, 0x49, 0x49, 0x49, 0x41}, // 'E' - {0x00, 0x7F, 0x09, 0x09, 0x09, 0x09, 0x01}, // 'F' - {0x00, 0x3E, 0x41, 0x49, 0x49, 0x49, 0x3A}, // 'G' - {0x00, 0x7F, 0x08, 0x08, 0x08, 0x08, 0x7F}, // 'H' - {0x00, 0x41, 0x41, 0x7F, 0x41, 0x41, 0x00}, // 'I' - {0x00, 0x20, 0x41, 0x41, 0x3F, 0x01, 0x01}, // 'J' - {0x00, 0x7F, 0x08, 0x0C, 0x12, 0x21, 0x40}, // 'K' - {0x00, 0x7F, 0x40, 0x40, 0x40, 0x40, 0x40}, // 'L' - {0x00, 0x7F, 0x02, 0x04, 0x04, 0x02, 0x7F}, // 'M' - {0x00, 0x7F, 0x02, 0x04, 0x08, 0x10, 0x7F}, // 'N' - {0x00, 0x3E, 0x41, 0x41, 0x41, 0x41, 0x3E}, // 'O' - {0x00, 0x7F, 0x09, 0x09, 0x09, 0x09, 0x06}, // 'P' - {0x00, 0x3E, 0x41, 0x51, 0x61, 0x41, 0x3E}, // 'Q' - {0x00, 0x7F, 0x09, 0x09, 0x19, 0x29, 0x46}, // 'R' - {0x00, 0x26, 0x49, 0x49, 0x49, 0x49, 0x32}, // 'S' - {0x00, 0x01, 0x01, 0x7F, 0x01, 0x01, 0x00}, // 'T' - {0x00, 0x3F, 0x40, 0x40, 0x40, 0x40, 0x3F}, // 'U' - {0x00, 0x07, 0x38, 0x40, 0x40, 0x38, 0x07}, // 'V' - {0x00, 0x3F, 0x40, 0x30, 0x30, 0x40, 0x3F}, // 'W' - {0x00, 0x63, 0x14, 0x08, 0x08, 0x14, 0x63}, // 'X' - {0x00, 0x07, 0x08, 0x70, 0x08, 0x07, 0x00}, // 'Y' - {0x00, 0x61, 0x51, 0x49, 0x45, 0x43, 0x41}, // 'Z' - {0x00, 0x00, 0x7F, 0x41, 0x41, 0x00, 0x00}, // '[' - {0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x60}, // '"\' - {0x00, 0x00, 0x00, 0x41, 0x41, 0x7F, 0x00}, // ']' - {0x00, 0x04, 0x02, 0x01, 0x02, 0x04, 0x00}, // '^' - {0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40}, // '_' - {0x00, 0x00, 0x03, 0x07, 0x06, 0x00, 0x00}, // '`' - {0x00, 0x20, 0x54, 0x54, 0x54, 0x78, 0x00}, // 'a' - {0x00, 0x7F, 0x44, 0x44, 0x44, 0x38, 0x00}, // 'b' - {0x00, 0x38, 0x44, 0x44, 0x44, 0x28, 0x00}, // 'c' - {0x00, 0x38, 0x44, 0x44, 0x44, 0x7F, 0x00}, // 'd' - {0x00, 0x38, 0x54, 0x54, 0x54, 0x48, 0x00}, // 'e' - {0x00, 0x7C, 0x0A, 0x0A, 0x0A, 0x02, 0x00}, // 'f' - {0x00, 0x58, 0x54, 0x54, 0x54, 0x3C, 0x00}, // 'g' - {0x00, 0x7F, 0x04, 0x04, 0x04, 0x78, 0x00}, // 'h' - {0x00, 0x00, 0x00, 0x7A, 0x00, 0x00, 0x00}, // 'i' - {0x00, 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00}, // 'j' - {0x00, 0x00, 0x7F, 0x10, 0x28, 0x44, 0x00}, // 'k' - {0x00, 0x00, 0x00, 0x3F, 0x40, 0x00, 0x00}, // 'l' - {0x00, 0x7C, 0x08, 0x10, 0x10, 0x08, 0x7C}, // 'm' - {0x00, 0x7C, 0x04, 0x04, 0x04, 0x78, 0x00}, // 'n' - {0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00}, // 'o' - {0x00, 0x7C, 0x14, 0x14, 0x14, 0x08, 0x00}, // 'p' - {0x00, 0x08, 0x14, 0x14, 0x14, 0x7C, 0x40}, // 'q' - {0x00, 0x7C, 0x04, 0x04, 0x04, 0x08, 0x00}, // 'r' - {0x00, 0x08, 0x54, 0x54, 0x54, 0x20, 0x00}, // 's' - {0x00, 0x3F, 0x44, 0x44, 0x44, 0x40, 0x00}, // 't' - {0x00, 0x3C, 0x40, 0x40, 0x40, 0x3C, 0x00}, // 'u' - {0x00, 0x0C, 0x30, 0x40, 0x30, 0x0C, 0x00}, // 'v' - {0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00}, // 'w' - {0x00, 0x44, 0x28, 0x10, 0x28, 0x44, 0x00}, // 'x' - {0x00, 0x0C, 0x50, 0x50, 0x50, 0x3C, 0x00}, // 'y' - {0x00, 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00}, // 'z' - {0x00, 0x08, 0x36, 0x41, 0x00, 0x00, 0x00}, // '{' - {0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00}, // '|' - {0x00, 0x00, 0x00, 0x41, 0x36, 0x08, 0x00}, // '}' - {0x00, 0x04, 0x02, 0x04, 0x08, 0x04, 0x00} // '->' + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // ' ' + {0x00, 0x00, 0x5E, 0x00, 0x00, 0x00}, // '!' + {0x00, 0x06, 0x00, 0x06, 0x00, 0x00}, // '"' + {0x14, 0x3E, 0x14, 0x3E, 0x14, 0x00}, // '#' + {0x26, 0x49, 0x7F, 0x49, 0x32, 0x00}, // '$' + {0x63, 0x13, 0x08, 0x04, 0x62, 0x61}, // '%' + {0x30, 0x4B, 0x4D, 0x55, 0x22, 0x50}, // '&' + {0x00, 0x00, 0x07, 0x07, 0x00, 0x00}, // ''' + {0x00, 0x1C, 0x22, 0x41, 0x00, 0x00}, // '(' + {0x00, 0x41, 0x22, 0x1C, 0x00, 0x00}, // ')' + {0x00, 0x2A, 0x1C, 0x1C, 0x2A, 0x00}, // '*' + {0x08, 0x08, 0x3E, 0x08, 0x08, 0x00}, // '+' + {0x00, 0x40, 0x60, 0x20, 0x00, 0x00}, // ',' + {0x00, 0x08, 0x08, 0x08, 0x08, 0x00}, // '-' + {0x00, 0x00, 0x60, 0x60, 0x00, 0x00}, // '.' + {0x40, 0x20, 0x10, 0x08, 0x04, 0x02}, // '/' + {0x3E, 0x41, 0x41, 0x41, 0x41, 0x3E}, // '0' + {0x00, 0x40, 0x42, 0x7F, 0x40, 0x40}, // '1' + {0x62, 0x51, 0x51, 0x49, 0x49, 0x46}, // '2' + {0x22, 0x41, 0x49, 0x49, 0x49, 0x36}, // '3' + {0x18, 0x14, 0x12, 0x11, 0x7F, 0x10}, // '4' + {0x27, 0x45, 0x45, 0x45, 0x45, 0x39}, // '5' + {0x3E, 0x49, 0x49, 0x49, 0x49, 0x32}, // '6' + {0x01, 0x01, 0x71, 0x09, 0x05, 0x03}, // '7' + {0x36, 0x49, 0x49, 0x49, 0x49, 0x36}, // '8' + {0x46, 0x49, 0x49, 0x49, 0x29, 0x1E}, // '9' + {0x00, 0x00, 0x6C, 0x6C, 0x00, 0x00}, // ':' + {0x00, 0x40, 0x6C, 0x2C, 0x00, 0x00}, // ';' + {0x08, 0x14, 0x22, 0x41, 0x00, 0x00}, // '<' + {0x14, 0x14, 0x14, 0x14, 0x14, 0x00}, // '=' + {0x00, 0x41, 0x22, 0x14, 0x08, 0x00}, // '>' + {0x02, 0x01, 0x51, 0x09, 0x06, 0x00}, // '?' + {0x30, 0x4A, 0x4A, 0x52, 0x3C, 0x00}, // '@' + {0x7E, 0x09, 0x09, 0x09, 0x09, 0x7E}, // 'A' + {0x7F, 0x49, 0x49, 0x49, 0x49, 0x36}, // 'B' + {0x3E, 0x41, 0x41, 0x41, 0x41, 0x22}, // 'C' + {0x7F, 0x41, 0x41, 0x41, 0x41, 0x3E}, // 'D' + {0x7F, 0x49, 0x49, 0x49, 0x49, 0x41}, // 'E' + {0x7F, 0x09, 0x09, 0x09, 0x09, 0x01}, // 'F' + {0x3E, 0x41, 0x49, 0x49, 0x49, 0x3A}, // 'G' + {0x7F, 0x08, 0x08, 0x08, 0x08, 0x7F}, // 'H' + {0x41, 0x41, 0x7F, 0x41, 0x41, 0x00}, // 'I' + {0x20, 0x41, 0x41, 0x3F, 0x01, 0x01}, // 'J' + {0x7F, 0x08, 0x0C, 0x12, 0x21, 0x40}, // 'K' + {0x7F, 0x40, 0x40, 0x40, 0x40, 0x40}, // 'L' + {0x7F, 0x02, 0x04, 0x04, 0x02, 0x7F}, // 'M' + {0x7F, 0x02, 0x04, 0x08, 0x10, 0x7F}, // 'N' + {0x3E, 0x41, 0x41, 0x41, 0x41, 0x3E}, // 'O' + {0x7F, 0x09, 0x09, 0x09, 0x09, 0x06}, // 'P' + {0x3E, 0x41, 0x51, 0x61, 0x41, 0x3E}, // 'Q' + {0x7F, 0x09, 0x09, 0x19, 0x29, 0x46}, // 'R' + {0x26, 0x49, 0x49, 0x49, 0x49, 0x32}, // 'S' + {0x01, 0x01, 0x7F, 0x01, 0x01, 0x00}, // 'T' + {0x3F, 0x40, 0x40, 0x40, 0x40, 0x3F}, // 'U' + {0x07, 0x38, 0x40, 0x40, 0x38, 0x07}, // 'V' + {0x3F, 0x40, 0x30, 0x30, 0x40, 0x3F}, // 'W' + {0x63, 0x14, 0x08, 0x08, 0x14, 0x63}, // 'X' + {0x07, 0x08, 0x70, 0x08, 0x07, 0x00}, // 'Y' + {0x61, 0x51, 0x49, 0x45, 0x43, 0x41}, // 'Z' + {0x00, 0x7F, 0x41, 0x41, 0x00, 0x00}, // '[' + {0x01, 0x02, 0x04, 0x08, 0x10, 0x60}, // '"\' + {0x00, 0x00, 0x41, 0x41, 0x7F, 0x00}, // ']' + {0x04, 0x02, 0x01, 0x02, 0x04, 0x00}, // '^' + {0x40, 0x40, 0x40, 0x40, 0x40, 0x40}, // '_' + {0x00, 0x03, 0x07, 0x06, 0x00, 0x00}, // '`' + {0x20, 0x54, 0x54, 0x54, 0x78, 0x00}, // 'a' + {0x7F, 0x44, 0x44, 0x44, 0x38, 0x00}, // 'b' + {0x38, 0x44, 0x44, 0x44, 0x28, 0x00}, // 'c' + {0x38, 0x44, 0x44, 0x44, 0x7F, 0x00}, // 'd' + {0x38, 0x54, 0x54, 0x54, 0x48, 0x00}, // 'e' + {0x7C, 0x0A, 0x0A, 0x0A, 0x02, 0x00}, // 'f' + {0x58, 0x54, 0x54, 0x54, 0x3C, 0x00}, // 'g' + {0x7F, 0x04, 0x04, 0x04, 0x78, 0x00}, // 'h' + {0x00, 0x00, 0x7A, 0x00, 0x00, 0x00}, // 'i' + {0x20, 0x40, 0x40, 0x3D, 0x00, 0x00}, // 'j' + {0x00, 0x7F, 0x10, 0x28, 0x44, 0x00}, // 'k' + {0x00, 0x00, 0x3F, 0x40, 0x00, 0x00}, // 'l' + {0x7C, 0x08, 0x10, 0x10, 0x08, 0x7C}, // 'm' + {0x7C, 0x04, 0x04, 0x04, 0x78, 0x00}, // 'n' + {0x38, 0x44, 0x44, 0x44, 0x38, 0x00}, // 'o' + {0x7C, 0x14, 0x14, 0x14, 0x08, 0x00}, // 'p' + {0x08, 0x14, 0x14, 0x14, 0x7C, 0x40}, // 'q' + {0x7C, 0x04, 0x04, 0x04, 0x08, 0x00}, // 'r' + {0x08, 0x54, 0x54, 0x54, 0x20, 0x00}, // 's' + {0x3F, 0x44, 0x44, 0x44, 0x40, 0x00}, // 't' + {0x3C, 0x40, 0x40, 0x40, 0x3C, 0x00}, // 'u' + {0x0C, 0x30, 0x40, 0x30, 0x0C, 0x00}, // 'v' + {0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00}, // 'w' + {0x44, 0x28, 0x10, 0x28, 0x44, 0x00}, // 'x' + {0x0C, 0x50, 0x50, 0x50, 0x3C, 0x00}, // 'y' + {0x44, 0x64, 0x54, 0x4C, 0x44, 0x00}, // 'z' + {0x08, 0x36, 0x41, 0x00, 0x00, 0x00}, // '{' + {0x00, 0x00, 0x7F, 0x00, 0x00, 0x00}, // '|' + {0x00, 0x00, 0x41, 0x36, 0x08, 0x00}, // '}' + {0x04, 0x02, 0x04, 0x08, 0x04, 0x00} // '->' }; + +#ifdef ENABLE_SMALL_BOLD + const uint8_t gFontSmallBold[95][7] = + { + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + {0x00, 0x00, 0x5E, 0x5E, 0x00, 0x00}, + {0x06, 0x06, 0x00, 0x06, 0x06, 0x00}, + {0x14, 0x3E, 0x14, 0x3E, 0x14, 0x00}, + {0x2E, 0x6B, 0x7F, 0x6B, 0x3A, 0x00}, + {0x63, 0x33, 0x18, 0x0C, 0x66, 0x63}, + {0x30, 0x4B, 0x4D, 0x55, 0x22, 0x50}, + {0x00, 0x00, 0x07, 0x07, 0x00, 0x00}, + {0x00, 0x1C, 0x3E, 0x63, 0x41, 0x00}, + {0x00, 0x41, 0x63, 0x3E, 0x1C, 0x00}, + {0x00, 0x2A, 0x1C, 0x1C, 0x2A, 0x00}, + {0x18, 0x18, 0x7E, 0x7E, 0x18, 0x18}, + {0x00, 0x40, 0x60, 0x20, 0x00, 0x00}, + {0x00, 0x18, 0x18, 0x18, 0x18, 0x00}, + {0x00, 0x00, 0x60, 0x60, 0x00, 0x00}, + {0x60, 0x30, 0x18, 0x0C, 0x06, 0x03}, + {0x3E, 0x7F, 0x63, 0x63, 0x7F, 0x3E}, + {0x64, 0x66, 0x7F, 0x7F, 0x60, 0x60}, + {0x62, 0x73, 0x7B, 0x7B, 0x6F, 0x66}, + {0x63, 0x63, 0x6B, 0x6B, 0x7F, 0x36}, + {0x38, 0x3C, 0x36, 0x7F, 0x7F, 0x30}, + {0x6F, 0x6F, 0x6B, 0x6B, 0x7B, 0x33}, + {0x3E, 0x7F, 0x6B, 0x6B, 0x7B, 0x32}, + {0x03, 0x03, 0x73, 0x7B, 0x0F, 0x07}, + {0x36, 0x7F, 0x6B, 0x6B, 0x7F, 0x36}, + {0x06, 0x6F, 0x6B, 0x6B, 0x7F, 0x3E}, + {0x00, 0x00, 0x6C, 0x6C, 0x00, 0x00}, + {0x00, 0x40, 0x6C, 0x2C, 0x00, 0x00}, + {0x08, 0x14, 0x22, 0x41, 0x00, 0x00}, + {0x36, 0x36, 0x36, 0x36, 0x36, 0x00}, + {0x00, 0x41, 0x22, 0x14, 0x08, 0x00}, + {0x06, 0x07, 0x53, 0x5B, 0x1F, 0x0E}, + {0x30, 0x7B, 0x6B, 0x7B, 0x7F, 0x3E}, + {0x7E, 0x7F, 0x1B, 0x1B, 0x7F, 0x7E}, + {0x7F, 0x7F, 0x6B, 0x6B, 0x7F, 0x36}, + {0x3E, 0x7F, 0x63, 0x63, 0x63, 0x36}, + {0x7F, 0x7F, 0x63, 0x63, 0x7F, 0x3E}, + {0x7F, 0x7F, 0x6B, 0x6B, 0x6B, 0x63}, + {0x7F, 0x7F, 0x1B, 0x1B, 0x1B, 0x03}, + {0x3E, 0x7F, 0x63, 0x6B, 0x7B, 0x3A}, + {0x7F, 0x7F, 0x0C, 0x0C, 0x7F, 0x7F}, + {0x63, 0x63, 0x7F, 0x7F, 0x63, 0x63}, + {0x30, 0x73, 0x63, 0x7F, 0x3F, 0x03}, + {0x7F, 0x7F, 0x1C, 0x36, 0x63, 0x41}, + {0x7F, 0x7F, 0x60, 0x60, 0x60, 0x60}, + {0x7F, 0x7F, 0x06, 0x06, 0x7F, 0x7F}, + {0x7F, 0x7F, 0x0C, 0x18, 0x7F, 0x7F}, + {0x3E, 0x7F, 0x63, 0x63, 0x7F, 0x3E}, + {0x7F, 0x7F, 0x1B, 0x1B, 0x1F, 0x0E}, + {0x3E, 0x7F, 0x63, 0x73, 0x7F, 0x7E}, + {0x7F, 0x7F, 0x1B, 0x3B, 0x7F, 0x66}, + {0x66, 0x6F, 0x6B, 0x6B, 0x7B, 0x33}, + {0x03, 0x03, 0x7F, 0x7F, 0x03, 0x03}, + {0x3F, 0x7F, 0x60, 0x60, 0x7F, 0x3F}, + {0x1F, 0x3F, 0x60, 0x60, 0x3F, 0x1F}, + {0x3F, 0x7F, 0x30, 0x30, 0x7F, 0x3F}, + {0x63, 0x77, 0x1C, 0x1C, 0x77, 0x63}, + {0x07, 0x0F, 0x78, 0x78, 0x0F, 0x07}, + {0x63, 0x73, 0x7B, 0x6F, 0x67, 0x63}, + {0x00, 0x7F, 0x7F, 0x63, 0x63, 0x00}, + {0x01, 0x02, 0x04, 0x08, 0x10, 0x60}, + {0x00, 0x63, 0x63, 0x7F, 0x7F, 0x00}, + {0x0C, 0x0E, 0x03, 0x03, 0x0E, 0x0C}, + {0x60, 0x60, 0x60, 0x60, 0x60, 0x60}, + {0x00, 0x03, 0x07, 0x06, 0x00, 0x00}, + {0x20, 0x76, 0x56, 0x56, 0x7E, 0x3C}, + {0x7F, 0x7F, 0x6C, 0x6C, 0x7C, 0x38}, + {0x3C, 0x7E, 0x66, 0x66, 0x66, 0x24}, + {0x38, 0x7C, 0x6C, 0x6C, 0x7F, 0x7F}, + {0x3C, 0x7E, 0x56, 0x56, 0x5E, 0x0C}, + {0x7C, 0x7E, 0x36, 0x36, 0x06, 0x00}, + {0x0C, 0x5E, 0x56, 0x56, 0x7E, 0x3C}, + {0x7F, 0x7F, 0x0C, 0x0C, 0x7C, 0x78}, + {0x00, 0x00, 0x7A, 0x7A, 0x00, 0x00}, + {0x30, 0x60, 0x60, 0x7D, 0x3D, 0x00}, + {0x7F, 0x7F, 0x18, 0x3C, 0x7E, 0x66}, + {0x00, 0x3F, 0x7F, 0x40, 0x00, 0x00}, + {0x7C, 0x7C, 0x18, 0x18, 0x7C, 0x7C}, + {0x7C, 0x7C, 0x0C, 0x0C, 0x7C, 0x78}, + {0x3C, 0x7E, 0x66, 0x66, 0x7E, 0x3C}, + {0x7E, 0x7E, 0x36, 0x36, 0x3E, 0x1C}, + {0x1C, 0x3E, 0x36, 0x3E, 0x7E, 0x40}, + {0x7C, 0x7C, 0x0C, 0x0C, 0x18, 0x00}, + {0x4C, 0x5E, 0x56, 0x56, 0x76, 0x20}, + {0x3F, 0x7F, 0x6C, 0x6C, 0x60, 0x00}, + {0x3C, 0x7C, 0x60, 0x60, 0x7C, 0x3C}, + {0x0C, 0x3C, 0x70, 0x70, 0x3C, 0x0C}, + {0x3C, 0x7C, 0x30, 0x30, 0x7C, 0x3C}, + {0x44, 0x6C, 0x38, 0x38, 0x6C, 0x44}, + {0x06, 0x6E, 0x6C, 0x6C, 0x7E, 0x3E}, + {0x66, 0x76, 0x7E, 0x6E, 0x66, 0x00}, + {0x08, 0x3E, 0x77, 0x41, 0x00, 0x00}, + {0x00, 0x00, 0x7F, 0x00, 0x00, 0x00}, + {0x00, 0x41, 0x77, 0x3E, 0x08, 0x00}, + {0x0C, 0x06, 0x0C, 0x18, 0x0C, 0x00}, + }; +#endif \ No newline at end of file diff --git a/font.h b/font.h index 75d1d47..e548d7f 100644 --- a/font.h +++ b/font.h @@ -24,6 +24,9 @@ extern const uint8_t gFontBig[95][15]; extern const uint8_t gFontBigDigits[11][26]; //extern const uint8_t gFontSmallDigits[11][7]; extern const uint8_t gFontSmall[95][7]; +#ifdef ENABLE_SMALL_BOLD + extern const uint8_t gFontSmallBold[95][7]; +#endif #endif diff --git a/ui/helper.c b/ui/helper.c index aa2794b..a2423db 100644 --- a/ui/helper.c +++ b/ui/helper.c @@ -91,7 +91,7 @@ void UI_PrintStringSmall(const char *pString, uint8_t Start, uint8_t End, uint8_ Start += (((End - Start) - (Length * 8)) + 1) / 2; const unsigned int char_width = ARRAY_SIZE(gFontSmall[0]); - const unsigned int char_spacing = char_width + 0; + const unsigned int char_spacing = char_width + 1; uint8_t *pFb = gFrameBuffer[Line] + Start; for (i = 0; i < Length; i++) { @@ -99,23 +99,47 @@ 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(gFontSmall)) - memmove(pFb + (i * char_spacing), &gFontSmall[index], char_width); + memmove(pFb + (i * char_spacing) + 1, &gFontSmall[index], char_width); } } } +#ifdef ENABLE_SMALL_BOLD + void UI_PrintStringSmallBold(const char *pString, uint8_t Start, uint8_t End, uint8_t Line) + { + const size_t Length = strlen(pString); + size_t i; + + if (End > Start) + Start += (((End - Start) - (Length * 8)) + 1) / 2; + + const unsigned int char_width = ARRAY_SIZE(gFontSmallBold[0]); + const unsigned int char_spacing = char_width + 1; + uint8_t *pFb = gFrameBuffer[Line] + Start; + for (i = 0; i < Length; i++) + { + if (pString[i] >= 32) + { + const unsigned int index = (unsigned int)pString[i] - 32; + if (index < ARRAY_SIZE(gFontSmallBold)) + memmove(pFb + (i * char_spacing) + 1, &gFontSmallBold[index], char_width); + } + } + } +#endif + void UI_PrintStringSmallBuffer(const char *pString, uint8_t *buffer) { size_t i; const unsigned int char_width = ARRAY_SIZE(gFontSmall[0]); - const unsigned int char_spacing = char_width + 0; + const unsigned int char_spacing = char_width + 1; for (i = 0; i < strlen(pString); i++) { if (pString[i] >= 32) { const unsigned int index = (unsigned int)pString[i] - 32; if (index < ARRAY_SIZE(gFontSmall)) - memmove(buffer + (i * char_spacing), &gFontSmall[index], char_width); + memmove(buffer + (i * char_spacing) + 1, &gFontSmall[index], char_width); } } } diff --git a/ui/helper.h b/ui/helper.h index 3a93d84..87eb686 100644 --- a/ui/helper.h +++ b/ui/helper.h @@ -24,6 +24,9 @@ void UI_GenerateChannelString(char *pString, const uint8_t Channel); void UI_GenerateChannelStringEx(char *pString, const bool bShowPrefix, const uint8_t ChannelNumber); void UI_PrintString(const char *pString, uint8_t Start, uint8_t End, uint8_t Line, uint8_t Width); void UI_PrintStringSmall(const char *pString, uint8_t Start, uint8_t End, uint8_t Line); +#ifdef ENABLE_SMALL_BOLD + void UI_PrintStringSmallBold(const char *pString, uint8_t Start, uint8_t End, uint8_t Line); +#endif void UI_PrintStringSmallBuffer(const char *pString, uint8_t *buffer); void UI_DisplayFrequency(const char *pDigits, uint8_t X, uint8_t Y, bool bDisplayLeadingZero, bool bFlag); void UI_DisplayFrequencySmall(const char *pDigits, uint8_t X, uint8_t Y, bool bDisplayLeadingZero); diff --git a/ui/main.c b/ui/main.c index 3b88e2b..5897069 100644 --- a/ui/main.c +++ b/ui/main.c @@ -340,7 +340,12 @@ void UI_DisplayMain(void) } else { - UI_PrintStringSmall(String, 32 + 4, 0, Line); + #ifdef ENABLE_SMALL_BOLD + UI_PrintStringSmallBold(String, 32 + 4, 0, Line); + #else + UI_PrintStringSmall(String, 32 + 4, 0, Line); + #endif + // show the channel frequency below the channel number/name sprintf(String, "%03u.%05u", frequency / 100000, frequency % 100000); UI_PrintStringSmall(String, 32 + 4, 0, Line + 1); diff --git a/version.c b/version.c index d94235f..78c896d 100644 --- a/version.c +++ b/version.c @@ -2,7 +2,7 @@ #ifdef GIT_HASH #define VER GIT_HASH #else - #define VER "230923" + #define VER "230924" #endif const char Version[] = "OEFW-"VER;