Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mvme68k/dev Allow a degree of tolerance when calcul...



details:   https://anonhg.NetBSD.org/src/rev/ed18acbb7d59
branches:  trunk
changeset: 499383:ed18acbb7d59
user:      scw <scw%NetBSD.org@localhost>
date:      Sat Nov 18 22:34:25 2000 +0000

description:
Allow a degree of tolerance when calculating the baudrate timing constant.

diffstat:

 sys/arch/mvme68k/dev/zs.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (20 lines):

diff -r 24ecc53c87b2 -r ed18acbb7d59 sys/arch/mvme68k/dev/zs.c
--- a/sys/arch/mvme68k/dev/zs.c Sat Nov 18 20:46:28 2000 +0000
+++ b/sys/arch/mvme68k/dev/zs.c Sat Nov 18 22:34:25 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zs.c,v 1.22 2000/09/06 19:51:44 scw Exp $      */
+/*     $NetBSD: zs.c,v 1.23 2000/11/18 22:34:25 scw Exp $      */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -324,8 +324,8 @@
        /* Convert back to make sure we can do it. */
        real_bps = TCONST_TO_BPS(cs->cs_brg_clk, tconst);
 
-       /* XXX - Allow some tolerance here? */
-       if (real_bps != bps)
+       /* Allow 2% tolerance WRT the required bps */
+       if (((abs(real_bps - bps) * 1000) / bps) != bps)
                return (EINVAL);
 
        cs->cs_preg[12] = tconst;



Home | Main Index | Thread Index | Old Index