diff options
Diffstat (limited to 'sys/i386/isa/cy.c')
-rw-r--r-- | sys/i386/isa/cy.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/i386/isa/cy.c b/sys/i386/isa/cy.c index 7ddfbc0..38bac42 100644 --- a/sys/i386/isa/cy.c +++ b/sys/i386/isa/cy.c @@ -27,7 +27,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: cy.c,v 1.63 1998/06/07 17:10:16 dfr Exp $ + * $Id: cy.c,v 1.64 1998/07/15 12:18:12 bde Exp $ */ #include "opt_compat.h" @@ -2482,7 +2482,9 @@ comspeed(speed, prescaler_io) if (divider > 255) divider = 255; actual = CY_CLOCK/prescaler/divider; - error = ((actual - speed) * 2000 / speed + 1) / 2; /* percentage */ + + /* 10 times error in percent: */ + error = ((actual - (long)speed) * 2000 / (long)speed + 1) / 2; /* 3.0% max error tolerance */ if (error < -30 || error > 30) |