Date: Fri, 8 Nov 2019 07:36:51 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354530 - stable/12/sys/dev/ow Message-ID: <201911080736.xA87apnD057408@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Fri Nov 8 07:36:51 2019 New Revision: 354530 URL: https://svnweb.freebsd.org/changeset/base/354530 Log: MFC r354076: owc_gpiobus_read_data: compare times in sbintime_t units Modified: stable/12/sys/dev/ow/owc_gpiobus.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/ow/owc_gpiobus.c ============================================================================== --- stable/12/sys/dev/ow/owc_gpiobus.c Fri Nov 8 07:35:32 2019 (r354529) +++ stable/12/sys/dev/ow/owc_gpiobus.c Fri Nov 8 07:36:51 2019 (r354530) @@ -296,10 +296,10 @@ owc_gpiobus_read_data(device_t dev, struct ow_timing * do { now = sbinuptime(); GETPIN(sc, &sample); - } while (sbttous(now - then) < t->t_rdv + 2 && sample == 0); + } while (now - then < (t->t_rdv + 2) * SBT_1US && sample == 0); critical_exit(); - if (sbttons(now - then) < t->t_rdv * 1000) + if (now - then < t->t_rdv * SBT_1US) *bit = 1; else *bit = 0; @@ -307,7 +307,7 @@ owc_gpiobus_read_data(device_t dev, struct ow_timing * /* Wait out the rest of t_slot */ do { now = sbinuptime(); - } while ((now - then) / SBT_1US < t->t_slot); + } while (now - then < t->t_slot * SBT_1US); RELBUS(sc);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911080736.xA87apnD057408>