diff --git a/inc/hal/hal.h b/inc/hal/hal.h index cbc069d..cb752ea 100644 --- a/inc/hal/hal.h +++ b/inc/hal/hal.h @@ -3,6 +3,7 @@ #define _HAL_H_ +void debug(int); void debug(const char* str); void hal_init_screen(int w, int h); void hal_poll_input(bool *ptr); diff --git a/src/gfx/layout.cpp b/src/gfx/layout.cpp index 7632851..3fb828a 100644 --- a/src/gfx/layout.cpp +++ b/src/gfx/layout.cpp @@ -63,4 +63,4 @@ int layout::allocate_(node* current, int depth) { slots[0].content = current; return 0; } -} \ No newline at end of file +} diff --git a/src/hal.cpp b/src/hal.cpp index 37e98d9..5f25083 100644 --- a/src/hal.cpp +++ b/src/hal.cpp @@ -8,3 +8,18 @@ #ifdef AVR #include "hal/avr.cpp" #endif + + +void debug(int n){ + const char hex[]="0123456789ABCDEF"; + char buf[]="0x00000000\n"; + buf[2]=hex[(n>>28)&0xF]; + buf[3]=hex[(n>>24)&0xF]; + buf[4]=hex[(n>>20)&0xF]; + buf[5]=hex[(n>>16)&0xF]; + buf[6]=hex[(n>>12)&0xF]; + buf[7]=hex[(n>>8)&0xF]; + buf[8]=hex[(n>>4)&0xF]; + buf[9]=hex[(n>>0)&0xF]; + debug(buf); +} \ No newline at end of file