first draft
Dependencies: LMiC SX1272Libx mbed
Fork of LoRaWAN-lmic-app by
Diff: debug.cpp
- Revision:
- 8:0137acc9a6cd
- Parent:
- 1:60184eda0066
- Child:
- 9:0b63a0a90205
--- a/debug.cpp Tue Feb 23 15:44:48 2016 +0000 +++ b/debug.cpp Thu Feb 25 15:40:21 2016 +0000 @@ -18,7 +18,8 @@ debug_str("\r\n============== DEBUG STARTED ==============\r\n"); } -void debug_led (u1_t val) { +void debug_led (u1_t val) +{ debug_val( "LED = ", val ); } @@ -39,10 +40,16 @@ debug_char( '\n' ); } -void debug_uint (u4_t v) { - for( s1_t n = 24; n >= 0; n -= 8 ) { - debug_hex( v >> n ); - } +void debug_uint (u4_t v) +{ + u1_t str[20]; + + sprintf((char *)str,"%d",v); + debug_str(str); +// for( s1_t n = 24; n >= 0; n -= 8 ) +// { +// debug_hex( v >> n ); +// } } void debug_str (const u1_t* str) { @@ -59,6 +66,7 @@ } void debug_event (int ev) { + debug_val("onEvent ",ev); static const u1_t* evnames[] = { [EV_SCAN_TIMEOUT] = "SCAN_TIMEOUT", [EV_BEACON_FOUND] = "BEACON_FOUND",