From 4bbdd43bdfd68c272750cd9d4e507ba75369ff15 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 27 Jun 2018 17:32:56 +0800 Subject: [PATCH] hmc7043: do not freeze if SYSREF slip fails --- artiq/firmware/libboard_artiq/hmc830_7043.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/artiq/firmware/libboard_artiq/hmc830_7043.rs b/artiq/firmware/libboard_artiq/hmc830_7043.rs index a2c4a644f..1446d9cbb 100644 --- a/artiq/firmware/libboard_artiq/hmc830_7043.rs +++ b/artiq/firmware/libboard_artiq/hmc830_7043.rs @@ -366,11 +366,19 @@ pub mod hmc7043 { while sysref_sample() { sysref_slip(); slips0 += 1; + if slips0 > 1024 { + error!(" failed to reach 1->0 transition"); + break; + } } // get to the edge of the 0->1 transition (our final setpoint) while !sysref_sample() { sysref_slip(); slips1 += 1; + if slips1 > 1024 { + error!(" failed to reach 0->1 transition"); + break; + } } info!(" ...done ({}/{} slips), verifying timing margin", slips0, slips1);