Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/wscons Fix the bell period.



details:   https://anonhg.NetBSD.org/src/rev/0934bf9a21d3
branches:  trunk
changeset: 998429:0934bf9a21d3
user:      isaki <isaki%NetBSD.org@localhost>
date:      Thu Apr 18 14:01:28 2019 +0000

description:
Fix the bell period.

diffstat:

 sys/dev/wscons/wsbell.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (40 lines):

diff -r f53651a17c04 -r 0934bf9a21d3 sys/dev/wscons/wsbell.c
--- a/sys/dev/wscons/wsbell.c   Thu Apr 18 13:01:38 2019 +0000
+++ b/sys/dev/wscons/wsbell.c   Thu Apr 18 14:01:28 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsbell.c,v 1.10 2019/04/18 13:01:38 isaki Exp $ */
+/* $NetBSD: wsbell.c,v 1.11 2019/04/18 14:01:28 isaki Exp $ */
 
 /*-
  * Copyright (c) 2017 Nathanial Sloss <nathanialsloss%yahoo.com.au@localhost>
@@ -107,7 +107,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsbell.c,v 1.10 2019/04/18 13:01:38 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsbell.c,v 1.11 2019/04/18 14:01:28 isaki Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "wsmux.h"
@@ -424,7 +424,11 @@
                }
 
                tone.frequency = vb->pitch;
-               tone.duration = vb->period;
+               /*
+                * period (derived from wskbd) is in msec.
+                * duration (derived from spkr) is in units of 10msec.
+                */
+               tone.duration = vb->period / 10;
                vol = vb->volume;
                mutex_exit(&sc->sc_bellock);
 
@@ -442,7 +446,7 @@
 
        mutex_enter(&sc->sc_bellock);
        sc->sc_bell_args.pitch = pitch;
-       sc->sc_bell_args.period = period / 5;
+       sc->sc_bell_args.period = period;
        sc->sc_bell_args.volume = volume;
 
        cv_broadcast(&sc->sc_bellcv);



Home | Main Index | Thread Index | Old Index