串列埠列印資訊的奇怪問題

2021-04-29 22:04:04 字數 1238 閱讀 2986

遇到的問題:

自己解決加入串列埠列印資訊碰到了鬱悶的事情。

剛開始,我只想把c:/wince500/public/common/oak/drivers/serial/com_mdd2編譯成debug版本,來列印資訊的。

我採用了如下方法:

第一種:

將下面這句**加入到驅動所在目錄中的sources檔案中即可:

cdefines=$(cdefines) -ddebug

第二種

#undef debugmsg

#define debugmsg(x,s) nkdbgprintfw s

這樣這個驅動檔案裡的所有除錯資訊都會列印出來,並且不理會debugzone的設定。

沒有想到照樣沒有輸出資訊,真是神了,而且串列埠編譯出來確實可用的。並且以前第二種方法我在bsp的驅動下確實可行的。

後來我乾脆重新建立工程,把整個nk都編譯成debug,很多啟動資訊,但是就是沒有c:/wince500/public/common/oak/drivers/serial/com_mdd2的資訊,真是氣人啊。

後來發現這個debugmsg和retailmsg都是使用nkdbgprintfw 實現的,我直接使用nkdbgprintfw 放在dll入口也不行。

怎麼回事啊,很是鬱悶,大家來說說咋回事呢?

解決的辦法:

我剛才把原來的工程刪除了,留下個工程模板

並且在串列埠的mdd.c中加上

//------------add 2009-02-11-------

#define debug 1

#include

#undef  debugmsg

#define debugmsg(x,s) nkdbgprintfw s //還是這個牛b,編譯的工程非常小。以後就這麼幹了。

然後以build and sysgen方式編譯整個工程,沒有想到這次居然出來了。

難道是這個設定ship_build這個環境變數為0起了作用?

現在慢慢看著先了。

如果修改一點點public下的**就要整個build and sysgen方式編譯那太不厚道了吧。

等下試試,用驅動除錯助手來除錯,一定很有意思。

原因分析:

,突然想起這個mdd中斷的事情,無意間意識到這個mdd執行緒啟動是靠pdd執行緒來帶動的,其實這樣已經獲得了成功了。

只是我一直相信網上大家的文章介紹,陷入了 泥塘。其實這個pdd的執行緒已經完成呼叫mdd的功能。

WINCE 串列埠列印資訊的遮蔽與開啟

第一種 將下面這句 加入到驅動所在目錄中的sources檔案中即可 cdefines cdefines ddebug 第二種 undef debugmsg define debugmsg x,s nkdbgprintfw s 這樣這個驅動檔案裡的所有除錯資訊都會列印出來,並且不理會debugzone...

定時列印資訊

class cl time event definition.public section.class methods auto exe for event finished of cl gui timer importing sender.endclass.cl time event defini...

tomcat 去掉 列印資訊

1.引用 修改startup.bat第42行 call executable start cmd line args 為 call executable run cmd line args logs catalina.txt 然後在此啟動tomcat,再次檢視catalina.txt,預期的資訊果然...