From eed77bd2970a00d1394ed027ceca5b646e4671ce Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 17 Jun 2020 18:31:46 +0200 Subject: Started rewrite --- src/kernel/sound/frequency.c | 34 ---------------------------------- src/kernel/sound/sound.h | 13 ------------- 2 files changed, 47 deletions(-) delete mode 100644 src/kernel/sound/frequency.c delete mode 100644 src/kernel/sound/sound.h (limited to 'src/kernel/sound') diff --git a/src/kernel/sound/frequency.c b/src/kernel/sound/frequency.c deleted file mode 100644 index caa4b07..0000000 --- a/src/kernel/sound/frequency.c +++ /dev/null @@ -1,34 +0,0 @@ -#include -#include -#include - -void play_sound(u32 frequency) -{ - u32 divided; - u8 tmp; - - divided = 1193180 / frequency; - outb(0x43, 0xb6); - outb(0x42, (u8)(divided)); - outb(0x42, (u8)(divided >> 8)); - - tmp = inb(0x61); - if (tmp != (tmp | 3)) { - outb(0x61, (u8)(tmp | 3)); - } -} - -static void shut_up() -{ - u8 tmp = (u8)(inb(0x61) & 0xFC); - - outb(0x61, tmp); -} - -// Make a beep -void beep(u32 frequency, u32 ticks) -{ - play_sound(frequency); - timer_wait((int)ticks); - shut_up(); -} \ No newline at end of file diff --git a/src/kernel/sound/sound.h b/src/kernel/sound/sound.h deleted file mode 100644 index 001ef92..0000000 --- a/src/kernel/sound/sound.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef MELVIX_SOUND_H -#define MELVIX_SOUND_H - -#include - -/** - * Beep in specific frequency for amount of ticks - * @param frequency The frequency of the beep - * @param ticks The duration in ticks - */ -void beep(u32 frequency, u32 ticks); - -#endif \ No newline at end of file -- cgit v1.2.3