PCF65263: Correct readback verification of seconds register

This commit is contained in:
Gregory Nutt
2015-12-21 14:00:25 -06:00
parent 1e96a07346
commit a696b807fb
2 changed files with 6 additions and 3 deletions
+1 -1
Submodule arch updated: f9a3a1463b...a8666b5bb6
+5 -2
View File
@@ -408,6 +408,7 @@ int up_rtc_settime(FAR const struct timespec *tp)
struct tm newtm;
time_t newtime;
uint8_t buffer[9];
uint8_t cmd;
uint8_t seconds;
int ret;
@@ -449,7 +450,7 @@ int up_rtc_settime(FAR const struct timespec *tp)
rtc_dumptime(&tm, "New time");
/* Construct the message */
/* Write starting with the seconds regiser */
/* Write starting with the 100ths of seconds register */
buffer[0] = PCF85263_RTC_100TH_SECONDS;
@@ -498,9 +499,11 @@ int up_rtc_settime(FAR const struct timespec *tp)
/* Read back the seconds register */
cmd = PCF85263_RTC_SECONDS;
msg[1].addr = PCF85263_I2C_ADDRESS;
msg[1].flags = 0;
msg[1].buffer = buffer;
msg[1].buffer = &cmd;
msg[1].length = 1;
msg[2].addr = PCF85263_I2C_ADDRESS;