voltando a versao de n aberturas e fechamentos de sockets data 19/09
Dependencies: EthernetInterface NTPClient mbed-rtos mbed EALib
Fork of header_main_publish by
debug.h@14:22a35f575502, 2014-09-16 (annotated)
- Committer:
- klauss
- Date:
- Tue Sep 16 21:02:37 2014 +0000
- Revision:
- 14:22a35f575502
- Parent:
- 8:e3bfe62a477e
stable version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
klauss | 0:4d17cd9c8f9d | 1 | #ifndef __DEBUG_H__ |
klauss | 0:4d17cd9c8f9d | 2 | #define __DEBUG_H__ |
klauss | 0:4d17cd9c8f9d | 3 | |
klauss | 0:4d17cd9c8f9d | 4 | #include <stdint.h> |
klauss | 0:4d17cd9c8f9d | 5 | #include <stdio.h> |
klauss | 0:4d17cd9c8f9d | 6 | #include "mbed.h" |
klauss | 0:4d17cd9c8f9d | 7 | #include "EthernetInterface.h" |
klauss | 0:4d17cd9c8f9d | 8 | |
klauss | 0:4d17cd9c8f9d | 9 | #include "configs.h" |
klauss | 0:4d17cd9c8f9d | 10 | |
klauss | 2:93bec7313ccc | 11 | //extern UDPSocket debug; |
klauss | 2:93bec7313ccc | 12 | //extern Endpoint debug_server; |
klauss | 0:4d17cd9c8f9d | 13 | extern char debug_msg1[ 1024+64 ]; |
klauss | 0:4d17cd9c8f9d | 14 | extern char debug_msg2[ 1024 ]; |
klauss | 14:22a35f575502 | 15 | |
klauss | 0:4d17cd9c8f9d | 16 | void debug_pkg( int size, uint8_t * pkg ); |
klauss | 0:4d17cd9c8f9d | 17 | |
klauss | 0:4d17cd9c8f9d | 18 | #define debug_msg(...) _debug_msg(__VA_ARGS__) |
klauss | 0:4d17cd9c8f9d | 19 | #define _debug_msg(...) { \ |
klauss | 0:4d17cd9c8f9d | 20 | sprintf(debug_msg1, "%s:%d ", __FILE__, __LINE__); \ |
klauss | 0:4d17cd9c8f9d | 21 | sprintf(debug_msg2, __VA_ARGS__); \ |
klauss | 0:4d17cd9c8f9d | 22 | strcat(debug_msg1, debug_msg2); \ |
klauss | 2:93bec7313ccc | 23 | pc.printf( "%s\n\r", debug_msg1 ); \ |
klauss | 0:4d17cd9c8f9d | 24 | } |
klauss | 8:e3bfe62a477e | 25 | #endif |
klauss | 7:019b08223b87 | 26 | |
klauss | 8:e3bfe62a477e | 27 | |
klauss | 0:4d17cd9c8f9d | 28 | //debug.sendTo( debug_server, debug_msg1, strlen( debug_msg1 ) ); \ |
klauss | 4:de46f0d9b14d | 29 | //pc.printf( "%s\n\r", debug_msg1 ); \ |