removed pdclib, strange things were happening..., user shell kinda works now
This commit is contained in:
@@ -2,13 +2,18 @@
|
||||
|
||||
#include <drivers/ps2/ps2.h>
|
||||
|
||||
static const char scancode_to_ascii[] = {
|
||||
0, 27, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', '\b',
|
||||
'\t', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n',
|
||||
0, 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '`', 0,
|
||||
'\\', 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/', 0, '*', 0, ' '
|
||||
};
|
||||
|
||||
extern void ps2_wait_input_empty(void);
|
||||
extern void ps2_wait_output_full(void);
|
||||
extern void ps2_write_command(uint8_t);
|
||||
extern uint8_t ps2_read_data(void);
|
||||
extern void ps2_write_data(uint8_t);
|
||||
extern void ps2_flush_output_buffer(void);
|
||||
|
||||
extern void io_wait(void);
|
||||
|
||||
static uint8_t read_ccb() {
|
||||
@@ -68,4 +73,19 @@ int init_ps2() {
|
||||
write_ccb(ccb);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
char ps2_get_ascii(uint8_t scancode) {
|
||||
if (scancode & 0x80) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (scancode < sizeof(scancode_to_ascii)) {
|
||||
char ascii = scancode_to_ascii[scancode];
|
||||
if (ascii != 0) {
|
||||
return ascii;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -18,8 +18,11 @@
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
#include <stdint.h>
|
||||
|
||||
int init_ps2();
|
||||
uint8_t ps2_read_data();
|
||||
|
||||
char ps2_get_ascii(uint8_t scancode);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user