summaryrefslogtreecommitdiffstats
path: root/stm32/app/util.c
diff options
context:
space:
mode:
authorfishsoupisgood <github@madingley.org>2020-05-26 14:33:34 +0100
committerfishsoupisgood <github@madingley.org>2020-05-26 14:33:34 +0100
commitf0d941bef6a9b6e3af78cfc68e1f82d6b47ccb2f (patch)
tree22a88d00cb28e075b5397ff5db586d548023f2f2 /stm32/app/util.c
downloadheating-f0d941bef6a9b6e3af78cfc68e1f82d6b47ccb2f.tar.gz
heating-f0d941bef6a9b6e3af78cfc68e1f82d6b47ccb2f.tar.bz2
heating-f0d941bef6a9b6e3af78cfc68e1f82d6b47ccb2f.zip
happy
Diffstat (limited to 'stm32/app/util.c')
-rw-r--r--stm32/app/util.c14
1 files changed, 14 insertions, 0 deletions
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 '?';
+}
+
+