HomeFreeBSD

owc_gpiobus_read_data: compare times in sbintime_t units

Description

owc_gpiobus_read_data: compare times in sbintime_t units

Previously the code used sbttous() before microseconds comparison in one
place, sbttons() and nanoseconds in another, division by SBT_1US and
microseconds in yet another.

Now the code consistently uses multiplication by SBT_1US to convert
microseconds to sbintime_t before comparing them with periods between
calls to sbinuptime(). This is fast, this is precise enough (below
0.03%) and the periods defined by the protocol cannot overflow.

Reviewed by: imp (D22108)
MFC after: 2 weeks

Details

Provenance
avgAuthored on
Parents
rS354075: MFC r353454: Allocate device softc from the device domain.
Branches
Unknown
Tags
Unknown