display defines restructured for t_dongle_display

This commit is contained in:
cyberman54 committed 2022-11-13 22:14:57 +01:00
1 parent ba8eb8130d
commit b2d32f9bc1
3 files changed
+38 -39

No files matched your search

+5 -5
View File
@@ -49,7 +49,7 @@ static QRCode qrcode;
#ifdef HAS_DISPLAY
#if (HAS_DISPLAY) == 1
ONE_BIT_DISPLAY *dp = NULL;
#elif (HAS_DISPLAY) == 2
#elif (HAS_DISPLAY) > 1
BB_SPI_LCD *dp = NULL;
#else
#error Unknown display type specified in hal file
@@ -68,7 +68,7 @@ void dp_setup(int contrast) {
dp->setRotation(
MY_DISPLAY_FLIP ? 2 : 0); // 0 = no rotation, 1 = 90°, 2 = 180°, 3 = 270°
#elif (HAS_DISPLAY) == 2 // TFT LCD
#elif (HAS_DISPLAY) > 1 // TFT LCD
dp = new BB_SPI_LCD;
dp->begin(TFT_TYPE);
@@ -421,7 +421,7 @@ void dp_clear(void) {
void dp_contrast(uint8_t contrast) {
#if (HAS_DISPLAY) == 1
dp->setContrast(contrast);
#elif (HAS_DISPLAY) == 2
#elif (HAS_DISPLAY) > 1
// to do: gamma correction for TFT
#endif
}
@@ -429,7 +429,7 @@ void dp_contrast(uint8_t contrast) {
void dp_power(uint8_t screenon) {
#if (HAS_DISPLAY) == 1
dp->setPower(screenon);
#elif (HAS_DISPLAY) == 2
#elif (HAS_DISPLAY) > 1
// to come
#endif
}
@@ -438,7 +438,7 @@ void dp_shutdown(void) {
#if (HAS_DISPLAY) == 1
dp->setPower(false);
delay(DISPLAYREFRESH_MS / 1000 * 1.1);
#elif (HAS_DISPLAY) == 2
#elif (HAS_DISPLAY) > 1
// to come
#endif
}
+1 -3
View File
@@ -18,12 +18,10 @@
#define SDCARD_SLOTWIDTH 4 // dongle has 4 line interface
#define SDCARD_SLOTCONFIG { .clk = GPIO_NUM_12, .cmd = GPIO_NUM_16, .d0 = GPIO_NUM_14, .d1 = GPIO_NUM_17, .d2 = GPIO_NUM_21, .d3 = GPIO_NUM_18, .cd = SDMMC_SLOT_NO_CD, .wp = SDMMC_SLOT_NO_WP, .width = 4, .flags = 0, }
#define HAS_DISPLAY 2 // TFT-LCD
#define HAS_DISPLAY 3 // TFT-LCD
#define TFT_TYPE DISPLAY_T_DONGLE_S3
#define MY_DISPLAY_FLIP 1 // use if display is rotated
#define MY_DISPLAY_WIDTH 80
#define MY_DISPLAY_HEIGHT 160
#endif