ide_test.c

来自「dm270 source code」· C语言 代码 · 共 49 行

C
49
字号
/*
Module Name	: ide_test.c

Functions	: IDE_TEST
    
Purpose		: Test ide function

Notes		: 
This function is initialize ide and compare hard disk code
*/

// Local header files
#include <demo/uart270.h>
#include <demo/sagiters.h>

// Global variables
extern unsigned short drive_info_src[10];

// Extern global variables
extern char UART_outBuff[1024];

const unsigned short hard_disk_info[] = 
{
0x4849, 0x5441, 0x4348, 0x495F, 0x444B,
0x3134, 0x4641, 0x2D32, 0x3020, 0x2020
};

//
// Test ide, read hard disk code 

void IDE_TEST(void){
	unsigned int check;
	
	UART_sendString( UART0, "\r\n ****************IDE  TEST****************" );
	
	IDE_CTRL(ON);	
	ide_drive();
	check = 0;
	check = memcmp(drive_info_src, hard_disk_info, 10);
	if( check == 0 )
		UART_sendString( UART0, "\r\n PASS " );
	else
		UART_sendString( UART0, "\r\n ERROR " );

	UART_sendString( UART0, "\r\n " );
	
	IDE_CTRL(OFF);
}

⌨️ 快捷键说明

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