     if (settings.mode == 'T') {
       EEPROM.put(eepromStart + sizeof(settings), text);
     }
+#endif
+#ifdef ESP32
+    EEPROM.commit();
 #endif
     saveTarget = 0;
 #if DEBUG

  bool allowZero = WIDTH > 1 || HEIGHT > 1;
  for (byte c = RED; c <= BLUE; c++) {
    if (!steps[c]) {
      xIncrement[c] = (float)(random(allowZero ? 0 : WIDTH * settings.hue / 2, WIDTH * settings.hue) + 100) / 10000.0;
      yIncrement[c] = (float)(random(allowZero ? 0 : HEIGHT * settings.hue / 2, HEIGHT * settings.hue) + 100) / 10000.0;
      if (random(2)) {
        xIncrement[c] *= -1;
      }
      if (random(2)) {
        yIncrement[c] *= -1;
      }
      steps[c] = random(10, 50);
    }
    xPos[c] += xIncrement[c] * lastFrameDuration;
    yPos[c] += yIncrement[c] * lastFrameDuration;

// BLUME VIVE: 47/6/true/false
// BLUME SCARF: 120/40/false/true
// BLUME DUBIOUS: 60/6/true/false
// BLUME FEATHER: 72/12/false/false/textmode=true
// NIC'S BLUME: 40/6/true/false/false

#define DEBUG false

// Only change these settings if you're wired to different pins, using a non-APA102 chipset,
// using a different COLOR_ORDER for RGB, etc.
#ifdef ESP32
// No standard pins for ESP32 yet; I'm using these at the moment.
#define DATA_PIN_0    12
#define DATA_PIN_1    14
#define CLOCK_PIN_0   13
#define CLOCK_PIN_1   15
#else
#define DATA_PIN_0    A0
#define DATA_PIN_1    A1
#define CLOCK_PIN_0   5
#define CLOCK_PIN_1   4
#endif
#define COLOR_ORDER BGR
#define CHIPSET     APA102
#define APA_MHZ 40
/* For LPD8806:
#define COLOR_ORDER BRG
#define CHIPSET     LPD8806
 */

// These are used by ESP32_OTA and ESP32_OPC support.
#define WIFI_SSID "Your Wifi Network"
#define WIFI_PASSWORD "yourpassword"

// EVERYTHING BELOW HERE WON'T CHANGE FOR A NORMAL PROJECT.


#ifdef ESP32
// All of these are needed for Bluetooth functionality.
#include <BLEDevice.h>
#include <BLEDeviceID.h>
#include <BLESerial.h>
#include <BLEServer.h>
// FastLED seems to need this.
#define FASTLED_FORCE_SOFTWARE_PINS
// Over-the-air updates can be turned on or off.
//#define ESP32_OTA
// Open Pixel Control support can be turned on or off.
//#define ESP32_OPC
// Something small and reasonable.
#define EEPROM_SIZE 64
// This varies by ESP32 dev board.
#define LED_PIN 2
#endif // ESP32

#ifdef ESP32_OTA
#include <WiFi.h>
#include <ESPmDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#endif // ESP32_OTA

#ifdef ESP32_OPC

#if DEBUG
#define OPC_SERV_INFO 1
#define OPC_SERV_PERF 1
#define OPC_SERV_DEBUG 1
#endif // DEBUG

#include <WiFi.h>
#include "Opc.h"
#include "OpcServer.h"

#define OPC_PORT 7890
#define OPC_CHANNEL 1
#define OPC_MAX_CLIENTS 1
#define OPC_MAX_PIXELS NUM_LEDS
#define OPC_BUFFER_SIZE (OPC_MAX_PIXELS * 3 + OPC_HEADER_BYTES)
#define OPC_DISPLAY_TIMEOUT 5000

WiFiServer opcWifiServer = WiFiServer(OPC_PORT);
OpcClient opcClients[OPC_MAX_CLIENTS];
uint8_t buffer[OPC_BUFFER_SIZE * OPC_MAX_CLIENTS];
OpcServer opcServer = OpcServer(
    opcWifiServer, OPC_CHANNEL,opcClients, OPC_MAX_CLIENTS, buffer,
    OPC_BUFFER_SIZE);
long lastOpc = 0;
uint16_t opcCount = 0;

#endif // ESP32_OPC



#if TEXTMODE
// Include this here because it uses keywords we #define below like "WIDTH" and "HEIGHT"
#include "Adafruit_GFX.h"
#endif // TEXTMODE


#include <EEPROM.h>
// Must come after FASTLED_FORCE_SOFTWARE_PINS above
#include <FastLED.h>


#define EEPROM_SAVE_TIMEOUT_MS 5000
#define EEPROM_START_POINTER_ADDR 0x0

#if (CHIPSET == APA102)
#define LED_SETTINGS_0 CHIPSET, DATA_PIN_0, CLOCK_PIN_0, COLOR_ORDER, DATA_RATE_MHZ(APA_MHZ)
#define LED_SETTINGS_1 CHIPSET, DATA_PIN_1, CLOCK_PIN_1, COLOR_ORDER, DATA_RATE_MHZ(APA_MHZ)
#else
#define LED_SETTINGS_0 CHIPSET, CLOCK_PIN_0, DATA_PIN_0, COLOR_ORDER
#define LED_SETTINGS_1 CHIPSET, CLOCK_PIN_1, DATA_PIN_0, COLOR_ORDER
#endif

CRGB leds[NUM_LEDS];
// ESP32 can run insanely fast; make this non-insane.
#define MAX_FPS 120

// Calculate max number of frames we can store in SRAM
// TODO: Wrong for ESP32
#define SRAM_SIZE 2048
// Assume we need this much for everything else
#define VAR_ALLOWANCE (NUM_LEDS * 3 + 850)
