forked from M-Labs/artiq
1
0
Fork 0

jesd204sync: fix max_phase_deviation

This commit is contained in:
Sebastien Bourdeauducq 2019-01-28 18:38:18 +08:00
parent b9e3fab49c
commit eebff6d77f
1 changed files with 1 additions and 1 deletions

View File

@ -164,7 +164,7 @@ fn measure_sysref_sh_limits() -> Result<SysrefShLimits, &'static str> {
fn max_phase_deviation(average: i32, phases: &[i32]) -> i32 { fn max_phase_deviation(average: i32, phases: &[i32]) -> i32 {
let mut ret = 0; let mut ret = 0;
for phase in phases.iter() { for phase in phases.iter() {
let deviation = (phase - average).abs(); let deviation = (phase - average + DDMTD_N) % DDMTD_N;
if deviation > ret { if deviation > ret {
ret = deviation; ret = deviation;
} }