Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/wscons PR/7665: Dave Sainty: X server bell pitch set...



details:   https://anonhg.NetBSD.org/src/rev/ca5bdfa728d0
branches:  trunk
changeset: 473347:ca5bdfa728d0
user:      christos <christos%NetBSD.org@localhost>
date:      Sun May 30 04:21:29 1999 +0000

description:
PR/7665: Dave Sainty: X server bell pitch setting doesn't reflect reality
Applied with a little more error checking.

diffstat:

 sys/dev/wscons/wsdisplay_compat_usl.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r 1d1f6c36fd30 -r ca5bdfa728d0 sys/dev/wscons/wsdisplay_compat_usl.c
--- a/sys/dev/wscons/wsdisplay_compat_usl.c     Sun May 30 02:37:10 1999 +0000
+++ b/sys/dev/wscons/wsdisplay_compat_usl.c     Sun May 30 04:21:29 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay_compat_usl.c,v 1.7 1999/01/29 22:24:24 drochner Exp $ */
+/* $NetBSD: wsdisplay_compat_usl.c,v 1.8 1999/05/30 04:21:29 christos Exp $ */
 
 /*
  * Copyright (c) 1998
@@ -437,9 +437,15 @@
                req = WSKBDIO_COMPLEXBELL;
 #define d (*(int *)data)
                if (d) {
-                       bd.which = WSKBD_BELL_DOPITCH | WSKBD_BELL_DOPERIOD;
-                       bd.pitch = d & 0xffff; /* Hz */
-                       bd.period = d >> 16; /* ms */
+#define PCVT_SYSBEEPF  1193182
+                       if (d >> 16) {
+                               bd.which = WSKBD_BELL_DOPERIOD;
+                               bd.period = d >> 16; /* ms */
+                       }
+                       if (d & 0xffff) {
+                               bd.which |= WSKBD_BELL_DOPITCH;
+                               bd.pitch = PCVT_SYSBEEPF/(d & 0xffff); /* Hz */
+                       }
                } else
                        bd.which = 0; /* default */
 #undef d



Home | Main Index | Thread Index | Old Index