projects
/
cortex-from-scratch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
basic memory management and uart wait fix
[cortex-from-scratch]
/
lib.c
diff --git
a/lib.c
b/lib.c
index
62c56e8
..
69bb12d
100644
(file)
--- a/
lib.c
+++ b/
lib.c
@@
-9,13
+9,12
@@
char hexbuf[8] = {'0', '0','0', '0','0', '0','0', '0'};
char hexbuf[8] = {'0', '0','0', '0','0', '0','0', '0'};
-void addrtohex(
const
uint32_t addr) {
+void addrtohex(uint32_t addr) {
char tmpbuf[6] = {'A', 'B', 'C', 'D', 'E', 'F'};
memset(&hexbuf, 0, sizeof(uint32_t) * 8);
char tmpbuf[6] = {'A', 'B', 'C', 'D', 'E', 'F'};
memset(&hexbuf, 0, sizeof(uint32_t) * 8);
- uint32_t tmp = addr;
for (int i = 0; i < 8 ; i++) {
for (int i = 0; i < 8 ; i++) {
- tmp = addr;
+
uint32_t
tmp = addr;
tmp = tmp >> (i * 4);
tmp = tmp & 0xF;
if ((tmp >= 0) && tmp < 10) {
tmp = tmp >> (i * 4);
tmp = tmp & 0xF;
if ((tmp >= 0) && tmp < 10) {
@@
-27,20
+26,10
@@
void addrtohex(const uint32_t addr) {
}
uart_puts("ADDRESS: 0x");
}
uart_puts("ADDRESS: 0x");
- for (int i = 7; i >= 0; i--) {
+
for (int i = 7; i >= 0; i--) {
uart_putc(hexbuf[i]);
uart_putc(hexbuf[i]);
- }
+ }
+ //uart_puts(hexbuf);
uart_putc('\n');
}
uart_putc('\n');
}
-
-void *malloc(size_t size) {
-
-
-
-}
-
-void free(void * ptr) {
-
-
-}