aboutsummaryrefslogtreecommitdiff
path: root/strings.h
diff options
context:
space:
mode:
authorWojtek Kosior <kwojtus@protonmail.com>2019-11-09 11:09:40 +0100
committerWojtek Kosior <kwojtus@protonmail.com>2019-11-09 11:09:40 +0100
commit2fd668c8ebfb5e26cfc6964f0014a7121964a5c2 (patch)
treeb1997086abcedd949ada89407d0a14cad2aa626d /strings.h
parentd3da1d80ac2ce844b19feab6187722fc72eaa59c (diff)
downloadrpi-MMU-example-2fd668c8ebfb5e26cfc6964f0014a7121964a5c2.tar.gz
rpi-MMU-example-2fd668c8ebfb5e26cfc6964f0014a7121964a5c2.zip
enable MMU; warning: DO NOT MERGE THIS COMMIT - ONCE I KNOW HOW TO GET THIS WORK I SHALL WRITE SOME USABLE ROUTINES AND STRUCTS INSTEAD OF THIS CRAPPY CODE HERE
Diffstat (limited to 'strings.h')
-rw-r--r--strings.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/strings.h b/strings.h
new file mode 100644
index 0000000..7721f63
--- /dev/null
+++ b/strings.h
@@ -0,0 +1,9 @@
+#include <stdint.h>
+
+void uint32_to_bits(uint32_t number, char *buf)
+{
+ for (int i = 0; i < 32; i++)
+ buf[i] = ((number >> (32 - i - 1)) & 1) ? '1' : '0';
+
+ buf[32] = '\0';
+}