canbus fix and ota adjustments

This commit is contained in:
2026-03-15 20:28:53 +01:00
parent 2d2d7d16cd
commit 02c9486e98
5 changed files with 11 additions and 18 deletions

View File

@@ -269,16 +269,16 @@ impl Esp<'_> {
let ntp_addrs = stack
.dns_query(NTP_SERVER, DnsQueryType::A)
.await
.expect("Failed to resolve DNS");
if ntp_addrs.is_empty() {
.await;
if ntp_addrs.is_err() {
bail!("Failed to resolve DNS");
}
info!("NTP server: {ntp_addrs:?}");
let ntp = ntp_addrs.unwrap()[0];
info!("NTP server: {ntp:?}");
let mut counter = 0;
loop {
let addr: IpAddr = ntp_addrs[0].into();
let addr: IpAddr = ntp.into();
let timeout = get_time(SocketAddr::from((addr, 123)), &socket, context)
.with_timeout(Duration::from_millis((_max_wait_ms / 10) as u64))
.await;