?? eeprom.c
字號(hào):
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <avr/wdt.h>
#include <avr/eeprom.h>
#include "main.h"
unsigned char Id1_Eeprom[cIDMax] __attribute__((section(".eeprom")));
unsigned char Id2_Eeprom[cIDMax] __attribute__((section(".eeprom")));
unsigned char Key_Eeprom[cIDMax] __attribute__((section(".eeprom")));
unsigned char Path_Eeprom[cIDMax] __attribute__((section(".eeprom"))); // Sav the senses
unsigned char Path2_Eeprom[cIDMax] __attribute__((section(".eeprom"))); // Sav the senses
unsigned char RecodeNM_Eeprom __attribute__((section(".eeprom")));
unsigned char LeftNM_Eeprom[4] __attribute__((section(".eeprom")));
//unsigned char RightNM_Eeprom[4] __attribute__((section(".eeprom")));
unsigned char ID_HEeprom __attribute__((section(".eeprom")));
unsigned char ID_LEeprom __attribute__((section(".eeprom")));
//unsigned char RFKey_Eeprom __attribute__((section(".eeprom")));
void Eeprom_Init(void)
{
uint8_t i;
eeprom_busy_wait(); //-----------網(wǎng)絡(luò)按鈕ID
Recode_Count=eeprom_read_byte(&RecodeNM_Eeprom);
if ( Recode_Count > cIDMax ) Recode_Count =0;
for(i=0;i<Recode_Count;i++)
{
eeprom_busy_wait();
Information_Id1[i]=eeprom_read_byte(Id1_Eeprom+i);
eeprom_busy_wait();
Information_Id2[i]=eeprom_read_byte(Id2_Eeprom+i);
eeprom_busy_wait();
Information_Key[i]=eeprom_read_byte(Key_Eeprom+i);
eeprom_busy_wait();
Information_Path[i]=eeprom_read_byte(Path_Eeprom+i);
eeprom_busy_wait();
Information_Path2[i]=eeprom_read_byte(Path2_Eeprom+i);
}
for(i=0;i<4;i++) //-------------設(shè)備名稱
{
eeprom_busy_wait();
mName[i]=eeprom_read_byte(LeftNM_Eeprom+i);
}
//--------------設(shè)備ID號(hào)
eeprom_busy_wait(); mID[0]=eeprom_read_byte(&ID_HEeprom);
eeprom_busy_wait(); mID[1]=eeprom_read_byte(&ID_LEeprom);
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -