fixes oida

This commit is contained in:
2022-06-25 23:32:08 +02:00
parent 2fe368ed19
commit 800da9381f
4 changed files with 6 additions and 13 deletions

View File

@@ -1,3 +1,5 @@
#include <algorithm>
/***************************************************************************************
** 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);

View File

@@ -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

View File

@@ -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

View File

@@ -29,6 +29,7 @@
//Standard support
#include <SPI.h>
#include <string>
#include <string_view>
/***************************************************************************************