     }
     xPos[c] += xIncrement[c] * lastFrameDuration;
     yPos[c] += yIncrement[c] * lastFrameDuration;
-    while (xPos[c] > width) xPos[c] -= width;
-    while (yPos[c] > height) yPos[c] -= height;
-    while (xPos[c] < 0) xPos[c] += width;
-    while (yPos[c] < 0) yPos[c] += height;
+    while (xPos[c] > WIDTH) xPos[c] -= WIDTH;
+    while (yPos[c] > HEIGHT) yPos[c] -= HEIGHT;
+    while (xPos[c] < 0) xPos[c] += WIDTH;
+    while (yPos[c] < 0) yPos[c] += HEIGHT;
     steps[c]--;
   }
 }

    }
#endif
  }
  if (DEBUG) {
    Serial.print(F("settings: "));
    Serial.print(settings.brightness);
    Serial.print(',');
    Serial.print(settings.mode);
    Serial.print(',');
    Serial.print(settings.hue);
    Serial.print(',');
    Serial.print(settings.saturation);
    Serial.print(',');
    Serial.print(settings.c1);
    Serial.print(',');
    Serial.println(settings.c2);
  }
  
  FastLED.setBrightness(settings.brightness);
  if ((settings.mode == 'C' || settings.mode == 'R') &&

#define SRAM_SIZE 2048
// Assume we need this much for everything else
#define VAR_ALLOWANCE (NUM_LEDS * 3 + 850)
#define MAX_FRAMES (BASE_WID == 1 ? (SRAM_SIZE - VAR_ALLOWANCE) / NUM_LEDS : 0)

#define WIDTH (STAGGERED ? BASE_WID * 2 + 1 : BASE_WID)
#define logical_num_leds (STAGGERED ? NUM_LEDS * 2 : NUM_LEDS)
// Add extra row if there's a remainder.
#define HEIGHT (logical_num_leds / WIDTH + (logical_num_leds % WIDTH ? 1 : 0))
int eepromStart;
long saveTarget;
long lastFrameTime;
