mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-28 12:48:26 +08:00
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> {
|
||||
for i in 0..99 {
|
||||
let mut attempt = 0;
|
||||
loop {
|
||||
attempt += 1;
|
||||
dac_reset(dacno);
|
||||
let outcome = dac_cfg(dacno);
|
||||
match 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) {
|
||||
|
Loading…
Reference in New Issue
Block a user