From f0d941bef6a9b6e3af78cfc68e1f82d6b47ccb2f Mon Sep 17 00:00:00 2001 From: fishsoupisgood Date: Tue, 26 May 2020 14:33:34 +0100 Subject: happy --- stm32/app/util.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 stm32/app/util.c (limited to 'stm32/app/util.c') diff --git a/stm32/app/util.c b/stm32/app/util.c new file mode 100644 index 0000000..bf65510 --- /dev/null +++ b/stm32/app/util.c @@ -0,0 +1,14 @@ +#include "project.h" + +char int_to_hex_char (int a) +{ + if (a < 0) return '?'; + + if (a < 0xa) return '0' + a; + + if (a < 0x10) return '7' + a; + + return '?'; +} + + -- cgit v1.2.3