forked from M-Labs/artiq
firmware: reduce number of DAC initialization attempts
Faster startup when one DAC is broken.
This commit is contained in:
parent
1d594d0c97
commit
eb3259b847
|
@ -672,15 +672,21 @@ fn dac_cfg(dacno: u8) -> Result<(), &'static str> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn dac_cfg_retry(dacno: u8) -> Result<(), &'static str> {
|
fn dac_cfg_retry(dacno: u8) -> Result<(), &'static str> {
|
||||||
for i in 0..99 {
|
let mut attempt = 0;
|
||||||
|
loop {
|
||||||
|
attempt += 1;
|
||||||
dac_reset(dacno);
|
dac_reset(dacno);
|
||||||
let outcome = dac_cfg(dacno);
|
let outcome = dac_cfg(dacno);
|
||||||
match outcome {
|
match outcome {
|
||||||
Ok(_) => return outcome,
|
Ok(_) => return outcome,
|
||||||
Err(e) => warn!("AD9154-{} config attempt #{} failed ({}), retrying", dacno, i, e)
|
Err(e) => {
|
||||||
|
warn!("AD9154-{} config attempt #{} failed ({})", dacno, attempt, e);
|
||||||
|
if attempt >= 10 {
|
||||||
|
return outcome;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dac_cfg(dacno)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn dac_sysref_scan(dacno: u8) {
|
fn dac_sysref_scan(dacno: u8) {
|
||||||
|
|
Loading…
Reference in New Issue