 // - The SPI functions herein were developed for the AVR910_ARD programmer
 // - More information at http://code.google.com/p/mega-isp
 
+#include "SPI.h"
 #include "pins_arduino.h"
 #define RESET     SS
 


void setup() {
  Serial.begin(9600);
  pinMode(LED_PMODE, OUTPUT);
  pulse(LED_PMODE, 2);
  pinMode(LED_ERR, OUTPUT);
  pulse(LED_ERR, 2);
  pinMode(LED_HB, OUTPUT);
  pulse(LED_HB, 2);
}

int error = 0;

  }
}

uint8_t spi_transaction(uint8_t a, uint8_t b, uint8_t c, uint8_t d) {
  uint8_t n;
  SPI.transfer(a);
  n = SPI.transfer(b);
  //if (n != a) error = -1;
  n = SPI.transfer(c);
  return SPI.transfer(d);
}

void empty_reply() {
