OK so I am using an atmega 2560 with an Ethernet shield and reading an sd card off of it.
The issue I am having is if i add a timer interrupt to the setup the setup loops forever.... what???
#include <SPI.h>
#include <SD.h>
#include <ctype.h>
File myFile;
struct parameters {
int intValue;
boolean booleanValue;
String stringValue;
} settings;
// Setting for SD-card reader
const int chipSelect = 4;
void setup() {
Serial.begin(9600);
Serial.println("Starting...");
pinMode(10, OUTPUT);
digitalWrite(10,HIGH);
if (!SD.begin(chipSelect)) {
Serial.println("initialization failed!");
return;
}
//getSettings();
Serial.print("Interger Value: ");
Serial.println(settings.intValue);
Serial.print("Boolean Value: ");
Serial.println(settings.booleanValue);
Serial.print("String Value: ");
Serial.println(settings.stringValue);
timer4();
}
void timer4(){
//Timer 4: Set to .1 second intervals
TCCR4A = 0;
TCCR4B = 0;
TCNT4 = 0;
OCR4A = 975.5625;
TCCR4B |= (1 << WGM42);
TCCR4B |= (1 << CS42) | (1 << CS40);
TIMSK4 |= (1 << OCIE4A);
}
void loop() {
//Currently nothing happining here.
}