wip commit

This commit is contained in:
Torrie Fischer
2023-12-26 11:29:49 +01:00
parent 6582bae0f2
commit ebbf433cdf
40 changed files with 904 additions and 170 deletions

View File

@ -6,6 +6,9 @@ class Args {
String *str;
public:
Args(String *str) : str(str) {}
operator const char*() const {
return str->c_str();
}
String operator[](int pos) {
char buf[64];
strncpy(buf, str->c_str(), sizeof(buf));

View File

@ -108,7 +108,7 @@ struct InputEvent: public Variant {
InputEvent()
: Variant(), intent(None) {}
bool operator!=(const InputEvent::Intent& otherIntent) {
bool operator!=(const InputEvent::Intent& otherIntent) const {
return intent != otherIntent;
}

View File

@ -21,6 +21,7 @@ Renderer::loop()
{
uint16_t totalPower = 0;
for(Display* dpy : m_displays) {
dpy->clear();
totalPower += calculate_unscaled_power_mW(dpy->pixelBacking(), dpy->pixelCount());
for(Figment* figment : m_figments) {
if (figment->state == Task::Running) {

0
lib/Figments/Scheduler.h Normal file
View File

View File

@ -43,6 +43,14 @@ Surface::operator+=(const CRGB& color)
return *this;
}
void
Surface::blend(const CRGB& color, uint8_t pct)
{
paintWith([&](CRGB& pixel) {
nblend(pixel, color, pct);
});
}
void
Surface::paintWith(std::function<void(CRGB&)> func)
{

View File

@ -31,6 +31,8 @@ public:
*/
Surface& operator+=(const CRGB& color);
void blend(const CRGB& color, uint8_t pct);
/**
* OR operation that applies the given color to every pixel on the surface
*/