* Heltec Wireless Tracker fixes: getTextWidth() missing, PIN_BOARD_SDA/SCL

This commit is contained in:
Scott Powell 2025-05-08 12:42:28 +10:00
parent 0e208f01cd
commit 7a7f436921
3 changed files with 10 additions and 0 deletions

View file

@ -118,6 +118,13 @@ void ST7735Display::drawXbm(int x, int y, const uint8_t* bits, int w, int h) {
display.drawBitmap(x, y, bits, w, h, _color);
}
uint16_t ST7735Display::getTextWidth(const char* str) {
int16_t x1, y1;
uint16_t w, h;
display.getTextBounds(str, 0, 0, &x1, &y1, &w, &h);
return w;
}
void ST7735Display::endFrame() {
// display.display();
}

View file

@ -32,5 +32,6 @@ public:
void fillRect(int x, int y, int w, int h) override;
void drawRect(int x, int y, int w, int h) override;
void drawXbm(int x, int y, const uint8_t* bits, int w, int h) override;
uint16_t getTextWidth(const char* str) override;
void endFrame() override;
};

View file

@ -196,6 +196,8 @@ build_flags =
; -D ARDUINO_USB_CDC_ON_BOOT=1 ; need for debugging
-D ST7735
-D PIN_ADC_CTRL=2 ; redefines the V3 pin
-D PIN_BOARD_SDA=45
-D PIN_BOARD_SCL=46
-D DISPLAY_ROTATION=1
-D DISPLAY_CLASS=ST7735Display
-D USE_PIN_TFT=1