From f5d8b746903f5367297004175baffffdc7d01824 Mon Sep 17 00:00:00 2001 From: phk Date: Wed, 26 Mar 2008 22:02:51 +0000 Subject: Further cleanup of sound generation in syscons: The timer_spkr_*() functions take care of the enabling/disabling of the speaker. Test on the existence of timer_spkr_*() functions, rather than architectures. --- sys/isa/syscons_isa.c | 10 +--------- sys/pc98/cbus/syscons_cbus.c | 8 -------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/sys/isa/syscons_isa.c b/sys/isa/syscons_isa.c index 035280f..af43a67 100644 --- a/sys/isa/syscons_isa.c +++ b/sys/isa/syscons_isa.c @@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include @@ -272,18 +270,12 @@ sc_get_bios_values(bios_values_t *values) int sc_tone(int herz) { -#if defined(__i386__) || defined(__amd64__) +#if defined(HAS_TIMER_SPKR) if (herz) { - /* set command for counter 2, 2 byte write */ if (timer_spkr_acquire()) return EBUSY; - /* set pitch */ timer_spkr_setfreq(herz); - /* enable counter 2 output to speaker */ - ppi_spkr_on(); } else { - /* disable counter 2 output to speaker */ - ppi_spkr_off(); timer_spkr_release(); } #endif diff --git a/sys/pc98/cbus/syscons_cbus.c b/sys/pc98/cbus/syscons_cbus.c index c23fbc4..9f42f39 100644 --- a/sys/pc98/cbus/syscons_cbus.c +++ b/sys/pc98/cbus/syscons_cbus.c @@ -38,8 +38,6 @@ #include #include -#include -#include #include @@ -227,16 +225,10 @@ sc_tone(int herz) { if (herz) { - /* enable counter 1 */ - ppi_spkr_on(); - /* set command for counter 1, 2 byte write */ if (timer_spkr_acquire()) return EBUSY; - /* set pitch */ timer_spkr_setfreq(herz); } else { - /* disable counter 1 */ - ppi_spkr_off(); timer_spkr_release(); } return 0; -- cgit v1.1