解决RTM下编译不能用的问题

This commit is contained in:
Stone 2015-01-26 02:12:30 +00:00
parent 9b75c93740
commit d01a62c5b8
1 changed files with 6 additions and 0 deletions

View File

@ -143,6 +143,7 @@ void TinyMessage::Write(MemoryStream& ms)
#endif #endif
} }
#if DEBUG
void TinyMessage::Show() const void TinyMessage::Show() const
{ {
assert_ptr(this); assert_ptr(this);
@ -157,6 +158,7 @@ void TinyMessage::Show() const
if(!Valid()) msg_printf(" Crc Error 0x%04x [%04X]", Crc, __REV16(Crc)); if(!Valid()) msg_printf(" Crc Error 0x%04x [%04X]", Crc, __REV16(Crc));
msg_printf("\r\n"); msg_printf("\r\n");
} }
#endif
// 构造控制器 // 构造控制器
TinyController::TinyController(ITransport* port) : Controller(port) TinyController::TinyController(ITransport* port) : Controller(port)
@ -236,7 +238,11 @@ void ShowMessage(TinyMessage& msg, bool send, ITransport* port = NULL)
else if(!send) else if(!send)
msg_printf("Request"); msg_printf("Request");
#if DEBUG
msg_printf(" 0x%02x => 0x%02x Code=0x%02x Flag=%02x Sequence=%d Length=%d Checksum=0x%04x Retry=%d ", msg.Src, msg.Dest, msg.Code, *((byte*)&(msg.Code)+1), msg.Sequence, msg.Length, msg.Checksum, msg.Retry); msg_printf(" 0x%02x => 0x%02x Code=0x%02x Flag=%02x Sequence=%d Length=%d Checksum=0x%04x Retry=%d ", msg.Src, msg.Dest, msg.Code, *((byte*)&(msg.Code)+1), msg.Sequence, msg.Length, msg.Checksum, msg.Retry);
#else
msg_printf(" 0x%02x => 0x%02x Code=0x%02x Flag=%02x Sequence=%d Length=%d Checksum=0x%04x ", msg.Src, msg.Dest, msg.Code, *((byte*)&(msg.Code)+1), msg.Sequence, msg.Length, msg.Checksum);
#endif
if(msg.Length > 0) if(msg.Length > 0)
{ {
msg_printf(" 数据:[%d] ", msg.Length); msg_printf(" 数据:[%d] ", msg.Length);