diff options
Diffstat (limited to 'boiler-monster/stm32/app/util.c')
-rw-r--r-- | boiler-monster/stm32/app/util.c | 14 |
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 '?'; +} + + |