Fix: uart_hex wrong offset
This commit is contained in:
@@ -101,11 +101,11 @@ logger_cur = _Generic((msg), \
|
|||||||
// #define DEBUG_DTB(val) DEBUG(val)
|
// #define DEBUG_DTB(val) DEBUG(val)
|
||||||
#define DEBUG_DTB(val) CLEAN
|
#define DEBUG_DTB(val) CLEAN
|
||||||
|
|
||||||
#define DEBUG_EXCEP(val) DEBUG(val)
|
// #define DEBUG_EXCEP(val) DEBUG(val)
|
||||||
// #define DEBUG_EXCEP(val) CLEAN
|
#define DEBUG_EXCEP(val) CLEAN
|
||||||
|
|
||||||
// #define DEBUG_MEM(val) DEBUG(val)
|
#define DEBUG_MEM(val) DEBUG(val)
|
||||||
#define DEBUG_MEM(val) CLEAN
|
// #define DEBUG_MEM(val) CLEAN
|
||||||
|
|
||||||
// #define DEBUG_INITRD(val) DEBUG(val)
|
// #define DEBUG_INITRD(val) DEBUG(val)
|
||||||
#define DEBUG_INITRD(val) CLEAN
|
#define DEBUG_INITRD(val) CLEAN
|
||||||
|
|||||||
@@ -209,11 +209,10 @@ void uart_puts(const char *s)
|
|||||||
void uart_hex(uint64_t d)
|
void uart_hex(uint64_t d)
|
||||||
{
|
{
|
||||||
char buf[0x11], *p = buf;
|
char buf[0x11], *p = buf;
|
||||||
uint64_t n;
|
for (int c = 28, n; c >= 0; c -= 4) {
|
||||||
for (int c = 28; c >= 0; c -= 4) {
|
|
||||||
n = (d >> c) & 0xf;
|
n = (d >> c) & 0xf;
|
||||||
n += n > 9 ? (char)'A' : (char)'0';
|
n += (n > 9) ? 0x37 : 0x30;
|
||||||
*p++ = n;
|
*p++ = (char)n;
|
||||||
}
|
}
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
uart_puts(buf);
|
uart_puts(buf);
|
||||||
|
|||||||
Reference in New Issue
Block a user