worked on SPI, fixed some bugs

adjusted LCD code
added code for INA3221
worked on UI
This commit is contained in:
2020-06-24 21:28:44 +02:00
parent 6dfce7803a
commit ccd7f119d3
11 changed files with 258 additions and 88 deletions

View File

@@ -11,7 +11,7 @@
class UILabel : public UIElement {
std::string txt;
Color cBackground = Color::fromRGB(255,255,255);
Color cText = Color::fromRGB(0,0,0);
@@ -21,18 +21,21 @@ public:
;
}
/** set the text to draw */
void setText(const std::string& txt) {
this->txt = txt;
setNeedsRedraw();
}
void draw(UIPainter& p) {
/** draw the label */
void draw(UIPainter& p) override {
p.setFG(cBackground);
p.fillRect(rect);
//const uint16_t txtW = fnt_f1.getWidth(txt);
//const uint16_t txtH = fnt_f1.getHeight();
if (opaque) {
p.setFG(cBackground);
p.fillRect(rect);
}
p.setFG(cText);
p.drawText(rect.x, rect.y, txt.c_str());