feat: added support for waiting on an irq
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <libc/ringqueue.h>
|
||||
#include <libk/libk.h>
|
||||
#include <mem/malloc.h>
|
||||
#include <libk/syscall.h>
|
||||
|
||||
|
||||
const char scancode_map_lowercase[] = {
|
||||
@@ -63,7 +64,8 @@ char getc() {
|
||||
KeyEvent *get_next_event() {
|
||||
KeyEvent *target = malloc(sizeof(KeyEvent));
|
||||
if (!ring_buffer_get(keyboard_event_buffer, target)) {
|
||||
k_wait_for_interrupt();
|
||||
syscall_yield_irq(1 << 1);
|
||||
// k_wait_for_interrupt();
|
||||
free(target);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user