Modularizando o src

Dependencies:   EALib EthernetInterface_vz mbed-rtos mbed

Fork of header_main_colinas_V0-20-09-14 by VZTECH

debug.h

Committer:
klauss
Date:
2014-10-07
Revision:
45:c80574f24dc3
Parent:
44:cc4996469404
Child:
48:195c97f12e8e

File content as of revision 45:c80574f24dc3:

#ifndef __DEBUG_H__
#define __DEBUG_H__

#include <stdint.h>
#include <stdio.h>
#include "mbed.h"
#include "EthernetInterface.h"
#include "configs.h"
#include "prompt.h"

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); \
  pc.printf( "%s\n\r", debug_msg1 ); \
  if( from_eth ){ \
    if( tcp_session ){ \
        strcat( debug_msg1, "\n\r" ); \
        tcp_client.send_all( debug_msg1, strlen( debug_msg1 ) ); \
    } \
  } \
}
#endif