SparkFun Forums 

Where electronics enthusiasts find answers.

Your source for all things Atmel.
By dallypost
#76747
I am pretty green and attempting a first project. I need to store initial values to eeprom. Here is my code:
Code: Select all
//ee.c
#include <avr/eeprom.h> 
int ee(int unsigned temp){
	if(temp==1){//set initial values
		uint8_t EEMEM EEcalibrate = 0;
	}
	return 1;
}
Compile error:
ee.c: In function ‘ee’:
ee.c:6: error: section attribute cannot be specified for local variables

Apparently I need to define EEcalibrate as a global variable. I have tried defining it in main.c and declaring it as extern in ee.c. This has not worked. Can anyone help me with this.