From 5aa9a079d029cf6e63c4c8cf787585517c65a095 Mon Sep 17 00:00:00 2001 From: mjc Date: Sat, 1 Jan 2000 00:11:30 +0900 Subject: self-cal needs at least 2 periods for PW cal measurement time --- device-functions.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/device-functions.c b/device-functions.c index b6df2af..83a384f 100644 --- a/device-functions.c +++ b/device-functions.c @@ -4154,24 +4154,24 @@ int I2C_Self_Cal(int channel, int meas_mode, float *meas, float target_time) measuring_time = 1.0; - min_time = globals.ChannelState[channel].pw * 3.0; + min_time = 3.0 * globals.ChannelState[channel].pw; if (min_time > measuring_time) { measuring_time = min_time; } - min_time = (1.0/globals.ChannelState[channel].frequency); + min_time = 2.0 / globals.ChannelState[channel].frequency; if (min_time > measuring_time) { measuring_time = min_time; } if (meas_mode == MEAS_PRF) { - min_time = (1.0/globals.ChannelState[channel].frequency) * 3.0; + min_time = 3.0 / globals.ChannelState[channel].frequency; if (min_time > measuring_time) { measuring_time = min_time; } } - min_time = fabs(globals.ChannelState[channel].delay) * 3.0; + min_time = 3.0 * fabs(globals.ChannelState[channel].delay); if (min_time > measuring_time) { measuring_time = min_time; } -- cgit