 // XOR 0x55).  LED data follows, 3 bytes per LED, in order R, G, B,
 // where 0 = off and 255 = max brightness.
 
-static const uint8_t magic[] = {'A','d','a'};
+static const uint8_t magic[] = {'A', 'd', 'a'};
 #define MAGICSIZE  sizeof(magic)
 #define HEADERSIZE (MAGICSIZE + 3)
 

  // green, blue, then off.  Once you're confident everything is working
  // end-to-end, it's OK to comment this out and reprogram the Arduino.
  uint8_t testcolor[] = { 0, 0, 0, 255, 0, 0 };
  for(int i=0; i<4; i++){ //Start Frame
    for(SPDR = 0x00; !(SPSR & _BV(SPIF)); );
  }
  for(char n=3; n>=0; n--) {
    for(c=0; c<25000; c++) {
	  for(SPDR = 0xFF; !(SPSR & _BV(SPIF)); ); //Brightness byte
      for(i=0; i<3; i++) {
        for(SPDR = testcolor[n + i]; !(SPSR & _BV(SPIF)); ); //BGR
      }
    }
    for(int i=0; i<4; i++){ //Stop Frame
       for(SPDR = 0xFF; !(SPSR & _BV(SPIF)); );
    }
    delay(1); // One millisecond pause = latch
    digitalWrite(SPI_LED, spi_out_led = !spi_out_led);

  // masking and/or conditional code every time one of these indices
  // needs to change, slowing things down tremendously.
  uint8_t
  buffer[256],
         indexIn       = 0,
         indexOut      = 0,
         mode          = MODE_HEADER,
         hi, lo, chk, i, spiFlag;
  int16_t
  bytesBuffered = 0,
  hold          = 0,
  c;
  int32_t
  bytesRemaining;
  unsigned long
  startTime,
  lastByteTime,
  lastAckTime,
  t;
  bool
  data_in_led = false,
  spi_out_led = false;

  LED_DDR  |=  LED_PIN; // Enable output for LED
  LED_PORT &= ~LED_PIN; // LED off
  pinMode(DATA_LED, OUTPUT); //data in led
  pinMode(SPI_LED, OUTPUT); //data out led

  Serial.begin(115200); // Teensy/32u4 disregards baud rate; is OK!

  SPI.begin();
