⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 messages.c

📁 详细介绍了一篇关于pci开发的接口芯片
💻 C
字号:
/*
	messages.c
*/

// standard libs..
#include <stdtypes.h>
#include <string.h>
#include <stdio.h>

// custom libs...
#include <clib1.h>

extern CHAR errstring[], text[];


int data_err8( CHAR *str, UINT32 offset, UINT8 sb_data, UINT8 ws_data )
/* 
	Adds info string to errstring, then calls sb_ws.

	Entry:	str - informational string to apply first (can be NULL )
			address - address of the miscompare
			sb_data - what the data should be 
			ws_data - what was actaully seen
	Return:	FALSE

	NOTE: 	All offsets are assumed to be byte offset unless specifically stated 
			otherwise by caller.
*/
{
	if ( str != NULL )  strcat( errstring, str );
	return( sb_ws8( offset, sb_data, ws_data ) );
}

int data_err16( CHAR *str, UINT32 offset, UINT16 sb_data, UINT16 ws_data )
/* 	see data_err_8 */
{
	if ( str != NULL )  strcat( errstring, str );
	return( sb_ws16( offset, sb_data, ws_data ) );
}

int data_err32( CHAR *str, UINT32 offset, UINT32 sb_data, UINT32 ws_data )
/* 	see data_err_8 */
{
	if ( str != NULL )  strcat( errstring, str );
	return( sb_ws32( offset, sb_data, ws_data ) );
}


int sb_ws8( UINT32 offset, UINT8 sb_data, UINT8 ws_data )
/* 
	Adds miscompare info to string, and returns FALSE.

	Entry:	address - address of the miscompare
			sb_data - what the data should be 
			ws_data - what was actaully seen
	Return:	FALSE
*/
{
	sprintf( text, "Miscompare at offset %4.4lx. SB: %2.2x  WS:  %2.2x.\n", \
		offset, sb_data, ws_data );
	strcat( errstring, text );
	return( FALSE );
}

int sb_ws16( UINT32 offset, UINT16 sb_data, UINT16 ws_data )
/* see sb_ws8 */
{
	sprintf( text, "Miscompare at offset %4.4lx. SB: %4.4x  WS:  %4.4x.\n", \
		offset, sb_data, ws_data );
	strcat( errstring, text );
	return( FALSE );
}


int sb_ws32( UINT32 offset, UINT32 sb_data, UINT32 ws_data )
/* see sb_ws8 */
{
	sprintf( text, "Miscompare at offset %4.4lx. SB: %8.8lx  WS:  %8.8lx.\n", \
		offset, sb_data, ws_data );
	strcat( errstring, text );
	return( FALSE );
}

⌨️ 快捷键说明

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