From 8aafba846d71479065c6fdfa2680f2607ccf33dc Mon Sep 17 00:00:00 2001 From: OneOfEleven Date: Tue, 19 Sep 2023 10:57:14 +0100 Subject: [PATCH] Added mirror battery symbol compile option --- Makefile | 4 + README.md | 1 + bitmaps.c | 317 +++++++++++++++++++++++++++++--------------- firmware | Bin 165592 -> 165592 bytes firmware.bin | Bin 49692 -> 49692 bytes firmware.packed.bin | Bin 49710 -> 49710 bytes 6 files changed, 218 insertions(+), 104 deletions(-) diff --git a/Makefile b/Makefile index d77aa07..298f113 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,7 @@ ENABLE_MAIN_KEY_HOLD := 1 ENABLE_BOOT_BEEPS := 0 ENABLE_COMPANDER := 1 ENABLE_SHOW_CHARGE_LEVEL := 1 +ENABLE_REVERSE_BAT_SYMBOL := 1 ENABLE_STATUSBAR_VOLTAGE := 0 ENABLE_STATUSBAR_PERCENTAGE := 1 #ENABLE_SINGLE_VFO_CHAN := 1 @@ -194,6 +195,9 @@ endif ifeq ($(ENABLE_SHOW_CHARGE_LEVEL),1) CFLAGS += -DENABLE_SHOW_CHARGE_LEVEL endif +ifeq ($(ENABLE_REVERSE_BAT_SYMBOL),1) + CFLAGS += -DENABLE_REVERSE_BAT_SYMBOL +endif ifeq ($(ENABLE_STATUSBAR_VOLTAGE),1) CFLAGS += -DENABLE_STATUSBAR_VOLTAGE endif diff --git a/README.md b/README.md index 78569f1..6605113 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ ENABLE_MAIN_KEY_HOLD := 1 initial F-key press not needed, instead ENABLE_BOOT_BEEPS := 0 give user audio feedback on volume knob position at boot-up ENABLE_COMPANDER := 1 compander option - setting not yet saved ENABLE_SHOW_CHARGE_LEVEL := 1 show the charge level when the radio is on charge +ENABLE_REVERSE_BAT_SYMBOL := 1 reverse the battery symbol on the status bar ENABLE_STATUSBAR_VOLTAGE := 0 show the battery voltage on the top status bar - when possible ENABLE_STATUSBAR_PERCENTAGE := 1 show the battery percentage on the top status bar - when possible #ENABLE_SINGLE_VFO_CHAN := 1 not yet implemented - single VFO on display when possible diff --git a/bitmaps.c b/bitmaps.c index fea3feb..02991ce 100644 --- a/bitmaps.c +++ b/bitmaps.c @@ -29,110 +29,219 @@ const uint8_t BITMAP_PowerSave[8] = #endif }; -const uint8_t BITMAP_BatteryLevel1[17] = -{ - 0b00000000, - 0b00111110, - 0b00100010, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01111111 -}; - -const uint8_t BITMAP_BatteryLevel2[17] = -{ - 0b00000000, - 0b00111110, - 0b00100010, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01011101, - 0b01011101, - 0b01000001, - 0b01111111 -}; - -const uint8_t BITMAP_BatteryLevel3[17] = -{ - 0b00000000, - 0b00111110, - 0b00100010, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01011101, - 0b01011101, - 0b01000001, - 0b01011101, - 0b01011101, - 0b01000001, - 0b01111111 -}; - -const uint8_t BITMAP_BatteryLevel4[17] = -{ - 0b00000000, - 0b00111110, - 0b00100010, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01000001, - 0b01011101, - 0b01011101, - 0b01000001, - 0b01011101, - 0b01011101, - 0b01000001, - 0b01011101, - 0b01011101, - 0b01000001, - 0b01111111 -}; - -const uint8_t BITMAP_BatteryLevel5[17] = -{ - 0b00000000, - 0b00111110, - 0b00100010, - 0b01000001, - 0b01011101, - 0b01011101, - 0b01000001, - 0b01011101, - 0b01011101, - 0b01000001, - 0b01011101, - 0b01011101, - 0b01000001, - 0b01011101, - 0b01011101, - 0b01000001, - 0b01111111 -}; +#ifndef ENABLE_REVERSE_BAT_SYMBOL + // Quansheng way (+ pole to the left) + const uint8_t BITMAP_BatteryLevel1[17] = + { + 0b00000000, + 0b00111110, + 0b00100010, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01111111 + }; + + const uint8_t BITMAP_BatteryLevel2[17] = + { + 0b00000000, + 0b00111110, + 0b00100010, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01011101, + 0b01011101, + 0b01000001, + 0b01111111 + }; + + const uint8_t BITMAP_BatteryLevel3[17] = + { + 0b00000000, + 0b00111110, + 0b00100010, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01011101, + 0b01011101, + 0b01000001, + 0b01011101, + 0b01011101, + 0b01000001, + 0b01111111 + }; + + const uint8_t BITMAP_BatteryLevel4[17] = + { + 0b00000000, + 0b00111110, + 0b00100010, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01011101, + 0b01011101, + 0b01000001, + 0b01011101, + 0b01011101, + 0b01000001, + 0b01011101, + 0b01011101, + 0b01000001, + 0b01111111 + }; + + const uint8_t BITMAP_BatteryLevel5[17] = + { + 0b00000000, + 0b00111110, + 0b00100010, + 0b01000001, + 0b01011101, + 0b01011101, + 0b01000001, + 0b01011101, + 0b01011101, + 0b01000001, + 0b01011101, + 0b01011101, + 0b01000001, + 0b01011101, + 0b01011101, + 0b01000001, + 0b01111111 + }; +#else + // reversed (+ pole to the right) + const uint8_t BITMAP_BatteryLevel1[17] = + { + 0b00000000, + 0b01111111, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b00100010, + 0b00111110 + }; + + const uint8_t BITMAP_BatteryLevel2[17] = + { + 0b00000000, + 0b01111111, + 0b01000001, + 0b01011101, + 0b01011101, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b00100010, + 0b00111110 + }; + + const uint8_t BITMAP_BatteryLevel3[17] = + { + 0b00000000, + 0b01111111, + 0b01000001, + 0b01011101, + 0b01011101, + 0b01000001, + 0b01011101, + 0b01011101, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b00100010, + 0b00111110 + }; + + const uint8_t BITMAP_BatteryLevel4[17] = + { + 0b00000000, + 0b01111111, + 0b01000001, + 0b01011101, + 0b01011101, + 0b01000001, + 0b01011101, + 0b01011101, + 0b01000001, + 0b01011101, + 0b01011101, + 0b01000001, + 0b01000001, + 0b01000001, + 0b01000001, + 0b00100010, + 0b00111110 + }; + + const uint8_t BITMAP_BatteryLevel5[17] = + { + 0b00000000, + 0b01111111, + 0b01000001, + 0b01011101, + 0b01011101, + 0b01000001, + 0b01011101, + 0b01011101, + 0b01000001, + 0b01011101, + 0b01011101, + 0b01000001, + 0b01011101, + 0b01011101, + 0b01000001, + 0b00100010, + 0b00111110 + }; +#endif const uint8_t BITMAP_USB_C[9] = { // USB symbol diff --git a/firmware b/firmware index d9e718838691c6cc48c0a644f46260a0ed50de9b..953273163131d6b872bee9570c8518f190dda84f 100644 GIT binary patch delta 131 zcmcc7%XOodt6>Xc_1chn$Jkf|QnF(}5^!{ML=ph_1v Yv}6NwUM>cISGRCoD0h4R9!Aeo0JUK!*8l(j delta 131 zcmcc7%XOodt6>Xc_1X|SCCAuU1gd8M3IG9I3?={bIX?%eab9%*?IoAUv1=oCg-ze17dJJ~4Ak^R#3G Ub6ze6e^<9~T_|^R|DIk}0Nx}fF8}}l delta 127 zcmbQ!!aS#ic|-Nu5IZHu*jNOrX8;NS0bC3w02f0NfQX?A0LAJzpI^I*Pt44~GS$=| UjhBnT-_OV diff --git a/firmware.packed.bin b/firmware.packed.bin index 05400ab30bd0d469918135f56dcd6265d438cfb9..8a0cd052759b64361327bc92c086dee56393c4a0 100644 GIT binary patch delta 130 zcmV-|0Db?igafXG1F(y&RHQDx5j}+$m)32qc)bn#K7YWX30SCS$|~(MO}g+~!1uu^ z2DIm}AL}L_PS>`GeWoQQo)2a+C#T^n@&1S8F?*OMo>*HF8ZhwHUs delta 130 zcmV-|0Db?igafXG1F(y&ROL;g5h0lui^^@WWW5oXe}93&6-20e$~N&cQM&9$qqf0l zWvKhG1NSB#Qp>iKVZ~%7-)wp=C#T^n@&1S8Eob{@o*6h28ZhwHUsYk2*2HzHa?N__IU0)7GP9q&jRgXlc8MN9%m4rY