mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +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");
|
||||
}),
|
||||
Some(TimeOp::HwSync) => {
|
||||
start_rtc_secs = llio.get_rtc_secs().expect("couldn't read RTC offset value");
|
||||
start_tt_ms = tt.elapsed_ms();
|
||||
match llio.get_rtc_secs() {
|
||||
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, _, _, _, _, {
|
||||
let t =
|
||||
|
|
|
|||
Loading…
Reference in a new issue