debug.c

来自「一个操作系统源代码 用于嵌入式设备 在Vc++环境下仿真 成功移植到多款处理器上」· C语言 代码 · 共 43 行

C
43
字号
#define _SIZE_T_DEFINED
#include <windows.h>
#include <string.h>
#include <stdio.h>

#include <kernel\ros33\ros33.h>

// simulator header
#include <simsrv\export\simsrv.h>

__declspec( dllimport ) char		tcaDebugLog[82];

extern HANDLE	hEnEventInt;

void AppendDebugLogString( char *text, FILE *file )
{
    ID id;

	ResetEvent( hEnEventInt );	// disable interrupt

	if( file == NULL )
	{
		get_tid( &id );
		sprintf( tcaDebugLog, "%02d:", id );
		strncpy( tcaDebugLog+3, text, 77 );
		tcaDebugLog[80]=0;
//		PostMessage( hwndPanel, WM_USER, 0, 0 );
		SendMessage( hwndPanel, WM_USER, 0, 0 );
	}
	else
		fprintf( file, "%s\n", text );

	SetEvent( hEnEventInt );	// enable interrupt

	return;
}

void DebugLog( char *format, ... )
{
//	var_list

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?