From 0d410fa364d74ac8ccd1d2e679f8b2579c050530 Mon Sep 17 00:00:00 2001 From: mesheets <16882600+mesheets@users.noreply.github.com> Date: Fri, 19 Jul 2024 22:10:07 -0400 Subject: [PATCH] Update conio header file definitions for array encapsulation --- include/conio.h | 10 ++-------- kernel/conio.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/include/conio.h b/include/conio.h index 4b37dc2..0dca68a 100644 --- a/include/conio.h +++ b/include/conio.h @@ -177,20 +177,14 @@ extern "C" { //! Table lookup: list of native patterns, one for each HEX character /*! \param nibble HEX char value (0-9, a-f) */ -extern inline char get_hex_display_code(unsigned nibble) -{ - return hex_display_codes[(nibble) & 0x0f]; -} +extern inline char get_hex_display_code(unsigned nibble); #ifdef CONF_ASCII //! Table lookup: list of native patterns, one for each ASCII character /*! \param c ASCII char value (least significant 7 bits ONLY) */ -extern inline char get_ascii_display_code(unsigned c) -{ - return ascii_display_codes[(c) & 0x7f]; -} +extern inline char get_ascii_display_code(unsigned c); #endif // CONF_ASCII diff --git a/kernel/conio.c b/kernel/conio.c index 3a800f2..f5812e4 100644 --- a/kernel/conio.c +++ b/kernel/conio.c @@ -190,6 +190,14 @@ const char ascii_display_codes[] = 0x00 // 127 "" 127 empty }; +//! Table lookup: list of native patterns, one for each ASCII character +/*! \param c ASCII char value (least significant 7 bits ONLY) +*/ +char get_ascii_display_code(unsigned c) +{ + return ascii_display_codes[(c) & 0x7f]; +} + #endif // CONF_ASCII /////////////////////////////////////////////////////////////////////////////// @@ -409,6 +417,15 @@ void cputc_native_user(char mask_left, char mask_lcenter, char mask_rcenter, cha #endif } +//! Table lookup: list of native patterns, one for each HEX character +/*! \param nibble HEX char value (0-9, a-f) +*/ +char get_hex_display_code(unsigned nibble) +{ + return hex_display_codes[(nibble) & 0x0f]; +} + + //! display a hexword in the four leftmost positions. /*! \param word the hexword