Instead of delay, wait for keyboard to respond
This commit is contained in:
6
include/coroutine.h
Normal file
6
include/coroutine.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#define CO_BEGIN static unsigned state = 0; switch (state) { case 0:
|
||||
#define CO_YIELD do { state = __LINE__; return; case __LINE__:; } while (0)
|
||||
#define CO_BREAK do { state = 0; return; } while (0)
|
||||
#define CO_END } state = 0
|
||||
@@ -1,5 +1,4 @@
|
||||
#ifndef FIFO_h
|
||||
#define FIFO_h
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -16,5 +15,3 @@ void FIFO_push(volatile struct FIFO* fifo, uint8_t value);
|
||||
uint8_t FIFO_pop(volatile struct FIFO* fifo);
|
||||
int FIFO_size(volatile struct FIFO* fifo);
|
||||
void FIFO_clear(volatile struct FIFO* fifo);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#ifndef KEYBOARD_h
|
||||
#define KEYBOARD_h
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -12,5 +11,3 @@ void queue_keyboard_cmd(uint8_t value);
|
||||
void send_keyboard_cmd_queue();
|
||||
|
||||
void keyboard_interrupt(void (*callback)(uint8_t));
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
#ifndef SCANCODE_H
|
||||
#define SCANCODE_H
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
uint8_t convert_scancode(uint8_t shift, uint8_t code);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user