?? main.c
字號:
/*
avr-libc EEPROM 讀寫測試程序 <2313-2>
main.c
MCU:at90s2313
芯藝 2004-09-11
*/
#include <avr/io.h>
#include <avr/eeprom.h>
#define SET_LED PORTD=0X10;//PD4接有LED
char val1 __attribute__((section(".eeprom")))=0xaa;
char val2[] __attribute__((section(".eeprom")))="hello,this is test eeprom";
int main(void)
{
DDRD=0X10;
PORTD=0X00;
eeprom_busy_wait();
eeprom_write_byte(&val1,0xaa);
eeprom_busy_wait();
eeprom_write_block("hello,this is test eeprom",val2,sizeof("hello,this is test eeprom"));
eeprom_busy_wait();
if(eeprom_read_byte(&val1)==0xaa)
SET_LED;
while(1);
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -