summaryrefslogtreecommitdiff
path: root/kernel/drivers
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-12-12 16:03:08 +0100
committerAnton Kling <anton@kling.gg>2024-12-12 16:03:08 +0100
commitb033314bf1901d436dc71d41d5e1f37dda47e511 (patch)
tree120bd137888a7f96904a47af7d20422608ffe225 /kernel/drivers
parentdcbcdbdc5bcfb86eca05fb655e3bf009d89e39e0 (diff)
formatting: Use clang-format on all projects
This commit also add braces to all `if` statements.
Diffstat (limited to 'kernel/drivers')
-rw-r--r--kernel/drivers/ac97.c2
-rw-r--r--kernel/drivers/ac97.h4
-rw-r--r--kernel/drivers/mouse.c12
3 files changed, 11 insertions, 7 deletions
diff --git a/kernel/drivers/ac97.c b/kernel/drivers/ac97.c
index b88a32a..27711ff 100644
--- a/kernel/drivers/ac97.c
+++ b/kernel/drivers/ac97.c
@@ -213,7 +213,7 @@ void ac97_init(void) {
PCM Output by writing value 0 to this register. Now sound card is
ready to use.
*/
- ac97_set_volume(100);
+ ac97_set_volume(5);
// Playing sound
/*
diff --git a/kernel/drivers/ac97.h b/kernel/drivers/ac97.h
index f1089e5..20ac43b 100644
--- a/kernel/drivers/ac97.h
+++ b/kernel/drivers/ac97.h
@@ -1,8 +1,8 @@
-#include <typedefs.h>
#include <stddef.h>
+#include <typedefs.h>
void ac97_init(void);
-int ac97_add_pcm(u8* buffer, size_t len);
+int ac97_add_pcm(u8 *buffer, size_t len);
int ac97_can_write(void);
void ac97_set_volume(int volume);
int ac97_get_volume(void);
diff --git a/kernel/drivers/mouse.c b/kernel/drivers/mouse.c
index 47133b8..dea8c08 100644
--- a/kernel/drivers/mouse.c
+++ b/kernel/drivers/mouse.c
@@ -102,18 +102,22 @@ void int_mouse(reg_t *r) {
int16_t y = mouse_u8[2];
uint8_t xs = mouse_u8[0] & (1 << 4);
uint8_t ys = mouse_u8[0] & (1 << 5);
- if (xs)
+ if (xs) {
x |= 0xFF00;
- if (ys)
+ }
+ if (ys) {
y |= 0xFF00;
+ }
mouse_x += x;
mouse_y -= y;
- if (mouse_x < 0)
+ if (mouse_x < 0) {
mouse_x = 0;
- if (mouse_y < 0)
+ }
+ if (mouse_y < 0) {
mouse_y = 0;
+ }
mouse_middle_button = mouse_u8[0] & (1 << 2);
mouse_right_button = mouse_u8[0] & (1 << 1);