Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Revert back to a 16 bit phase counter - stops overfl...
details: https://anonhg.NetBSD.org/src/rev/720132f66f50
branches: trunk
changeset: 824614:720132f66f50
user: nat <nat%NetBSD.org@localhost>
date: Sun Jun 11 13:05:43 2017 +0000
description:
Revert back to a 16 bit phase counter - stops overflow when performing
calculations on pitch and phase.
diffstat:
sys/dev/audiobell.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diffs (45 lines):
diff -r 01c60a6aabe5 -r 720132f66f50 sys/dev/audiobell.c
--- a/sys/dev/audiobell.c Sun Jun 11 13:02:44 2017 +0000
+++ b/sys/dev/audiobell.c Sun Jun 11 13:05:43 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: audiobell.c,v 1.21 2017/06/11 13:02:44 nat Exp $ */
+/* $NetBSD: audiobell.c,v 1.22 2017/06/11 13:05:43 nat Exp $ */
/*
@@ -32,7 +32,7 @@
*/
#include <sys/types.h>
-__KERNEL_RCSID(0, "$NetBSD: audiobell.c,v 1.21 2017/06/11 13:02:44 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audiobell.c,v 1.22 2017/06/11 13:05:43 nat Exp $");
#include <sys/audioio.h>
#include <sys/conf.h>
@@ -54,7 +54,7 @@
/* 44.1 kHz should reduce hum at higher pitches. */
#define BELL_SAMPLE_RATE 44100
-#define BELL_SHIFT 19
+#define BELL_SHIFT 3
static inline void
audiobell_expandwave(int16_t *buf)
@@ -75,7 +75,7 @@
*/
static inline int
audiobell_synthesize(int16_t *buf, u_int pitch, u_int period, u_int volume,
- uint32_t *phase)
+ uint16_t *phase)
{
int16_t *wave;
@@ -99,7 +99,7 @@
audiobell(void *v, u_int pitch, u_int period, u_int volume, int poll)
{
int16_t *buf;
- uint32_t phase;
+ uint16_t phase;
struct audio_info ai;
struct uio auio;
struct iovec aiov;
Home |
Main Index |
Thread Index |
Old Index