Describe and use one more constant

This commit is contained in:
Pierre Pronchery 2018-07-17 13:33:41 +02:00
parent 0ca35efa15
commit fcbbdfa986
2 changed files with 3 additions and 1 deletions

View File

@ -124,7 +124,7 @@ static int _get_time_do(ukBus * bus, unsigned char * day, unsigned char * month,
for(i = 0; i < tries; i++)
if(bus->read8(bus, CMOS_REGISTER_STATUS0, &status) != 0)
return -1;
else if((status & 0x80) == 0x00)
else if((status & CMOS_STATUS0_UPDATING) == 0x00)
break;
if(i == tries)
return -1;

View File

@ -22,6 +22,8 @@
# define CMOS_HOUR_PM 0x80
# define CMOS_STATUS0_UPDATING 0x80
# define CMOS_STATUS1_24HOUR 0x02
# define CMOS_STATUS1_BINARY_MODE 0x04