📄 bun_sav.c
字号:
/**------------------------------------------------------------------------
BUTTON_PLS.C
Fireware for XYYQ demo board
Copyright 2000 Xingyuan Instrument and equipment Co.,Ltd
-------------------------------------------------------------------------*/
#include <reg51.h>
#include "demo.h"
void ButtonSave(void)
{
BYTE i;
//value 0
I2C_SendByteWithStart(EEPROMWRITEID);
I2C_SendByte(0);
for(i=0; i<16;i++)
{
I2C_SendByte(Userdate.value0.bytes[i]);
ShortDelay(5);
}
I2C_SendStop();
I2C_ReleaseBus();
ShortDelay(500);
I2C_SendByteWithStart(EEPROMWRITEID);
I2C_SendByte(16);
for(i=16; i<32; i++)
{
I2C_SendByte(Userdate.value0.bytes[i]);
ShortDelay(5);
}
I2C_SendStop();
I2C_ReleaseBus();
ShortDelay(500);
//value 1
I2C_SendByteWithStart(EEPROMWRITEID);
I2C_SendByte(32);
for(i=0; i<8; i++)
{
I2C_SendByte(Userdate.value1.bytes[i]);
ShortDelay(5);
}
I2C_SendStop();
I2C_ReleaseBus();
ShortDelay(500);
//value 2
I2C_SendByteWithStart(EEPROMWRITEID);
I2C_SendByte(48);
for(i=0; i<8; i++)
{
I2C_SendByte(Userdate.value2.bytes[i]);
ShortDelay(5);
}
for(i=0; i<8; i++)
{
I2C_SendByte(Userdate.value3.bytes[i]);
ShortDelay(5);
}
I2C_SendStop();
I2C_ReleaseBus();
ShortDelay(500);
//////////////////////add new 3500 and 3106////////////
I2C_SendByteWithStart(EEPROMWRITEID);
I2C_SendByte(64);
for(i=0; i<8;i++)
{
I2C_SendByte(Userdate.value4.bytes[i]);
ShortDelay(5);
}
I2C_SendStop();
I2C_ReleaseBus();
DefaultOnLED();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -