From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oliver Hartkopp Subject: Re: [PATCH] cansniffer: increase resolution for timeout values Date: Tue, 24 Jun 2014 21:39:36 +0200 Message-ID: <53A9D3F8.7050504@hartkopp.net> References: <1403638263-4019-1-git-send-email-socketcan@hartkopp.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.161]:22433 "EHLO mo4-p00-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750925AbaFXTjj (ORCPT ); Tue, 24 Jun 2014 15:39:39 -0400 In-Reply-To: <1403638263-4019-1-git-send-email-socketcan@hartkopp.net> Sender: linux-can-owner@vger.kernel.org List-ID: To: linux-can@vger.kernel.org Cc: Marc Kleine-Budde , Felix Seitz Applied and pushed to master. Tnx Oliver On 24.06.2014 21:31, Oliver Hartkopp wrote: > 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