Commit 1efcb863 by triazo

Add function to print 64 bit int (qword) to serial

parent 2091e32c
Showing with 9 additions and 0 deletions
...@@ -47,6 +47,14 @@ void serial_hexword(uint32_t x) ...@@ -47,6 +47,14 @@ void serial_hexword(uint32_t x)
} }
} }
void serial_hexqword(uint64_t x)
{
for (int i = 15; i >= 0; i--)
{
serial_writechar(hexchars[x>>i*4&0xf]);
}
}
void serial_hexstring(void* s, uint32_t n) { void serial_hexstring(void* s, uint32_t n) {
char* d = (char*)s; char* d = (char*)s;
for (uint32_t i = 0; i < n; i++) for (uint32_t i = 0; i < n; i++)
......
...@@ -22,6 +22,7 @@ void serial_writestring(char* s); ...@@ -22,6 +22,7 @@ void serial_writestring(char* s);
// Function to write a 4 byte word toserial in hex // Function to write a 4 byte word toserial in hex
void serial_hexword(uint32_t x); void serial_hexword(uint32_t x);
void serial_hexqword(uint64_t x);
void serial_hexstring(void* s, uint32_t n); void serial_hexstring(void* s, uint32_t n);
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment