From 53d5339c6604b0e3a8981c093e6484f705dd2b18 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Wed, 11 Jul 2012 17:31:41 +1000 Subject: [PATCH] Remove the lower limit on count rate for simulated hardware r3640 | dcl | 2012-07-11 17:31:41 +1000 (Wed, 11 Jul 2012) | 1 line --- site_ansto/hardsup/Monitor/hware.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/site_ansto/hardsup/Monitor/hware.c b/site_ansto/hardsup/Monitor/hware.c index 58802f7d..13819519 100644 --- a/site_ansto/hardsup/Monitor/hware.c +++ b/site_ansto/hardsup/Monitor/hware.c @@ -926,10 +926,10 @@ int hware_read(pHWARE hware, unsigned long long* value) gettimeofday(&this_time, NULL); delta_time = (this_time.tv_sec + 1e-6 * this_time.tv_usec) - (hware->last_time.tv_sec + 1e-6 * hware->last_time.tv_usec); - delta_count = (long long)(0.5 + delta_time * hware->source); + delta_count = (long long)(0.5 + 1000 * delta_time * hware->source); hware->count64 += delta_count; hware->last_time = this_time; - *value = hware->count64; + *value = hware->count64 / 1000; return 0; } int hware_source(pHWARE hware, int value) @@ -952,10 +952,7 @@ int hware_source(pHWARE hware, int value) hware->source = 80000000; break; default: - if (value < 1000) - hware->source = 1000; - else - hware->source = value; + hware->source = value; break; } #if 0 /* DEBUG */