123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- #if defined( MT_TASK ) || defined( APP_DEBUG )
- #include "ZComDef.h"
- #include "OSAL.h"
- #include "MT.h"
- #include "MT_TASK.h"
- #include "MT_DEBUG.h"
- #include "DebugTrace.h"
- #if defined ( APP_DEBUG )
- #include "DebugApp.h"
- #endif
-
-
- void debug_msg( byte compID, byte severity, byte numParams, UINT16 param1,
- UINT16 param2, UINT16 param3 )
- {
- mtDebugMsg_t *mtDebugMsg;
- UINT16 timestamp;
- if ( debugThreshold == 0 || debugCompId != compID )
- return;
-
- timestamp = 0;
-
- mtDebugMsg = (mtDebugMsg_t *)osal_msg_allocate( sizeof( mtDebugMsg_t ) );
- if ( mtDebugMsg )
- {
- mtDebugMsg->hdr.event = CMD_DEBUG_MSG;
- mtDebugMsg->compID = compID;
- mtDebugMsg->severity = severity;
- mtDebugMsg->numParams = numParams;
- mtDebugMsg->param1 = param1;
- mtDebugMsg->param2 = param2;
- mtDebugMsg->param3 = param3;
- mtDebugMsg->timestamp = timestamp;
- osal_msg_send( MT_TaskID, (uint8 *)mtDebugMsg );
- }
- }
- void debug_str( byte *str_ptr )
- {
- mtDebugStr_t *msg;
- byte mln;
- byte strLen;
-
- strLen = (byte)osal_strlen( (void*)str_ptr );
-
- mln = sizeof ( mtDebugStr_t ) + strLen;
-
- msg = (mtDebugStr_t *)osal_msg_allocate( mln );
- if ( msg )
- {
-
- msg->hdr.event = CMD_DEBUG_STR;
- msg->strLen = strLen;
-
- msg->pString = (uint8 *)(msg+1);
- osal_memcpy ( msg->pString, str_ptr, strLen );
- osal_msg_send( MT_TaskID, (uint8 *)msg );
- }
- }
- #endif
|