![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
debugs removidos - ligacao em pares ok
Dependencies: EthernetInterface NTPClient mbed-rtos mbed
Fork of header_main by
Diff: debug.h
- Revision:
- 0:4d17cd9c8f9d
- Child:
- 2:93bec7313ccc
diff -r 000000000000 -r 4d17cd9c8f9d debug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debug.h Tue Sep 09 20:01:24 2014 +0000 @@ -0,0 +1,29 @@ +#ifndef __DEBUG_H__ +#define __DEBUG_H__ + +#include <stdint.h> +#include <stdio.h> +#include "mbed.h" +#include "EthernetInterface.h" + +#include "configs.h" + +extern UDPSocket debug; +extern Endpoint debug_server; +extern char debug_msg1[ 1024+64 ]; +extern char debug_msg2[ 1024 ]; + +void debug_pkg( int size, uint8_t * pkg ); + +#define debug_msg(...) _debug_msg(__VA_ARGS__) +#define _debug_msg(...) { \ + sprintf(debug_msg1, "%s:%d ", __FILE__, __LINE__); \ + sprintf(debug_msg2, __VA_ARGS__); \ + strcat(debug_msg1, debug_msg2); \ + debug.sendTo( debug_server, debug_msg1, strlen( debug_msg1 ) ); \ +} +#endif + + +//debug.sendTo( debug_server, debug_msg1, strlen( debug_msg1 ) ); \ +//pc.printf( "%s\n\r", debug_msg1 ); \ \ No newline at end of file