From 80c44862d2adf492fc51c890735cb7062c59544d Mon Sep 17 00:00:00 2001 From: "Dennis Real (DL9CAT)" Date: Sat, 5 Oct 2019 17:33:41 +0200 Subject: [PATCH] feat: Removed tiny font to free flash space --- Font5x7.c | 2150 ----------------------------------------------------- Makefile | 2 +- ili9341.c | 27 +- nanovna.h | 4 +- plot.c | 47 +- ui.c | 6 +- 6 files changed, 36 insertions(+), 2200 deletions(-) delete mode 100644 Font5x7.c diff --git a/Font5x7.c b/Font5x7.c deleted file mode 100644 index c46256a..0000000 --- a/Font5x7.c +++ /dev/null @@ -1,2150 +0,0 @@ -/* Generated by convbdf on Tue Oct 3 00:24:24 MDT 2000. */ -/* Font information: - name: "-Misc-Fixed-Medium-R-Normal--7-70-75-75-C-50-ISO8859-1" - pixel size: 7 - ascent: 6 - descent: 1 -*/ - -#include - -/* Font character bitmap data. */ -const uint8_t x5x7_bits [] = -{ - /* Character (0x00): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |**** | - |**** | - |**** | - |**** | - |**** | - |**** | - | | - +--------+ */ - 0xf0, - 0xf0, - 0xf0, - 0xf0, - 0xf0, - 0xf0, - 0x00, - - - /* Character (0x01): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | * | - | *** | - |***** | - | *** | - | * | - | | - +--------+ */ - 0x00, - 0x20, - 0x70, - 0xf8, - 0x70, - 0x20, - 0x00, - - /* Character (0x02): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | * * | - |* * | - | * * | - |* * | - | * * | - |* * | - | | - +--------+ */ - 0x50, - 0xa0, - 0x50, - 0xa0, - 0x50, - 0xa0, - 0x00, - - /* Character (): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | * | - | * | - |**** | - | * | - | * | - | | - | | - +--------+ */ - 0x20, - 0x40, - 0xF8, - 0x40, - 0x20, - 0x00, - 0x00, - - /* Character (): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | * | - | * | - |***** | - | * | - | * | - | | - | | - +--------+ */ - 0x20, - 0x10, - 0xF8, - 0x10, - 0x20, - 0x00, - 0x00, - - /* Character (): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - |***** | - | * * | - | * * | - |* ** | - | | - +--------+ */ - 0x00, - 0x00, - 0xf8, - 0x50, - 0x50, - 0x98, - 0x00, - - /* Character (): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - |* * | - |* * | - |* * | - |*** | - |* | - +--------+ */ - 0x00, - 0x00, - 0x90, - 0x90, - 0x90, - 0xe0, - 0x80, - - /* Character (): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | *** | - |* * | - |* * | - | * * | - |** ** | - | | - +--------+ */ - 0x00, - 0x70, - 0x88, - 0x88, - 0x50, - 0xb8, - 0x00, - - /* Character (): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | ** | - |* * | - |* * | - | ** | - | | - | | - | | - +--------+ */ - 0x60, - 0x90, - 0x90, - 0x60, - 0x00, - 0x00, - 0x00, - - /* Character (0x20): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - | | - | | - | | - | | - | | - +--------+ */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - - /* Character (0x21): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | * | - | * | - | * | - | * | - | | - | * | - | | - +--------+ */ - 0x20, - 0x20, - 0x20, - 0x20, - 0x00, - 0x20, - 0x00, - - /* Character (0x22): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | * * | - | * * | - | * * | - | | - | | - | | - | | - +--------+ */ - 0x50, - 0x50, - 0x50, - 0x00, - 0x00, - 0x00, - 0x00, - - /* Character (0x23): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | * * | - |***** | - | * * | - |***** | - | * * | - | | - +--------+ */ - 0x00, - 0x50, - 0xf8, - 0x50, - 0xf8, - 0x50, - 0x00, - - /* Character (0x24): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | *** | - |* * | - | *** | - | * * | - | *** | - | | - +--------+ */ - 0x00, - 0x70, - 0xa0, - 0x70, - 0x28, - 0x70, - 0x00, - - /* Character (0x25): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |* | - |* * | - | * | - | * | - |* * | - | * | - | | - +--------+ */ - 0x80, - 0x90, - 0x20, - 0x40, - 0x90, - 0x10, - 0x00, - - /* Character (0x26): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | * | - |* * | - | * | - |* * | - | * * | - | | - +--------+ */ - 0x00, - 0x40, - 0xa0, - 0x40, - 0xa0, - 0x50, - 0x00, - - /* Character (0x27): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | ** | - | * | - |* | - | | - | | - | | - | | - +--------+ */ - 0x60, - 0x40, - 0x80, - 0x00, - 0x00, - 0x00, - 0x00, - - /* Character (0x28): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | * | - | * | - | * | - | * | - | * | - | * | - | | - +--------+ */ - 0x20, - 0x40, - 0x40, - 0x40, - 0x40, - 0x20, - 0x00, - - /* Character (0x29): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | * | - | * | - | * | - | * | - | * | - | * | - | | - +--------+ */ - 0x40, - 0x20, - 0x20, - 0x20, - 0x20, - 0x40, - 0x00, - - /* Character (0x2a): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - |* * | - | * | - |*** | - | * | - |* * | - | | - +--------+ */ - 0x00, - 0xa0, - 0x40, - 0xe0, - 0x40, - 0xa0, - 0x00, - - /* Character (0x2b): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | * | - | * | - |***** | - | * | - | * | - | | - +--------+ */ - 0x00, - 0x20, - 0x20, - 0xf8, - 0x20, - 0x20, - 0x00, - - /* Character (0x2c): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - | | - | | - | ** | - | * | - |* | - +--------+ */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x60, - 0x40, - 0x80, - - /* Character (0x2d): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - | | - |**** | - | | - | | - | | - +--------+ */ - 0x00, - 0x00, - 0x00, - 0xf0, - 0x00, - 0x00, - 0x00, - - /* Character (0x2e): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - | | - | | - | ** | - | ** | - | | - +--------+ */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x60, - 0x60, - 0x00, - - /* Character (0x2f): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | * | - | * | - | * | - |* | - | | - | | - +--------+ */ - 0x00, - 0x10, - 0x20, - 0x40, - 0x80, - 0x00, - 0x00, - - /* Character (0x30): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | ** | - |* * | - |* ** | - |** * | - |* * | - | ** | - | | - +--------+ */ - 0x60, - 0x90, - 0xb0, - 0xd0, - 0x90, - 0x60, - 0x00, - - /* Character (0x31): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | * | - |** | - | * | - | * | - | * | - |*** | - | | - +--------+ */ - 0x40, - 0xc0, - 0x40, - 0x40, - 0x40, - 0xe0, - 0x00, - - /* Character (0x32): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | ** | - |* * | - | * | - | * | - | * | - |**** | - | | - +--------+ */ - 0x60, - 0x90, - 0x10, - 0x20, - 0x40, - 0xf0, - 0x00, - - /* Character (0x33): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |**** | - | * | - | ** | - | * | - |* * | - | ** | - | | - +--------+ */ - 0xf0, - 0x10, - 0x60, - 0x10, - 0x90, - 0x60, - 0x00, - - /* Character (0x34): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | * | - | ** | - |* * | - |**** | - | * | - | * | - | | - +--------+ */ - 0x20, - 0x60, - 0xa0, - 0xf0, - 0x20, - 0x20, - 0x00, - - /* Character (0x35): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |**** | - |* | - |*** | - | * | - |* * | - | ** | - | | - +--------+ */ - 0xf0, - 0x80, - 0xe0, - 0x10, - 0x90, - 0x60, - 0x00, - - /* Character (0x36): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | ** | - |* | - |*** | - |* * | - |* * | - | ** | - | | - +--------+ */ - 0x60, - 0x80, - 0xe0, - 0x90, - 0x90, - 0x60, - 0x00, - - /* Character (0x37): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |**** | - | * | - | * | - | * | - | * | - | * | - | | - +--------+ */ - 0xf0, - 0x10, - 0x20, - 0x20, - 0x40, - 0x40, - 0x00, - - /* Character (0x38): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | ** | - |* * | - | ** | - |* * | - |* * | - | ** | - | | - +--------+ */ - 0x60, - 0x90, - 0x60, - 0x90, - 0x90, - 0x60, - 0x00, - - /* Character (0x39): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | ** | - |* * | - |* * | - | *** | - | * | - | ** | - | | - +--------+ */ - 0x60, - 0x90, - 0x90, - 0x70, - 0x10, - 0x60, - 0x00, - - /* Character (0x3a): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | ** | - | ** | - | | - | ** | - | ** | - | | - +--------+ */ - 0x00, - 0x60, - 0x60, - 0x00, - 0x60, - 0x60, - 0x00, - - /* Character (0x3b): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | ** | - | ** | - | | - | ** | - | * | - |* | - +--------+ */ - 0x00, - 0x60, - 0x60, - 0x00, - 0x60, - 0x40, - 0x80, - - /* Character (0x3c): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | * | - | * | - |* | - | * | - | * | - | | - +--------+ */ - 0x00, - 0x20, - 0x40, - 0x80, - 0x40, - 0x20, - 0x00, - - /* Character (0x3d): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - |**** | - | | - |**** | - | | - | | - +--------+ */ - 0x00, - 0x00, - 0xf0, - 0x00, - 0xf0, - 0x00, - 0x00, - - /* Character (0x3e): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - |* | - | * | - | * | - | * | - |* | - | | - +--------+ */ - 0x00, - 0x80, - 0x40, - 0x20, - 0x40, - 0x80, - 0x00, - - /* Character (0x3f): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | * | - |* * | - | * | - | * | - | | - | * | - | | - +--------+ */ - 0x40, - 0xa0, - 0x20, - 0x40, - 0x00, - 0x40, - 0x00, - - /* Character (0x40): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | ** | - |* * | - |* ** | - |* ** | - |* | - | ** | - | | - +--------+ */ - 0x60, - 0x90, - 0xb0, - 0xb0, - 0x80, - 0x60, - 0x00, - - /* Character (0x41): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | ** | - |* * | - |* * | - |**** | - |* * | - |* * | - | | - +--------+ */ - 0x60, - 0x90, - 0x90, - 0xf0, - 0x90, - 0x90, - 0x00, - - /* Character (0x42): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |*** | - |* * | - |*** | - |* * | - |* * | - |*** | - | | - +--------+ */ - 0xe0, - 0x90, - 0xe0, - 0x90, - 0x90, - 0xe0, - 0x00, - - /* Character (0x43): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | ** | - |* * | - |* | - |* | - |* * | - | ** | - | | - +--------+ */ - 0x60, - 0x90, - 0x80, - 0x80, - 0x90, - 0x60, - 0x00, - - /* Character (0x44): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |*** | - |* * | - |* * | - |* * | - |* * | - |*** | - | | - +--------+ */ - 0xe0, - 0x90, - 0x90, - 0x90, - 0x90, - 0xe0, - 0x00, - - /* Character (0x45): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |**** | - |* | - |*** | - |* | - |* | - |**** | - | | - +--------+ */ - 0xf0, - 0x80, - 0xe0, - 0x80, - 0x80, - 0xf0, - 0x00, - - /* Character (0x46): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |**** | - |* | - |*** | - |* | - |* | - |* | - | | - +--------+ */ - 0xf0, - 0x80, - 0xe0, - 0x80, - 0x80, - 0x80, - 0x00, - - /* Character (0x47): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | ** | - |* * | - |* | - |* ** | - |* * | - | *** | - | | - +--------+ */ - 0x60, - 0x90, - 0x80, - 0xb0, - 0x90, - 0x70, - 0x00, - - /* Character (0x48): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |* * | - |* * | - |**** | - |* * | - |* * | - |* * | - | | - +--------+ */ - 0x90, - 0x90, - 0xf0, - 0x90, - 0x90, - 0x90, - 0x00, - - /* Character (0x49): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |*** | - | * | - | * | - | * | - | * | - |*** | - | | - +--------+ */ - 0xe0, - 0x40, - 0x40, - 0x40, - 0x40, - 0xe0, - 0x00, - - /* Character (0x4a): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | * | - | * | - | * | - | * | - |* * | - | ** | - | | - +--------+ */ - 0x10, - 0x10, - 0x10, - 0x10, - 0x90, - 0x60, - 0x00, - - /* Character (0x4b): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |* * | - |* * | - |** | - |** | - |* * | - |* * | - | | - +--------+ */ - 0x90, - 0xa0, - 0xc0, - 0xc0, - 0xa0, - 0x90, - 0x00, - - /* Character (0x4c): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |* | - |* | - |* | - |* | - |* | - |**** | - | | - +--------+ */ - 0x80, - 0x80, - 0x80, - 0x80, - 0x80, - 0xf0, - 0x00, - - /* Character (0x4d): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |* * | - |**** | - |**** | - |* * | - |* * | - |* * | - | | - +--------+ */ - 0x90, - 0xf0, - 0xf0, - 0x90, - 0x90, - 0x90, - 0x00, - - /* Character (0x4e): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |* * | - |** * | - |** * | - |* ** | - |* ** | - |* * | - | | - +--------+ */ - 0x90, - 0xd0, - 0xd0, - 0xb0, - 0xb0, - 0x90, - 0x00, - - /* Character (0x4f): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | ** | - |* * | - |* * | - |* * | - |* * | - | ** | - | | - +--------+ */ - 0x60, - 0x90, - 0x90, - 0x90, - 0x90, - 0x60, - 0x00, - - /* Character (0x50): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |*** | - |* * | - |* * | - |*** | - |* | - |* | - | | - +--------+ */ - 0xe0, - 0x90, - 0x90, - 0xe0, - 0x80, - 0x80, - 0x00, - - /* Character (0x51): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | ** | - |* * | - |* * | - |* * | - |** * | - | ** | - | * | - +--------+ */ - 0x60, - 0x90, - 0x90, - 0x90, - 0xd0, - 0x60, - 0x10, - - /* Character (0x52): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |*** | - |* * | - |* * | - |*** | - |* * | - |* * | - | | - +--------+ */ - 0xe0, - 0x90, - 0x90, - 0xe0, - 0xa0, - 0x90, - 0x00, - - /* Character (0x53): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | ** | - |* * | - | * | - | * | - |* * | - | ** | - | | - +--------+ */ - 0x60, - 0x90, - 0x40, - 0x20, - 0x90, - 0x60, - 0x00, - - /* Character (0x54): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |*** | - | * | - | * | - | * | - | * | - | * | - | | - +--------+ */ - 0xe0, - 0x40, - 0x40, - 0x40, - 0x40, - 0x40, - 0x00, - - /* Character (0x55): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |* * | - |* * | - |* * | - |* * | - |* * | - | ** | - | | - +--------+ */ - 0x90, - 0x90, - 0x90, - 0x90, - 0x90, - 0x60, - 0x00, - - /* Character (0x56): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |* * | - |* * | - |* * | - |* * | - | ** | - | ** | - | | - +--------+ */ - 0x90, - 0x90, - 0x90, - 0x90, - 0x60, - 0x60, - 0x00, - - /* Character (0x57): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |* * | - |* * | - |* * | - |**** | - |**** | - |* * | - | | - +--------+ */ - 0x90, - 0x90, - 0x90, - 0xf0, - 0xf0, - 0x90, - 0x00, - - /* Character (0x58): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |* * | - |* * | - | ** | - | ** | - |* * | - |* * | - | | - +--------+ */ - 0x90, - 0x90, - 0x60, - 0x60, - 0x90, - 0x90, - 0x00, - - /* Character (0x59): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |* * | - |* * | - |* * | - | * | - | * | - | * | - | | - +--------+ */ - 0xa0, - 0xa0, - 0xa0, - 0x40, - 0x40, - 0x40, - 0x00, - - /* Character (0x5a): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |**** | - | * | - | * | - | * | - |* | - |**** | - | | - +--------+ */ - 0xf0, - 0x10, - 0x20, - 0x40, - 0x80, - 0xf0, - 0x00, - - /* Character (0x5b): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |*** | - |* | - |* | - |* | - |* | - |*** | - | | - +--------+ */ - 0xe0, - 0x80, - 0x80, - 0x80, - 0x80, - 0xe0, - 0x00, - - /* Character (0x5c): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - |* | - | * | - | * | - | * | - | | - | | - +--------+ */ - 0x00, - 0x80, - 0x40, - 0x20, - 0x10, - 0x00, - 0x00, - - /* Character (0x5d): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |*** | - | * | - | * | - | * | - | * | - |*** | - | | - +--------+ */ - 0xe0, - 0x20, - 0x20, - 0x20, - 0x20, - 0xe0, - 0x00, - - /* Character (0x5e): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | * | - |* * | - | | - | | - | | - | | - | | - +--------+ */ - 0x40, - 0xa0, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - - /* Character (0x5f): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - | | - | | - | | - |**** | - | | - +--------+ */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xf0, - 0x00, - - /* Character (0x60): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |** | - | * | - | * | - | | - | | - | | - | | - +--------+ */ - 0xc0, - 0x40, - 0x20, - 0x00, - 0x00, - 0x00, - 0x00, - - /* Character (0x61): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - | *** | - |* * | - |* ** | - | * * | - | | - +--------+ */ - 0x00, - 0x00, - 0x70, - 0x90, - 0xb0, - 0x50, - 0x00, - - /* Character (0x62): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |* | - |* | - |*** | - |* * | - |* * | - |*** | - | | - +--------+ */ - 0x80, - 0x80, - 0xe0, - 0x90, - 0x90, - 0xe0, - 0x00, - - /* Character (0x63): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - | ** | - |* | - |* | - | ** | - | | - +--------+ */ - 0x00, - 0x00, - 0x60, - 0x80, - 0x80, - 0x60, - 0x00, - - /* Character (0x64): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | * | - | * | - | *** | - |* * | - |* * | - | *** | - | | - +--------+ */ - 0x10, - 0x10, - 0x70, - 0x90, - 0x90, - 0x70, - 0x00, - - /* Character (0x65): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - | ** | - |* ** | - |** | - | ** | - | | - +--------+ */ - 0x00, - 0x00, - 0x60, - 0xb0, - 0xc0, - 0x60, - 0x00, - - /* Character (0x66): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | * | - | * * | - | * | - |*** | - | * | - | * | - | | - +--------+ */ - 0x20, - 0x50, - 0x40, - 0xe0, - 0x40, - 0x40, - 0x00, - - /* Character (0x67): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - | *** | - |* * | - | ** | - |* | - | *** | - +--------+ */ - 0x00, - 0x00, - 0x70, - 0x90, - 0x60, - 0x80, - 0x70, - - /* Character (0x68): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |* | - |* | - |*** | - |* * | - |* * | - |* * | - | | - +--------+ */ - 0x80, - 0x80, - 0xe0, - 0x90, - 0x90, - 0x90, - 0x00, - - /* Character (0x69): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | * | - | | - |** | - | * | - | * | - |*** | - | | - +--------+ */ - 0x40, - 0x00, - 0xc0, - 0x40, - 0x40, - 0xe0, - 0x00, - - /* Character (0x6a): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | * | - | | - | * | - | * | - | * | - |* * | - | * | - +--------+ */ - 0x20, - 0x00, - 0x20, - 0x20, - 0x20, - 0xa0, - 0x40, - - /* Character (0x6b): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |* | - |* | - |* * | - |** | - |* * | - |* * | - | | - +--------+ */ - 0x80, - 0x80, - 0xa0, - 0xc0, - 0xa0, - 0x90, - 0x00, - - /* Character (0x6c): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |** | - | * | - | * | - | * | - | * | - |*** | - | | - +--------+ */ - 0xc0, - 0x40, - 0x40, - 0x40, - 0x40, - 0xe0, - 0x00, - - /* Character (0x6d): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - |* * | - |**** | - |* * | - |* * | - | | - +--------+ */ - 0x00, - 0x00, - 0xa0, - 0xf0, - 0x90, - 0x90, - 0x00, - - /* Character (0x6e): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - |*** | - |* * | - |* * | - |* * | - | | - +--------+ */ - 0x00, - 0x00, - 0xe0, - 0x90, - 0x90, - 0x90, - 0x00, - - /* Character (0x6f): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - | ** | - |* * | - |* * | - | ** | - | | - +--------+ */ - 0x00, - 0x00, - 0x60, - 0x90, - 0x90, - 0x60, - 0x00, - - /* Character (0x70): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - |*** | - |* * | - |* * | - |*** | - |* | - +--------+ */ - 0x00, - 0x00, - 0xe0, - 0x90, - 0x90, - 0xe0, - 0x80, - - /* Character (0x71): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - | *** | - |* * | - |* * | - | *** | - | * | - +--------+ */ - 0x00, - 0x00, - 0x70, - 0x90, - 0x90, - 0x70, - 0x10, - - /* Character (0x72): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - |*** | - |* * | - |* | - |* | - | | - +--------+ */ - 0x00, - 0x00, - 0xe0, - 0x90, - 0x80, - 0x80, - 0x00, - - /* Character (0x73): - bbw=6, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - | *** | - |** | - | ** | - |*** | - | | - +--------+ */ - 0x00, - 0x00, - 0x70, - 0xc0, - 0x30, - 0xe0, - 0x00, - - /* Character (0x74): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | * | - | * | - |*** | - | * | - | * | - | ** | - | | - +--------+ */ - 0x40, - 0x40, - 0xe0, - 0x40, - 0x40, - 0x30, - 0x00, - - /* Character (0x75): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - |* * | - |* * | - |* * | - | *** | - | | - +--------+ */ - 0x00, - 0x00, - 0x90, - 0x90, - 0x90, - 0x70, - 0x00, - - /* Character (0x76): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - |* * | - |* * | - |* * | - | * | - | | - +--------+ */ - 0x00, - 0x00, - 0xa0, - 0xa0, - 0xa0, - 0x40, - 0x00, - - /* Character (0x77): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - |* * | - |* * | - |**** | - |**** | - | | - +--------+ */ - 0x00, - 0x00, - 0x90, - 0x90, - 0xf0, - 0xf0, - 0x00, - - /* Character (0x78): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - |* * | - | ** | - | ** | - |* * | - | | - +--------+ */ - 0x00, - 0x00, - 0x90, - 0x60, - 0x60, - 0x90, - 0x00, - - /* Character (0x79): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - |* * | - |* * | - | * * | - | * | - | * | - +--------+ */ - 0x00, - 0x00, - 0x90, - 0x90, - 0x50, - 0x20, - 0x40, - - /* Character (0x7a): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | | - | | - |**** | - | * | - | * | - |**** | - | | - +--------+ */ - 0x00, - 0x00, - 0xf0, - 0x20, - 0x40, - 0xf0, - 0x00, - - /* Character (0x7b): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | * | - | * | - |** | - | * | - | * | - | * | - | | - +--------+ */ - 0x20, - 0x40, - 0xc0, - 0x40, - 0x40, - 0x20, - 0x00, - - /* Character (0x7c): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | * | - | * | - | * | - | * | - | * | - | * | - | | - +--------+ */ - 0x40, - 0x40, - 0x40, - 0x40, - 0x40, - 0x40, - 0x00, - - /* Character (0x7d): - bbw=6, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - |* | - | * | - | ** | - | * | - | * | - |* | - | | - +--------+ */ - 0x80, - 0x40, - 0x60, - 0x40, - 0x40, - 0x80, - 0x00, - - /* Character (0x7e): - bbw=5, bbh=7, bbx=0, bby=-1, width=5 - +--------+ - | * * | - |* * | - | | - | | - | | - | | - | | - +--------+ */ - 0x50, - 0xa0, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, -}; - -#if 0 -/* Character width data. */ -static UNS_8 x5x7_width [] = -{ - 5, /* (0x00) */ - 5, /* (0x01) */ - 5, /* (0x02) */ - 5, /* (0x03) */ - 5, /* (0x04) */ - 5, /* (0x05) */ - 5, /* (0x06) */ - 5, /* (0x07) */ - 5, /* (0x08) */ - 5, /* (0x09) */ - 5, /* (0x0a) */ - 5, /* (0x0b) */ - 5, /* (0x0c) */ - 5, /* (0x0d) */ - 5, /* (0x0e) */ - 5, /* (0x0f) */ - 5, /* (0x10) */ - 5, /* (0x11) */ - 5, /* (0x12) */ - 5, /* (0x13) */ - 5, /* (0x14) */ - 5, /* (0x15) */ - 5, /* (0x16) */ - 5, /* (0x17) */ - 5, /* (0x18) */ - 5, /* (0x19) */ - 5, /* (0x1a) */ - 5, /* (0x1b) */ - 5, /* (0x1c) */ - 5, /* (0x1d) */ - 5, /* (0x1e) */ - 5, /* (0x1f) */ - 5, /* (0x20) */ - 5, /* (0x21) */ - 5, /* (0x22) */ - 5, /* (0x23) */ - 5, /* (0x24) */ - 5, /* (0x25) */ - 5, /* (0x26) */ - 5, /* (0x27) */ - 5, /* (0x28) */ - 5, /* (0x29) */ - 5, /* (0x2a) */ - 5, /* (0x2b) */ - 5, /* (0x2c) */ - 5, /* (0x2d) */ - 5, /* (0x2e) */ - 5, /* (0x2f) */ - 5, /* (0x30) */ - 5, /* (0x31) */ - 5, /* (0x32) */ - 5, /* (0x33) */ - 5, /* (0x34) */ - 5, /* (0x35) */ - 5, /* (0x36) */ - 5, /* (0x37) */ - 5, /* (0x38) */ - 5, /* (0x39) */ - 5, /* (0x3a) */ - 5, /* (0x3b) */ - 5, /* (0x3c) */ - 5, /* (0x3d) */ - 5, /* (0x3e) */ - 5, /* (0x3f) */ - 5, /* (0x40) */ - 5, /* (0x41) */ - 5, /* (0x42) */ - 5, /* (0x43) */ - 5, /* (0x44) */ - 5, /* (0x45) */ - 5, /* (0x46) */ - 5, /* (0x47) */ - 5, /* (0x48) */ - 5, /* (0x49) */ - 5, /* (0x4a) */ - 5, /* (0x4b) */ - 5, /* (0x4c) */ - 5, /* (0x4d) */ - 5, /* (0x4e) */ - 5, /* (0x4f) */ - 5, /* (0x50) */ - 5, /* (0x51) */ - 5, /* (0x52) */ - 5, /* (0x53) */ - 5, /* (0x54) */ - 5, /* (0x55) */ - 5, /* (0x56) */ - 5, /* (0x57) */ - 5, /* (0x58) */ - 5, /* (0x59) */ - 5, /* (0x5a) */ - 5, /* (0x5b) */ - 5, /* (0x5c) */ - 5, /* (0x5d) */ - 5, /* (0x5e) */ - 5, /* (0x5f) */ - 5, /* (0x60) */ - 5, /* (0x61) */ - 5, /* (0x62) */ - 5, /* (0x63) */ - 5, /* (0x64) */ - 5, /* (0x65) */ - 5, /* (0x66) */ - 5, /* (0x67) */ - 5, /* (0x68) */ - 5, /* (0x69) */ - 5, /* (0x6a) */ - 5, /* (0x6b) */ - 5, /* (0x6c) */ - 5, /* (0x6d) */ - 5, /* (0x6e) */ - 5, /* (0x6f) */ - 5, /* (0x70) */ - 5, /* (0x71) */ - 5, /* (0x72) */ - 5, /* (0x73) */ - 5, /* (0x74) */ - 5, /* (0x75) */ - 5, /* (0x76) */ - 5, /* (0x77) */ - 5, /* (0x78) */ - 5, /* (0x79) */ - 5, /* (0x7a) */ - 5, /* (0x7b) */ - 5, /* (0x7c) */ - 5, /* (0x7d) */ - 5, /* (0x7e) */ -}; -#endif - -/* Font information structure */ -//const FONT_T font_x5x7 = {7, 0x, 0x7E, x5x7_bits, x5x7_width}; - - - -uint8_t x5x7_map_char_table(uint8_t ch) -{ - if ( ch > 0x7e ) - { - /* limit to largest character */ - ch = 0x7e - 32 + 9; - } - else if ( ch >= 32 ) - { - /* normal character */ - ch = ch - 32 + 9; - } - else - { - /* special character */ - } - - return ch; -} - diff --git a/Makefile b/Makefile index a33ec7e..3c9f556 100644 --- a/Makefile +++ b/Makefile @@ -120,7 +120,7 @@ CSRC = $(STARTUPSRC) \ $(STREAMSSRC) \ $(SHELLSRC) \ usbcfg.c \ - main.c si5351.c tlv320aic3204.c dsp.c plot.c ui.c ili9341.c numfont20x24.c Font5x7.c Font8x8.c flash.c adc.c + main.c si5351.c tlv320aic3204.c dsp.c plot.c ui.c ili9341.c numfont20x24.c Font8x8.c flash.c adc.c # $(TESTSRC) \ diff --git a/ili9341.c b/ili9341.c index b5b6833..464454f 100644 --- a/ili9341.c +++ b/ili9341.c @@ -336,28 +336,30 @@ ili9341_read_memory_continue(int len, uint16_t* out) -void +unsigned char ili9341_drawchar_size(uint8_t ch, int x, int y, uint16_t fg, uint16_t bg, uint8_t size) { uint16_t *buf = spi_buffer; uint8_t bits; - int c, r; + int cline, ccol; - ch = x5x7_map_char_table(ch); + ch = x8x8_map_char_table(ch); - for(c = 0; c < 7*size; c++) + for(cline = 0; cline < 8*size; cline++) { - bits = x5x7_bits[(ch * 7) + (c / size)]; - for (r = 0; r < 5*size; r++) + bits = x8x8_bits[ch][cline/size]; + for (ccol = 0; ccol < x8x8_len[ch]*size; ccol++) { *buf++ = (0x80 & bits) ? fg : bg; - if (r % size == (size-1)) + if (ccol % size == (size-1)) { bits <<= 1; } } } - ili9341_bulk(x, y, 5*size, 7*size); + ili9341_bulk(x, y, x8x8_len[ch]*size, 8*size); + + return x8x8_len[ch]*size; } @@ -365,9 +367,12 @@ ili9341_drawchar_size(uint8_t ch, int x, int y, uint16_t fg, uint16_t bg, uint8_ void ili9341_drawstring_size(const char *str, int x, int y, uint16_t fg, uint16_t bg, uint8_t size) { - while (*str) { - ili9341_drawchar_size(*str, x, y, fg, bg, size); - x += 5 * size; + unsigned char clength = 0; + + while (*str) + { + clength = ili9341_drawchar_size(*str, x, y, fg, bg, size); + x += clength; str++; } } diff --git a/nanovna.h b/nanovna.h index beef50d..64bd322 100644 --- a/nanovna.h +++ b/nanovna.h @@ -150,7 +150,6 @@ extern int area_height; // font -extern const uint8_t x5x7_bits[]; extern const uint8_t x8x8_bits[][8]; extern const uint8_t x8x8_len[]; extern const uint32_t numfont20x24[][24]; @@ -164,7 +163,6 @@ extern const uint32_t numfont20x24[][24]; #define S_LARROW "\003" #define S_RARROW "\004" -extern uint8_t x5x7_map_char_table(uint8_t ch); extern uint8_t x8x8_map_char_table(uint8_t ch); @@ -287,7 +285,7 @@ void ili9341_init(void); void ili9341_test(int mode); void ili9341_bulk(int x, int y, int w, int h); void ili9341_fill(int x, int y, int w, int h, int color); -void ili9341_drawchar_size(uint8_t ch, int x, int y, uint16_t fg, uint16_t bg, uint8_t size); +unsigned char ili9341_drawchar_size(uint8_t ch, int x, int y, uint16_t fg, uint16_t bg, uint8_t size); void ili9341_drawstring_size(const char *str, int x, int y, uint16_t fg, uint16_t bg, uint8_t size); unsigned char ili9341_drawchar_8x8(uint8_t ch, int x, int y, uint16_t fg, uint16_t bg); void ili9341_drawstring_8x8(const char *str, int x, int y, uint16_t fg, uint16_t bg); diff --git a/plot.c b/plot.c index 46a5d73..a6f308a 100644 --- a/plot.c +++ b/plot.c @@ -1022,24 +1022,31 @@ draw_marker(int w, int h, int x, int y, int c, int ch) { int i, j; - ch = x5x7_map_char_table(ch); + ch = x8x8_map_char_table(ch); - for (j = 10; j >= 0; j--) + for ( j = 12; j >= 0; j-- ) { int j0 = j / 2; - for (i = -j0; i <= j0; i++) + for ( i = -j0; i <= j0; i++ ) { int x0 = x + i; int y0 = y - j; int cc = c; - if ( j <= 9 && j > 2 && i >= -1 && i <= 3 ) + + if ( (4 < j) && (j <= 11) && (-4 <= i) && (i <= 3) ) { - uint8_t bits = x5x7_bits[(ch * 7) + (9-j)]; - if ( bits & (0x80>>(i+1)) ) + uint8_t bits = x8x8_bits[ch][11-j]; + + if ( bits & (0x80>>(i+3)) ) + { cc = 0; + } } + if (y0 >= 0 && y0 < h && x0 >= 0 && x0 < w) + { spi_buffer[y0*w+x0] = cc; + } } } } @@ -1365,6 +1372,7 @@ request_to_draw_cells_behind_numeric_input(void) +#if 0 void cell_drawchar_5x7(int w, int h, uint8_t ch, int x, int y, uint16_t fg, int invert) { @@ -1395,32 +1403,7 @@ cell_drawchar_5x7(int w, int h, uint8_t ch, int x, int y, uint16_t fg, int inver } } } - - - -void -cell_drawstring_5x7(int w, int h, char *str, int x, int y, uint16_t fg) -{ - while (*str) { - cell_drawchar_5x7(w, h, *str, x, y, fg, FALSE); - x += 5; - str++; - } -} - - - -void -cell_drawstring_invert_5x7(int w, int h, char *str, int x, int y, uint16_t fg, int invert) -{ - while (*str) - { - cell_drawchar_5x7(w, h, *str, x, y, fg, invert); - x += 5; - str++; - } -} - +#endif uint16_t diff --git a/ui.c b/ui.c index 6c3fa4c..cc087b8 100644 --- a/ui.c +++ b/ui.c @@ -430,14 +430,14 @@ enter_dfu(void) { adc_stop(ADC1); - int x = 100, y = 20; + int x = 110, y = 20; // leave a last message ili9341_fill(0, 0, 320, 240, 0); - ili9341_drawstring_size("DFU", x+30, y, 0xffff, 0x0000, 4); + ili9341_drawstring_size("DFU", x, y, 0xffff, 0x0000, 4); + x = 5; y += 50; - ili9341_drawstring_8x8_var("Device Firmware Update Mode", x, y += 10, 0xffff, 0x0000); ili9341_drawstring_8x8_var("To exit DFU mode, please reset device yourself.", x, y += 10, 0xffff, 0x0000);