mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
have time server retry on I2C error
This commit is contained in:
parent
d67c5d53fb
commit
77baf89d5c
1 changed files with 13 additions and 2 deletions
|
|
@ -287,8 +287,19 @@ pub fn start_time_server() {
|
||||||
).expect("couldn't queue sync request");
|
).expect("couldn't queue sync request");
|
||||||
}),
|
}),
|
||||||
Some(TimeOp::HwSync) => {
|
Some(TimeOp::HwSync) => {
|
||||||
start_rtc_secs = llio.get_rtc_secs().expect("couldn't read RTC offset value");
|
match llio.get_rtc_secs() {
|
||||||
start_tt_ms = tt.elapsed_ms();
|
Ok(val) => {
|
||||||
|
start_rtc_secs = val;
|
||||||
|
start_tt_ms = tt.elapsed_ms();
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
log::warn!("Error syncing time: {:?}; retrying!", e);
|
||||||
|
tt.sleep_ms(82).unwrap();
|
||||||
|
send_message(self_cid,
|
||||||
|
Message::new_scalar(TimeOp::HwSync.to_usize().unwrap(), 0, 0, 0, 0)
|
||||||
|
).expect("couldn't queue sync request");
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
Some(TimeOp::GetUtcTimeMs) => xous::msg_blocking_scalar_unpack!(msg, _, _, _, _, {
|
Some(TimeOp::GetUtcTimeMs) => xous::msg_blocking_scalar_unpack!(msg, _, _, _, _, {
|
||||||
let t =
|
let t =
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue