From daf966eaa629d59487b57f907b62f642995d829e Mon Sep 17 00:00:00 2001 From: Astrid Smith Date: Fri, 28 Oct 2011 21:44:42 -0700 Subject: Calibrator, version that works (kind of) with milliseconds --- host/client.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'host/client.c') diff --git a/host/client.c b/host/client.c index 17f3fba..3752800 100644 --- a/host/client.c +++ b/host/client.c @@ -7,8 +7,13 @@ #include #include +// window for frequency averaging, in cycles #define QUEUE 3600 +// window for reporting, in cycles +#define REPORT_FREQ 60 +// width of the bargraph #define WIDTH 40 +// timer cycles per second #define SCALE 1000000 int main(int *argc, char **argv) @@ -57,7 +62,7 @@ int main(int *argc, char **argv) line[position] = '.'; } - if (counter % 60 == 0) { + if (counter % REPORT_FREQ == 0) { if (pos_avg > WIDTH) { line[WIDTH] = '_'; } else if (pos_avg < 0) { -- cgit v1.2.3