From de20d7430df08731d9108acb83e1234ba7f1fe16 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sat, 19 Sep 2020 14:53:29 -0400 Subject: file manager --- src/user/knob/user.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/user/knob/user.c') diff --git a/src/user/knob/user.c b/src/user/knob/user.c index b642f79..dfcb791 100644 --- a/src/user/knob/user.c +++ b/src/user/knob/user.c @@ -116,10 +116,8 @@ static const uint8_t shifted[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static char get_key_char() { - _key_code_t key; - while (!(key = _get_key())) - _yield_task(); +__attribute__ ((const)) +char key_to_char(_key_code_t key) { return key & _KEY_CAPS ? key & _KEY_SHIFT @@ -130,6 +128,13 @@ static char get_key_char() { : key & 0xff; } +static char get_key_char() { + _key_code_t key; + while (!(key = _get_key())) + _yield_task(); + return key_to_char(key); +} + void tell_user_sz(const char *sz) { _log_string(sz); } -- cgit v1.2.3