From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oliver Hartkopp Subject: [PATCH] cansniffer: increase resolution for timeout values Date: Tue, 24 Jun 2014 21:31:03 +0200 Message-ID: <1403638263-4019-1-git-send-email-socketcan@hartkopp.net> Return-path: Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.162]:57762 "EHLO mo4-p00-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750762AbaFXTbO (ORCPT ); Tue, 24 Jun 2014 15:31:14 -0400 Sender: linux-can-owner@vger.kernel.org List-ID: To: linux-can@vger.kernel.org Cc: Oliver Hartkopp From: Marc Kleine-Budde As requested by Felix Seitz the timeout for screen updates should be configurable to values smaller than 100ms. Marc Kleine-Budde provided the original patch to increase the resolution of the timing relevant variables. The rotating animation was replaced by a rolling screen update counter. Additionally the CAN-ID is now printed in the same ASCII hex representation as the CAN data. Signed-off-by: Oliver Hartkopp --- cansniffer.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/cansniffer.c b/cansniffer.c index c8ee58e..39b3e2b 100644 --- a/cansniffer.c +++ b/cansniffer.c @@ -86,16 +86,13 @@ /* time defaults */ -#define TIMEOUT 50 /* in 100ms */ -#define HOLD 10 /* in 100ms */ -#define LOOP 2 /* in 100ms */ - -#define MAXANI 8 -const char anichar[MAXANI] = {'|', '/', '-', '\\', '|', '/', '-', '\\'}; +#define TIMEOUT 500 /* in 10ms */ +#define HOLD 100 /* in 10ms */ +#define LOOP 20 /* in 10ms */ #define ATTCOLOR ATTBOLD FGRED -#define STARTLINESTR "X time ID data ... " +#define STARTLINESTR "XX delta ID data ... " struct snif { int flags; @@ -172,9 +169,9 @@ void print_usage(char *prg) fprintf(stderr, " -B (start with binary mode with gap - exceeds 80 chars!)\n"); fprintf(stderr, " -c (color changes)\n"); fprintf(stderr, " -f (filter on CAN-ID only)\n"); - fprintf(stderr, " -t