Updating error messages

This commit is contained in:
Ryan Summers 2020-06-11 18:09:01 +02:00
parent 58bd61afd5
commit 48bd35e1d8
2 changed files with 7 additions and 6 deletions

View File

@ -152,11 +152,12 @@ where
ad9959.interface.configure_mode(desired_mode).map_err(|_| Error::Interface)?;
// Read back the CSR to ensure it specifies the mode correctly.
let mut updated_csr: [u8; 1] = [0];
ad9959.interface.read(Register::CSR as u8, &mut updated_csr).map_err(|_| Error::Interface)?;
if updated_csr[0] != csr[0] {
return Err(Error::Check);
}
// TODO: This is disabled until QSPI readback issues have been resolved.
//let mut updated_csr: [u8; 1] = [0];
//ad9959.interface.read(Register::CSR as u8, &mut updated_csr).map_err(|_| Error::Interface)?;
//if updated_csr[0] != csr[0] {
// return Err(Error::Check);
//}
// Set the clock frequency to configure the device as necessary.
ad9959.configure_system_clock(clock_frequency, multiplier)?;

View File

@ -123,7 +123,7 @@ macro_rules! route_request {
let value = match $getter() {
Ok(data) => data,
Err(_) => return server::Response::error($request.attribute,
"Failed to set attribute"),
"Failed to read attribute"),
};
let encoded_data: String<U256> = match serde_json_core::to_string(&value) {