Sun Jun 11 03:38:12 2017 UTC ()
Seperate the definitions for the console beep. This code will be shared
with a new device.
Ok pgoyette@.
(nat)
diff -r0 -r1.1 src/sys/dev/wscons/wsbelldata.h
diff -r1.138 -r1.139 src/sys/dev/wscons/wskbd.c
/* $NetBSD: wsbelldata.h,v 1.1 2017/06/11 03:38:12 nat Exp $ */
/*-
* Copyright (c) 2017 Nathanial Sloss <nathanialsloss@yahoo.com.au>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WSKBD_DEFAULT_BELL_PITCH
#define WSKBD_DEFAULT_BELL_PITCH 1500 /* 1500Hz */
#endif
#ifndef WSKBD_DEFAULT_BELL_PERIOD
#define WSKBD_DEFAULT_BELL_PERIOD 100 /* 100ms */
#endif
#ifndef WSKBD_DEFAULT_BELL_VOLUME
#define WSKBD_DEFAULT_BELL_VOLUME 50 /* 50% volume */
#endif
static struct wskbd_bell_data wskbd_default_bell_data = {
WSKBD_BELL_DOALL,
WSKBD_DEFAULT_BELL_PITCH,
WSKBD_DEFAULT_BELL_PERIOD,
WSKBD_DEFAULT_BELL_VOLUME,
};
--- src/sys/dev/wscons/wskbd.c 2016/12/10 22:36:28 1.138
+++ src/sys/dev/wscons/wskbd.c 2017/06/11 03:38:12 1.139
@@ -1,4 +1,4 @@
-/* $NetBSD: wskbd.c,v 1.138 2016/12/10 22:36:28 christos Exp $ */
+/* $NetBSD: wskbd.c,v 1.139 2017/06/11 03:38:12 nat Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@@ -105,7 +105,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.138 2016/12/10 22:36:28 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.139 2017/06/11 03:38:12 nat Exp $");
#ifdef _KERNEL_OPT
#include "opt_ddb.h"
@@ -142,6 +142,7 @@
#include <dev/wscons/wsdisplayvar.h>
#include <dev/wscons/wseventvar.h>
#include <dev/wscons/wscons_callbacks.h>
+#include <dev/wscons/wsbelldata.h>
#ifdef KGDB
#include <sys/kgdb.h>
@@ -311,23 +312,6 @@
.d_kqfilter = wskbdkqfilter,
.d_discard = nodiscard,
.d_flag = D_OTHER
-};
-
-#ifndef WSKBD_DEFAULT_BELL_PITCH
-#define WSKBD_DEFAULT_BELL_PITCH 1500 /* 1500Hz */
-#endif
-#ifndef WSKBD_DEFAULT_BELL_PERIOD
-#define WSKBD_DEFAULT_BELL_PERIOD 100 /* 100ms */
-#endif
-#ifndef WSKBD_DEFAULT_BELL_VOLUME
-#define WSKBD_DEFAULT_BELL_VOLUME 50 /* 50% volume */
-#endif
-
-struct wskbd_bell_data wskbd_default_bell_data = {
- WSKBD_BELL_DOALL,
- WSKBD_DEFAULT_BELL_PITCH,
- WSKBD_DEFAULT_BELL_PERIOD,
- WSKBD_DEFAULT_BELL_VOLUME,
};
#ifdef WSDISPLAY_SCROLLSUPPORT