Small fixes.
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Fabian Schlenz 2019-10-04 15:58:56 +02:00
parent 8bcee1871f
commit 205a0df842
4 changed files with 6 additions and 6 deletions

View File

@ -3,7 +3,7 @@
#include <Arduino.h>
#define FASTLED_INTERNAL
#include <FastLED.h>
#include "prototypes.h"
#include "settings.h"
//#define DEBUG // Uncomment this to enable Debug messages via Serial and, if enabled, MQTT.
//#define CONFIG_USABLE // Uncomment this by removing the // at the beginning!

View File

@ -75,7 +75,7 @@ bool Animation::_load_from_file(const char* filename) {
return false;
}
if (file.available() != size - 6) {
if (file.available() < 0 || file.available() + 6 != size) {
LOGln("Animation * Expected file to have %d bytes available, but found %d bytes available.", size - 6, file.available());
file.close();
return false;

View File

@ -42,13 +42,13 @@ void Window::clear(CRGB* color) {
}
void Window::drawText(Font* font, uint16_t x, uint16_t y, String text, CRGB* color) {
for (int i=0; i<text.length(); i++) {
drawChar(font, (x+(i*(font->width + 1))<<8), (y<<8), text[i], color);
for (uint16_t i=0; i<text.length(); i++) {
drawChar(font, (x+((i*(font->width + 1))<<8)), (y<<8), text[i], color);
}
}
void Window::drawSubText(Font* font, accum88 x, accum88 y, String text, CRGB* color) {
for (int i=0; i<text.length(); i++) {
for (uint16_t i=0; i<text.length(); i++) {
drawChar(font, x+(i*((font->width + 1)<<8)), y, text[i], color);
}
}

View File

@ -154,7 +154,7 @@ RandomMatrixEffect::RandomMatrixEffect() {
RainbowMatrixEffect::RainbowMatrixEffect() {
// No need to initialize _columns, because that will have been done by ctor of MatrixEffect.
for (int i=0; i<window->width; i++) {
delete columns[i];
delete _columns[i];
_columns[i] = new RainbowMatrixEffectColumn(window, MatrixEffectColumn::DIR_SOUTH);
}
}