     resetEthernet(A5);
     delay(2000);
     Serial.println(F("apollo update Initialized"));
-    
+
     // Init SD Card
     // initialize the SD card
     card.begin(CHIP_SELECT, SPI_HALF_SPEED);
-  
+
     // initialize a FAT16 volume
     Fat16::init(&card);
 

/**
 * apolloClient is a sketch that downloads another sketch from a webserver and loads
 * it onto the arduino.
 * 
 * The sketch should have been created with the apollo/mkfirmware tool. The sketch is 
 * downloaded onto an sdcard, and integrity is checked against a few 'prepended'
 * bytes. The first two bytes of the binary represent the size of the file excluding
 * the prepended bytes. The following two bytes represent the checksum of the remainder
 * of the file, which is computed using a fletcher 16 algorithm.
 * 
 * Once a binary file has been succesfully downloaded the arduino will issue a reset
 * call, which will allow the bootloader to load the new firmware.
 * 
 * This sketch works fine on it's own, but there's no point in it unless the arduino
 * it is running on has a modified bootloader.
 * 
 * Author: Jadin Roste Andrews 
 * Email: jadinandrews@gmail.com
 * 
 * TODO: This is like the first working version, with most features in place, lots can still be improved.
 * TODO: Need a way to store the downloaded file in a temporary file, and then rename it to FIRMWARE.BIN
 *       only if the download passes the checks. I don't think this is an easy task with the fat16 lib,
 *       but maybe it won't be too bad to simply copy a temp file into FIRMWARE.BIN? 
 *       
 * NOTE: This sketch relies on the Seedstudio ethernet shieal v2.0, with an integrated SD card slot.
 *       For other cobinations, just make sure your cs pins don't conflict, otherwise everything should
 *       work just fine.
 * 
 * */




int temp = 0;

EthernetClient client;
IPAddress ip(10, 0, 0, 24);
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};

/**
   ElCheapo reset function.
*/
void(* resetFunc)(void) = 0;


