📄 cmd_complete466.c
字号:
/*
;*************************************************************************************
; Program Name : Cmd_Complete466.etb *
; *
; Function : This program will be used to inquire for the Command complete *
; Interrupt each time the SCSI Command is issued. *
; Date : October 07, 1998 *
; *
; Written by : Hai Le *
;*************************************************************************************
*/
#define GLB extern
#include <stdio.h>
#include <conio.h>
#include <sys\types.h>
#include <sys\timeb.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
#include <dos.h>
#include "fas466defs.h"
#include "fas466regs.h"
#include "fas466globalvars.h"
void Cmd_Complete466()
{
unsigned char bc_loop = 0;
unsigned long Cmd_cmpt_stat = 0;
unsigned long CmdCmptLoopCount = 0;
unsigned char SC_Cmd_Read = 0;
do {
Cmd_cmpt_stat = RegRead(SC_Command_Interrupt_Status);
CmdCmptLoopCount = CmdCmptLoopCount + 1;
} while ((Cmd_cmpt_stat == 0) & (CmdCmptLoopCount < 0x40000 ));
Cmd_cmpt_stat = RegRead(SC_Command_Interrupt_Status);
if ( Cmd_cmpt_stat == 0x88) {
CmdCmptLoopCount = 0x40000;
}
if (Cmd_cmpt_stat != ExpCmdCmptStat) {
if (Cmd_cmpt_stat == 0x40)
RegWrite(SC_Command , 0x70) ; // BSY glitch workaround
else
{
printf(" **** Unexpected Command interrupt Status! = %0x\n",Cmd_cmpt_stat);
printf(" SC_Command = %0x\n", RegRead (SC_Command));
printf(" SC_Command_Interrupt_Status = %0x\n", RegRead(SC_Command_Interrupt_Status));
printf(" Error interrupt Status! = %0x\n", RegRead (SC_Error_Interrupt_Status));
printf(" SC_FIFO_Count = %0x\n", RegRead (SC_FIFO_Count));
if (RegRead (SC_FIFO_Count) != 0)
{
printf(" SC_FIFO = %0x\n", RegRead (SC_FIFO));
printf(" SC_FIFO = %0x\n", RegRead (SC_FIFO));
printf(" SC_FIFO = %0x\n", RegRead (SC_FIFO));
}
VerifyError++;
do {}
while (1);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -