summaryrefslogtreecommitdiffstats
path: root/boiler-monster/stm32/app/util.c
diff options
context:
space:
mode:
authorfishsoupisgood <github@madingley.org>2020-09-09 11:53:37 +0100
committerfishsoupisgood <github@madingley.org>2020-09-09 11:53:37 +0100
commit9d87c925a9eaa4fc256be3173c14a20d1469472d (patch)
tree50d63f87a47a0eac3f5b8058850184bcd4e6ee95 /boiler-monster/stm32/app/util.c
parentdafd8cf2fdcdd637cc06f760d318cf8391b1a294 (diff)
downloadheating-9d87c925a9eaa4fc256be3173c14a20d1469472d.tar.gz
heating-9d87c925a9eaa4fc256be3173c14a20d1469472d.tar.bz2
heating-9d87c925a9eaa4fc256be3173c14a20d1469472d.zip
everything, mostly, working
Diffstat (limited to 'boiler-monster/stm32/app/util.c')
-rw-r--r--boiler-monster/stm32/app/util.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/boiler-monster/stm32/app/util.c b/boiler-monster/stm32/app/util.c
new file mode 100644
index 0000000..bf65510
--- /dev/null
+++ b/boiler-monster/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 '?';
+}
+
+