1
0
Fork 0

firmware: improve RTIO map error reporting

This commit is contained in:
Sebastien Bourdeauducq 2023-04-04 11:17:26 +08:00
parent b747abe83c
commit 271a1adb04
1 changed files with 3 additions and 3 deletions

View File

@ -535,8 +535,8 @@ fn read_device_map(cfg: &Config) -> BTreeMap<u32, String> {
let channel = bytes_cr.read_u32().unwrap(); let channel = bytes_cr.read_u32().unwrap();
let device_name = bytes_cr.read_string().unwrap(); let device_name = bytes_cr.read_string().unwrap();
if let Some(old_entry) = device_map.insert(channel, device_name.clone()) { if let Some(old_entry) = device_map.insert(channel, device_name.clone()) {
error!( warn!(
"read_device_map: conflicting entries for channel {}: `{}` and `{}`", "conflicting device map entries for RTIO channel {}: '{}' and '{}'",
channel, old_entry, device_name channel, old_entry, device_name
); );
} }
@ -544,7 +544,7 @@ fn read_device_map(cfg: &Config) -> BTreeMap<u32, String> {
Ok(()) Ok(())
}) })
.or_else(|err| { .or_else(|err| {
error!("read_device_map: error reading `device_map` from config: {}", err); warn!("error reading device map ({}), device names will not be available in RTIO error messages", err);
Err(err) Err(err)
}); });
device_map device_map