leomode_sel.c
2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
* F i l e N a m e : l e o m o d e _ s e l .c
*
****************************************************************************
* (C) Copyright ALPS Electric Co., Ltd. 1995-1996
****************************************************************************
* Version:
*
* ver date
* ---- ---------
* 1.01 '96-12-27 Rename mode_sel.c to leomode_sel.c
* 1.00 '95-12-20 Initial Revision.
****************************************************************************
*/
#include <ultra64.h>
#include "leodefine.h"
#include "leodrive.h"
#include "leomacro.h"
#include "leoappli.h"
/*************************************/
/* PROTOTYPE */
/*************************************/
void leoMode_sel(void);
/*************************************/
/* EXTERNALY DEFINED FUNCTION */
/*************************************/
extern u8 leoSend_asic_cmd_w_nochkDiskChange(u32 asic_cmd, u32 asic_data);
/*************************************/
/* EXTERNAL RAM */
/*************************************/
extern OSMesg LEOcur_command;
/*************************************/
/* MACROS */
/*************************************/
#define msel_cmd ((LEOCmdModeSelect *)LEOcur_command)
/* ==========================================================================
* Function : leoMode_sel
* --------------------------------------------------------------------------
* Description : Set parameters to drive
* --------------------------------------------------------------------------
* 入力変数 : 無し
* 出力変数 : 無し
* 引数 : 無し
* 戻り値 : 無し
* ==========================================================================
*/
void leoMode_sel(void)
{
u32 sense;
/* Set stand-by timer */
if (sense = leoSend_asic_cmd_w_nochkDiskChange(ASIC_SET_STBY, ((u32)msel_cmd->standby_time << 16)) )
{
goto mselerror;
}
/* Set sleep timer */
if (sense = leoSend_asic_cmd_w_nochkDiskChange(ASIC_SET_SLEEP, ((u32)msel_cmd->sleep_time << 16)) )
{
goto mselerror;
}
/* Set LED on/off timer */
if (sense = leoSend_asic_cmd_w_nochkDiskChange(ASIC_LED_BLINK_RATE, *(u32 *)&msel_cmd->led_on_time ) )
{
mselerror:
msel_cmd->header.sense = sense;
msel_cmd->header.status = LEO_STATUS_CHECK_CONDITION;
return;
}
#ifdef _ERRCHK
if (msel_cmd->header.sense = msel_cmd->header.reserve1 )
msel_cmd->header.status = LEO_STATUS_CHECK_CONDITION;
else
msel_cmd->header.status = LEO_STATUS_GOOD;
#else
msel_cmd->header.sense = sense;
msel_cmd->header.status = LEO_STATUS_GOOD;
#endif
return;
}