leotestunit.c 2.14 KB
/*
 *  F i l e N a m e : l e o t e s t u n i t . c
 *
 ****************************************************************************
 *                   (C) Copyright ALPS Electric Co., Ltd. 1995-1996
 ****************************************************************************
 *  Version:
 *
 *  ver       date
 *  ----    ---------
 *  1.03    '96-11-05  Add leoChk_cur_drvmode().
 *  1.02    '96-09-17  Change leoTest_unit_rdy() function.
 *  1.01    '96-02-27  Rename file name testunit.c to leotestunit.c .
 *  1.00    '95-12-20  Initial Revision.
 ****************************************************************************
 */
#include "os.h"

#include <ultra64.h>
#include "leodefine.h"
#include "leomacro.h"
#include "leoappli.h"

/*************************************/
/* PROTOTYPE                         */
/*************************************/
void leoTest_unit_rdy(void);

/*************************************/
/* EXTERNAL RAMs                     */
/*************************************/
extern OSMesg LEOcur_command;
extern OSPiHandle *LEOPiInfo;

/*************************************/
/* MACROS                            */
/*************************************/
#define tur_cmd     ((LEOCmdTestUnitReady *)LEOcur_command)

/* ==========================================================================
* Function : leoTest_unit_rdy
* --------------------------------------------------------------------------
* Description : Excute test_unit_ready command
* --------------------------------------------------------------------------
* IN   : LEOcur_command
* OUT  : *LEOcur_command
* ARG  : non
* RET  : non
* ==========================================================================
*/
void leoTest_unit_rdy(void)
{
    /* This function is called TEST_UNIT_READY  GOOD case only  */
    tur_cmd->test          = leoChk_cur_drvmode();
#ifdef _ERRCHK
    if (tur_cmd->header.sense = tur_cmd->header.reserve1 )
        tur_cmd->header.status = LEO_STATUS_CHECK_CONDITION;
    else
        tur_cmd->header.status = LEO_STATUS_GOOD;
#else
    tur_cmd->header.sense  = LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION;
    tur_cmd->header.status = LEO_STATUS_GOOD;
#endif
}