diff --git a/include/EffectEntry.h b/include/EffectEntry.h index 6112cc3..df6cff6 100644 --- a/include/EffectEntry.h +++ b/include/EffectEntry.h @@ -4,7 +4,7 @@ #include "Effect.h" typedef struct { - char* name; + const char* name; Effect* effect; } EffectEntry; diff --git a/include/effect_animation.h b/include/effect_animation.h index 789ccb2..4d06a6b 100644 --- a/include/effect_animation.h +++ b/include/effect_animation.h @@ -11,7 +11,7 @@ class AnimationEffect : public Effect { int frame = 0; CRGB background_color; int xOffset, yOffset; - long frameSince = 0; + unsigned long frameSince = 0; public: AnimationEffect(AnimationData *anim); AnimationEffect(AnimationData *anim, CRGB background_color); diff --git a/include/effect_cycle.h b/include/effect_cycle.h index 2ee891a..ad154c7 100644 --- a/include/effect_cycle.h +++ b/include/effect_cycle.h @@ -7,7 +7,7 @@ class CycleEffect : public Effect { private: Effect* effect; - long effectSince = 0; + unsigned long effectSince = 0; public: void changeEffect(); diff --git a/include/effect_matrix.h b/include/effect_matrix.h index 5afe8ec..838e9b7 100644 --- a/include/effect_matrix.h +++ b/include/effect_matrix.h @@ -11,9 +11,9 @@ class MatrixEffectColumn { int x, y; int length; Window* window; - int speed; + uint16_t speed; boolean running; - long last_move = 0; + unsigned long last_move = 0; public: MatrixEffectColumn(); MatrixEffectColumn(Window* win, int xPos); diff --git a/src/effect_bell.cpp b/src/effect_bell.cpp index 38c4cd0..d77600e 100644 --- a/src/effect_bell.cpp +++ b/src/effect_bell.cpp @@ -8,7 +8,7 @@ void BellEffect::loop() { for (int y = 0; y < 16; y++) { for (int x = 0; x < 2; x++) { for (int z = 0; z < 8; z++) { - leds[XYsafe(x * 8 + z, y)] = sprite_bell[y * 2 + x] >> (7 - z) & 1 ^ invert ? color_on : color_off; + leds[XYsafe(x * 8 + z, y)] = (sprite_bell[y * 2 + x] >> (7 - z) & 1) ^ invert ? color_on : color_off; } } } diff --git a/src/effect_big_clock.cpp b/src/effect_big_clock.cpp index a117402..4407337 100644 --- a/src/effect_big_clock.cpp +++ b/src/effect_big_clock.cpp @@ -11,7 +11,7 @@ void BigClockEffect::drawNumber(uint8_t number, int x, int y, CRGB color) { } void BigClockEffect::drawText(char *text, int x, int y, CRGB color) { - for (int i = 0; i < strlen(text); i++) { + for (uint8_t i = 0; i < strlen(text); i++) { drawSprite(font_char(numbers4x7, text[i]), x + i * 4, y, color); } } diff --git a/src/efffect_clock.cpp b/src/effect_clock.cpp similarity index 100% rename from src/efffect_clock.cpp rename to src/effect_clock.cpp diff --git a/src/fastled.cpp b/src/fastled.cpp index 144842c..2c58b89 100644 --- a/src/fastled.cpp +++ b/src/fastled.cpp @@ -1,4 +1,3 @@ -#include #include "my_fastled.h" CRGB leds[LED_COUNT]; diff --git a/src/text.cpp b/src/text.cpp index 08555b0..82d3911 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -20,7 +20,7 @@ void drawDigit(Window window, unsigned char* font, int w, int h, int x, int y, i } void drawText(Window window, char *font, int w, int h, char *text, int x, int y, CRGB color) { - for (int i = 0; i < strlen(text); i++) { + for (uint16_t i = 0; i < strlen(text); i++) { drawChar(window, font5x7, 5, 7, x+i*(w+1), y, text[i], color); } }