diff --git a/src/wordclock_esp8266.cpp b/src/wordclock_esp8266.cpp index 7ec7a5c..ba974ff 100644 --- a/src/wordclock_esp8266.cpp +++ b/src/wordclock_esp8266.cpp @@ -335,18 +335,18 @@ void handle_current_state() } case ST_SPIRAL: // state spiral { - int res = draw_spiral(false, spiral_direction, MATRIX_WIDTH - 1); - if (res && spiral_direction == 0) + int res = draw_spiral(false, spiral_direction, MATRIX_WIDTH - 2); + if ((bool)res && spiral_direction == 0) { // change spiral direction to closing (draw empty leds) - spiral_direction = 1; + spiral_direction = true; // init spiral with new spiral direction draw_spiral(true, spiral_direction, MATRIX_WIDTH - 1); } else if (res && spiral_direction == 1) { // reset spiral direction to normal drawing leds - spiral_direction = 0; + spiral_direction = false; // init spiral with new spiral direction draw_spiral(true, spiral_direction, MATRIX_WIDTH - 1); }