ý của hungnp là như vầy đúng ko:
eeprom unsigned char first;
void main(void)
{
unsigned char h,m,s,x,y;
i2c_init();
lcd_init(16);
if (!first)
{
rtc_init(0,0,0);
i2c_start();
i2c_write(0xd0);
i2c_write(0);
i2c_write(0);
i2c_stop();
rtc_set_time(20,58,0);
first=1;
}
.....
eeprom unsigned char first;
void main(void)
{
unsigned char h,m,s,x,y;
i2c_init();
lcd_init(16);
if (!first)
{
rtc_init(0,0,0);
i2c_start();
i2c_write(0xd0);
i2c_write(0);
i2c_write(0);
i2c_stop();
rtc_set_time(20,58,0);
first=1;
}
.....
Comment