![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
debug.h@6:a10de9926fbe, 2014-09-12 (annotated)
- Committer:
- klauss
- Date:
- Fri Sep 12 16:46:37 2014 +0000
- Revision:
- 6:a10de9926fbe
- Parent:
- 4:de46f0d9b14d
- Child:
- 7:019b08223b87
Versao em desenvolvimento, bug de travamento
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 | 0:4d17cd9c8f9d | 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 | 0:4d17cd9c8f9d | 25 | #endif |
klauss | 0:4d17cd9c8f9d | 26 | |
klauss | 0:4d17cd9c8f9d | 27 | //debug.sendTo( debug_server, debug_msg1, strlen( debug_msg1 ) ); \ |
klauss | 4:de46f0d9b14d | 28 | //pc.printf( "%s\n\r", debug_msg1 ); \ |