bugfix color palette

This commit is contained in:
Nic Limper
2023-03-23 13:55:55 +01:00
parent 27ecf54fb6
commit 9212aad8d8
3 changed files with 13 additions and 9 deletions

View File

@@ -51,14 +51,11 @@
#define FLASHER_AP_MOSI 23
#define FLASHER_AP_MISO 19
#define FLASHER_AP_RESET 2
//#define FLASHER_AP_POWER 13
#define FLASHER_AP_POWER 13
#define FLASHER_AP_POWER2 15
//#define FLASHER_AP_TXD 17
//#define FLASHER_AP_RXD 16
#define FLASHER_AP_TEST -1
#define FLASHER_AP_TXD 12
#define FLASHER_AP_RXD 13
#define FLASHER_AP_POWER 25
#define FLASHER_AP_TXD 17
#define FLASHER_AP_RXD 16
#define FLASHER_LED 22
#endif

View File

@@ -73,9 +73,11 @@ lib_deps =
https://github.com/garretlab/shoddyxml2
https://github.com/Bodmer/U8g2_for_TFT_eSPI
https://github.com/ricmoo/qrcode
upload_port = COM12
monitor_port = COM12
upload_port = COM21
monitor_port = COM21
build_flags =
-D SIMPLE_AP=2
-D PINOUT=SIMPLE_AP
-D PINOUT=SIMPLE_AP
src_filter =
+<*>-<usbflasher.cpp>

View File

@@ -217,6 +217,11 @@ void drawString(TFT_eSprite &spr, String content, uint16_t posx, uint16_t posy,
void initSprite(TFT_eSprite &spr, int w, int h) {
spr.setColorDepth(4); // 4 bits per pixel, uses indexed color
spr.createSprite(w, h);
uint16_t cmap[16];
cmap[PAL_BLACK] = TFT_BLACK;
cmap[PAL_RED] = TFT_RED;
cmap[PAL_WHITE] = TFT_WHITE;
spr.createPalette(cmap, 16);
if (spr.getPointer() == nullptr) {
wsErr("Failed to create sprite");
}