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

@@ -15,13 +15,20 @@ protected:
UIRect rect;
bool _visible = true;
bool _needsRedraw = true;
bool opaque = true;
bool focus = false;
std::vector<UIElement*> children;
static constexpr const char* TAG = "UIElement";
public:
void setOpaque(bool opaque) {
this->opaque = opaque;
}
void setRect(const UIRect r) {
this->rect = r;
setNeedsRedraw();
@@ -44,6 +51,11 @@ public:
return this->_visible;
}
void setFocus(bool focus) {
this->focus = focus;
setNeedsRedraw();
}
void setNeedsRedraw() {
this->_needsRedraw = true;
}
@@ -99,7 +111,7 @@ protected:
void _draw(UIPainter& p) {
// if hidde, ignore for me and children
// if hiden, ignore for me and children
if (!_visible) {return;}
// draw myself (if needed)