Windows. Everything now is implemented in Windows. ;-) (Okay, just the drawing stuff. And defnititely nothing by Microsoft.)

This commit is contained in:
2019-06-11 19:48:09 +02:00
parent 9acdc42dc3
commit 83254f2eaa
25 changed files with 223 additions and 223 deletions

View File

@ -1,7 +1,7 @@
#include "effect_clock.h"
#include <FastLED.h>
#include "functions.h"
#include "text.h"
#include "fonts.h"
#include "ntp.h"
void ClockEffect::loop() {
@ -10,32 +10,33 @@ void ClockEffect::loop() {
void ClockEffect::loop(boolean invert, CRGB fg_color, CRGB bg_color) {
if (!invert) {
clear(window, bg_color);
window->clear(&bg_color);
} else {
// Manually clear the needed parts
for(int i=0; i<window.w; i++) setPixel(window, i, 0, bg_color);
for(int i=0; i<window->width; i++) window->setPixel(i, 0, &bg_color);
for(int y=0; y<6; y++) {
setPixel(window, 3, y, bg_color);
window->setPixel(3, y, &bg_color);
if (y!=2 && y!=4) {
setPixel(window, 7, y, bg_color);
window->setPixel(7, y, &bg_color);
}
setPixel(window, 8, y, bg_color);
setPixel(window, 12, y, bg_color);
window->setPixel(8, y, &bg_color);
window->setPixel(12, y, &bg_color);
}
fg_color = bg_color;
}
if (ntpClient.isTimeSet()==false && (ntpClient.getSeconds() & 1)==0) {
clear(window, bg_color);
window->clear(&bg_color);
return;
}
int h = ntpClient.getHours();
drawDigit(window, numbers3x5, 3, 5, 0, 1, h / 10, fg_color, invert);
drawDigit(window, numbers3x5, 3, 5, 4, 1, h % 10, fg_color, invert);
//void drawChar(Font f, uint8_t x, uint8_t y, const char c, CRGB* color, bool mask=false);
window->drawChar(&font_numbers3x5, 0, 1, '0' + (h / 10), &fg_color, invert);
window->drawChar(&font_numbers3x5, 4, 1, '0' + (h % 10), &fg_color, invert);
int m = ntpClient.getMinutes();
drawDigit(window, numbers3x5, 3, 5, 9, 1, m / 10, fg_color, invert);
drawDigit(window, numbers3x5, 3, 5, 13, 1, m % 10, fg_color, invert);
window->drawChar(&font_numbers3x5, 9, 1, '0' + (m / 10), &fg_color, invert);
window->drawChar(&font_numbers3x5, 13, 1, '0' + (m % 10), &fg_color, invert);
if (ntpClient.getSeconds() & 1) {
setPixel(window, 7, 2, fg_color);
setPixel(window, 7, 4, fg_color);
window->setPixel(7, 2, &fg_color);
window->setPixel(7, 4, &fg_color);
}
}