 #include "arm_kinetis_debug.h"
 #include "arm_kinetis_reg.h"
 #include "firmware_data.h"
+
+#define CFLAG_NO_DITHERING      (1 << 0)
+#define CFLAG_NO_INTERPOLATION  (1 << 1)
+#define CFLAG_NO_ACTIVITY_LED   (1 << 2)
+#define CFLAG_LED_CONTROL       (1 << 3)
+#define LUT_CH_SIZE             257
+#define LUT_TOTAL_SIZE          (LUT_CH_SIZE * 3)
+#define PIXELS_PER_PACKET       21
+#define LUTENTRIES_PER_PACKET   31
+#define PACKETS_PER_FRAME       25
+#define PACKETS_PER_LUT         25
 
 const unsigned buttonPin = 2;
 const unsigned ledPin = 13;

    pinMode(ledPin, OUTPUT);
    pinMode(buttonPin, INPUT_PULLUP);
    Serial.begin(115200);
}

void loop()

    }
    digitalWrite(ledPin, HIGH);

    // Start debugging the target
    if (!target.begin(swclkPin, swdioPin))
        return;
    if (!target.startup())
        return;

    // Program firmware, blinking both LEDs in unison for status.
    if (!installFirmware())
        return;

    // Run the new firmware, and let it boot
    if (!target.reset())
        return;
    delay(50);

    // Initialize direct access to the firmware's framebuffer
    if (!fbInit())
        return;

    // Green and blue throbbing means success!
    while (1) {
        float x = sin(millis() * 0.008);
        if (!fbWrite(0, 0, 0xc + 0x10 * x, 0)) return;
        if (!fbWrite(1, 0, 0, 0xc - 0x10 * x)) return;
    }
}
