diff options
author | imp <imp@FreeBSD.org> | 2005-09-25 21:29:32 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2005-09-25 21:29:32 +0000 |
commit | add8494ccf5a9aa94810202202861f80378b7d2e (patch) | |
tree | 58cc7567434699af9d901ac0a0ab8c262f3b1f22 /sys/pccard/pccard_beep.c | |
parent | 7844c3547462f26592f7a7a3a00ee89693fa5862 (diff) | |
download | FreeBSD-src-add8494ccf5a9aa94810202202861f80378b7d2e.zip FreeBSD-src-add8494ccf5a9aa94810202202861f80378b7d2e.tar.gz |
Remove the kernel portion of OLDCARD. I'm working on a replacement
for pccardc dumpcis, but until I'm done with that, I'm leaving pccardc
in place. As such, I'm leaving the .h files in place for the moment.
Diffstat (limited to 'sys/pccard/pccard_beep.c')
-rw-r--r-- | sys/pccard/pccard_beep.c | 138 |
1 files changed, 0 insertions, 138 deletions
diff --git a/sys/pccard/pccard_beep.c b/sys/pccard/pccard_beep.c deleted file mode 100644 index e608dc1..0000000 --- a/sys/pccard/pccard_beep.c +++ /dev/null @@ -1,138 +0,0 @@ -/*- - * pccard noise interface. - * Nate Williams, October 1997. - * This file is in the public domain. - */ -/* $FreeBSD$ */ - -#define OBSOLETE_IN_6 - -#include <sys/param.h> -#include <sys/kernel.h> -#include <sys/systm.h> - -#include <machine/clock.h> - -#include <pccard/driver.h> - -static enum beepstate allow_beep = BEEP_OFF; -static int melody_type = 0; - -#define MAX_TONE_MODE 3 -#define MAX_STATE 4 - -struct tone { - int pitch; - int duration; -}; - -static struct tone silent_beep[] = { - {0, 0} -}; - -static struct tone success_beep[] = { - {1200, 40}, {0, 0} -}; -static struct tone failure_beep[] = { - {3200, 40}, {0, 0} -}; -static struct tone insert_remove_beep[] = { - {1600, 20}, {0, 0} -}; - -static struct tone success_melody_beep[] = { - {1200, 7}, {1000, 7}, { 800, 15}, {0, 0} -}; -static struct tone failure_melody_beep[] = { - {2000, 7}, {2400, 7}, {2800, 15}, {0, 0} -}; -static struct tone insert_melody_beep[] = { - {1600, 10}, {1200, 5}, {0, 0} -}; -static struct tone remove_melody_beep[] = { - {1200, 10}, {1600, 5}, {0, 0} -}; - -static struct tone *melody_table[MAX_TONE_MODE][MAX_STATE] = { - { /* silent mode */ - silent_beep, silent_beep, silent_beep, silent_beep, - }, - { /* simple beep mode */ - success_beep, failure_beep, - insert_remove_beep, insert_remove_beep, - }, - { /* melody beep mode */ - success_melody_beep, failure_melody_beep, - insert_melody_beep, remove_melody_beep, - }, -}; - - -static void -pccard_beep_sub(void *arg) -{ - struct tone *melody; - melody = (struct tone *)arg; - - if (melody->pitch != 0) { - sysbeep(melody->pitch, (melody->duration * hz + 99) / 100); - timeout(pccard_beep_sub, melody + 1, - (melody->duration * hz + 99) / 100); - } else - allow_beep = BEEP_ON; -} - -static void -pccard_beep_start(void *arg) -{ - struct tone *melody; - melody = (struct tone *)arg; - - if (allow_beep == BEEP_ON && melody->pitch != 0) { - allow_beep = BEEP_OFF; - sysbeep(melody->pitch, (melody->duration * hz + 99) / 100); - timeout(pccard_beep_sub, melody + 1, - (melody->duration * hz + 99) / 100); - } -} - -void -pccard_success_beep(void) -{ - pccard_beep_start(melody_table[melody_type][0]); -} - -void -pccard_failure_beep(void) -{ - pccard_beep_start(melody_table[melody_type][1]); -} - -void -pccard_insert_beep(void) -{ - pccard_beep_start(melody_table[melody_type][2]); -} - -void -pccard_remove_beep(void) -{ - pccard_beep_start(melody_table[melody_type][3]); -} - -int -pccard_beep_select(int type) -{ - int errcode = 0; - - if (type == 0) { - allow_beep = BEEP_OFF; - melody_type = 0; - } else if (type < 0 || MAX_TONE_MODE - 1 < type) { - errcode = 1; - } else { - allow_beep = BEEP_ON; - melody_type = type; - } - return (errcode); -} |