﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-My way,Underway.........           </title><link>http://www.cppblog.com/jinjiankla/</link><description>DJ</description><language>zh-cn</language><lastBuildDate>Wed, 08 Apr 2026 13:27:05 GMT</lastBuildDate><pubDate>Wed, 08 Apr 2026 13:27:05 GMT</pubDate><ttl>60</ttl><item><title>打印函数总结RETAILMSG(..) DEBUGMSG(..) NKDbgPrintfW(..) </title><link>http://www.cppblog.com/jinjiankla/archive/2010/08/20/124066.html</link><dc:creator>迟到的爱</dc:creator><author>迟到的爱</author><pubDate>Fri, 20 Aug 2010 01:51:00 GMT</pubDate><guid>http://www.cppblog.com/jinjiankla/archive/2010/08/20/124066.html</guid><wfw:comment>http://www.cppblog.com/jinjiankla/comments/124066.html</wfw:comment><comments>http://www.cppblog.com/jinjiankla/archive/2010/08/20/124066.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/jinjiankla/comments/commentRss/124066.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/jinjiankla/services/trackbacks/124066.html</trackback:ping><description><![CDATA[

<div>作者：ARM-Win</div><div><br></div><div>不管在WinCE5.0还是在WinCE6.0中，我们在调试驱动或者应用的时候都会用到打印函数。在驱动里面，我们可能会用DEBUGMSG(..)，RETAILMSG(..)，还有NKDbgPrintfW(..)。在我们使用这些打印函数调试我们的程序之前，我们需要实现串口打印功能。</div><div><br></div><div>在WinCE的BSP中，如果想调用DEBUGMSG(..)或者RETAILMSG(..)来从串口打印信息，必须在我们的BSP中的OAL层找到debug.c，在这个文件里面实现下面的4个函数：</div><div><br></div><div>void OEMInitDebugSerial(void) ： &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 初始化用于打印信息的串口</div><div><br></div><div>int OEMReadDebugByte (void)： &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;从串口读一个byte，出错时返回OEM_DEBUG_COM_ERROR；没有数据时返回OEM_DEBUG_READ_NODATA</div><div><br></div><div>void OEMWriteDebugByte(BYTE ch): 写一个byte到串口void OEMWriteDebugString(unsigned short* str)： 写一个字符串到串口，这个函数其实就是通过调用OEMWriteDebugByte(..)实现的。实现了上述的4个函数，就可以通过串口打印来调试程序了。一般这4个函数在OAL中的debug.c中实现。</div><div>&nbsp;</div><div>在BSP中，我们一般会用3个函数来实现打印：DEBUGMSG，RETAILMSG，NKDbgPrintfW。简单介绍一下：</div><div>&nbsp;</div><div>NKDbgPrintfW(..)函数一般只在OAL中使用，可以直接从串口中打印出信息，不受编译选项的影响。</div><div>&nbsp;</div><div>DEBUGMSG(..)函数只有在工程在Debug模式下编译以后，才会打印出信息来。如果是在Release模式下编译的，就不会打印信息出来。</div><div>&nbsp;</div><div>RETAILMSG(..)函数在Debug模式下和Release模式下编译都会打印出调试信息，但是如果你在工程的属性中的"Build option"中选择了"Enable ship build"，那么RETAILMSG函数就不会打印信息了。</div><div><br></div><div><br></div><div><br></div><div>本文来自CSDN博客，转载请标明出处：http://blog.csdn.net/jiereliyi/archive/2009/08/31/4504136.aspx</div><img src ="http://www.cppblog.com/jinjiankla/aggbug/124066.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/jinjiankla/" target="_blank">迟到的爱</a> 2010-08-20 09:51 <a href="http://www.cppblog.com/jinjiankla/archive/2010/08/20/124066.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>我的"背包"学习总结(超详细版)</title><link>http://www.cppblog.com/jinjiankla/archive/2009/07/23/90954.html</link><dc:creator>迟到的爱</dc:creator><author>迟到的爱</author><pubDate>Thu, 23 Jul 2009 11:27:00 GMT</pubDate><guid>http://www.cppblog.com/jinjiankla/archive/2009/07/23/90954.html</guid><wfw:comment>http://www.cppblog.com/jinjiankla/comments/90954.html</wfw:comment><comments>http://www.cppblog.com/jinjiankla/archive/2009/07/23/90954.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.cppblog.com/jinjiankla/comments/commentRss/90954.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/jinjiankla/services/trackbacks/90954.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &nbsp;&nbsp;记得去年的校圣诞编程大赛的初赛和复赛中有3，4道类型相似的题目，当时对于刚加入ACMER行列的我并不了解这是哪一类的题目，只觉得这些题目有一定的规律。后来写的程序多了，接触的算法也多了，慢慢的知道那3，4道题目其实是动态规划下的&#8221;背包问题&#8221;.现在基本上了解了这类题目的解题思路和应对方法,故想借此对各种背包问题做一个详细的解释.&nbsp;&nbs...&nbsp;&nbsp;<a href='http://www.cppblog.com/jinjiankla/archive/2009/07/23/90954.html'>阅读全文</a><img src ="http://www.cppblog.com/jinjiankla/aggbug/90954.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/jinjiankla/" target="_blank">迟到的爱</a> 2009-07-23 19:27 <a href="http://www.cppblog.com/jinjiankla/archive/2009/07/23/90954.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>