From bb57b124d1bb385d41747f50be7dd4f3625539c1 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 24 Nov 2019 23:34:32 +0100 Subject: Major coding style reformatting -> Kernighan & Ritchie This project now (hopefully) uses the same style recommended by Kernighan and Ritchie and used in the Linux Kernel --- src/kernel/sound/frequency.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src/kernel/sound/frequency.c') diff --git a/src/kernel/sound/frequency.c b/src/kernel/sound/frequency.c index 2a88446..5ad76b3 100644 --- a/src/kernel/sound/frequency.c +++ b/src/kernel/sound/frequency.c @@ -2,29 +2,32 @@ #include #include -void play_sound(uint32_t frequency) { +void play_sound(uint32_t frequency) +{ uint32_t divided; uint8_t tmp; divided = 1193180 / frequency; - send_b(0x43, 0xb6); - send_b(0x42, (uint8_t) (divided)); - send_b(0x42, (uint8_t) (divided >> 8)); + outb(0x43, 0xb6); + outb(0x42, (uint8_t) (divided)); + outb(0x42, (uint8_t) (divided >> 8)); - tmp = receive_b(0x61); + tmp = inb(0x61); if (tmp != (tmp | 3)) { - send_b(0x61, tmp | 3); + outb(0x61, tmp | 3); } } -static void shut_up() { - uint8_t tmp = receive_b(0x61) & 0xFC; +static void shut_up() +{ + uint8_t tmp = inb(0x61) & 0xFC; - send_b(0x61, tmp); + outb(0x61, tmp); } // Make a beep -void beep(uint32_t frequency, uint32_t ticks) { +void beep(uint32_t frequency, uint32_t ticks) +{ play_sound(frequency); timer_wait(ticks); shut_up(); -- cgit v1.2.3