* Heltec Wireless Tracker fixes: getTextWidth() missing, PIN_BOARD_SDA/SCL
This commit is contained in:
@@ -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);
|
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() {
|
void ST7735Display::endFrame() {
|
||||||
// display.display();
|
// display.display();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,5 +32,6 @@ public:
|
|||||||
void fillRect(int x, int y, int w, int h) override;
|
void fillRect(int x, int y, int w, int h) override;
|
||||||
void drawRect(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;
|
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;
|
void endFrame() override;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -196,6 +196,8 @@ build_flags =
|
|||||||
; -D ARDUINO_USB_CDC_ON_BOOT=1 ; need for debugging
|
; -D ARDUINO_USB_CDC_ON_BOOT=1 ; need for debugging
|
||||||
-D ST7735
|
-D ST7735
|
||||||
-D PIN_ADC_CTRL=2 ; redefines the V3 pin
|
-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_ROTATION=1
|
||||||
-D DISPLAY_CLASS=ST7735Display
|
-D DISPLAY_CLASS=ST7735Display
|
||||||
-D USE_PIN_TFT=1
|
-D USE_PIN_TFT=1
|
||||||
|
|||||||
Reference in New Issue
Block a user