From 800da9381f1659d39b0b61ce681c0a42d852889e Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Sat, 25 Jun 2022 23:32:08 +0200 Subject: [PATCH] fixes oida --- Extensions/Button.cpp | 6 ++++-- TFT_config.h | 2 +- TFT_eSPI.cpp | 10 ---------- TFT_eSPI.h | 1 + 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Extensions/Button.cpp b/Extensions/Button.cpp index c4515ee..ac14cdd 100644 --- a/Extensions/Button.cpp +++ b/Extensions/Button.cpp @@ -1,3 +1,5 @@ +#include + /*************************************************************************************** ** Code for the GFX button UI element ** Grabbed from Adafruit_GFX library and enhanced to handle any label font @@ -60,7 +62,7 @@ void TFT_eSPI_Button::drawButton(bool inverted, std::string_view long_name) { text = _fillcolor; } - uint8_t r = min(_w, _h) / 4; // Corner radius + uint8_t r = std::min(_w, _h) / 4; // Corner radius _gfx->fillRoundRect(_x1, _y1, _w, _h, r, fill); _gfx->drawRoundRect(_x1, _y1, _w, _h, r, outline); @@ -69,7 +71,7 @@ void TFT_eSPI_Button::drawButton(bool inverted, std::string_view long_name) { _y1 + (_h / 4)); _gfx->setTextColor(text); _gfx->setTextSize(_textsize); - _gfx->print(_label); +// _gfx->print(_label); } else { _gfx->setTextColor(text, fill); diff --git a/TFT_config.h b/TFT_config.h index 76aff1e..5173519 100644 --- a/TFT_config.h +++ b/TFT_config.h @@ -224,7 +224,7 @@ // SPI BUS #else #if CONFIG_TFT_MISO == -1 - #error "Invalid MISO pin. Check TFT_eSPI configuration" + //#error "Invalid MISO pin. Check TFT_eSPI configuration" #else #define TFT_MISO CONFIG_TFT_MISO #endif diff --git a/TFT_eSPI.cpp b/TFT_eSPI.cpp index 90cccb6..5f3adc8 100644 --- a/TFT_eSPI.cpp +++ b/TFT_eSPI.cpp @@ -4187,16 +4187,6 @@ void TFT_eSPI::fillRectHGradient(int16_t x, int16_t y, int16_t w, int16_t h, uin } -/*************************************************************************************** -** Function name: color565 -** Description: convert three 8 bit RGB levels to a 16 bit colour value -***************************************************************************************/ -uint16_t TFT_eSPI::color565(uint8_t r, uint8_t g, uint8_t b) -{ - return ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3); -} - - /*************************************************************************************** ** Function name: color8to16 ** Description: convert 8 bit colour to a 16 bit 565 colour value diff --git a/TFT_eSPI.h b/TFT_eSPI.h index aae99ec..98f9ace 100644 --- a/TFT_eSPI.h +++ b/TFT_eSPI.h @@ -29,6 +29,7 @@ //Standard support #include +#include #include /***************************************************************************************