📄 rearview.c
字号:
/*Modified by Wayland 2006.10.26*/
#include "indash.h"
#ifdef Rearview
/*added by Wayland 2006.10.26*/
extern bit Rearview_OnOff;
extern bit Rearview_Enable;
//extern unsigned char Save_CurrentState;
extern unsigned char cnt_low;
extern unsigned char cnt_high;
//extern bit power_state;
extern unsigned char SPEAKER;
extern char Current_Status;
extern char IR_Data_OK_Flag;
extern char IR_Repeat_Data_Flag;
void Rearview_Det(void)
{
//bit IR_state;
static bit speaker_state;
static bit power_state;
EX0=0;
if(Rearview_Enable)
{
if(!REARVIEW_DET)//REARVIEW_DET LOW
{
if(cnt_high==0)
{
if(cnt_low++>2)
{
if(!Rearview_OnOff)//Rearview mirror haven't opened
{
//Save_CurrentState=Current_Status;
//Current_Status=IS_REARVIEW;
Rearview_OnOff=ON;
if(!(speaker_state=SPEAKER))//if speaker open,close it.Otherwise don't care
Mute_Enable();
power_state=EEPROM_Receive_25_Bit(OP_READ, EE_POWER_STATUS_ADDR);
if(power_state)//power still on
{
LIGHT_POWER=OFF;
SOURCE_SEL=ON;
Delay(10000);
/*LIGHT_POWER=ON;
Reset_OSD();
Delay(1000);
Current_Status=IS_NORMAL;*/
}
else //power is off
{
Power_ON();
SOURCE_SEL=ON;
Delay(500);
OSD_Init();
DA_88347_Init();
LIGHT_POWER=ON;
Reset_OSD();
Delay(1000);
Current_Status=IS_NORMAL;
}
}
else
{
cnt_low=0;
Rearview_OnOff=ON;
goto exit;
}
}
else
{
goto exit;
}
//Rearview_Enable=True;
}
else
{
cnt_low=0;
goto exit;
}
}
else //REARVIEW_DET high
{
if(cnt_low==0)
{
if(cnt_high++>2)
{
if(Rearview_OnOff)
{
if(!(speaker_state))
Mute_Disable();
if(power_state)
{
LIGHT_POWER=OFF;
SOURCE_SEL=OFF;
Delay(500);
//SOURCE_SEL=OFF;
Reset_OSD();
Current_Status=IS_NORMAL;
LIGHT_POWER=ON;
Delay(1000);
}
else
{
LIGHT_POWER = DISABLE;
PANEL_POWER = DISABLE;
INVER_POWER = DISABLE;
FM_POWER = DISABLE;
LED_POWER = 1;
SOURCE_SEL=OFF;
Current_Status = IS_POWER_OFF;
EEPROM_Transmit_25_Bit(OP_WRITE, EE_POWER_STATUS_ADDR, OFF);
IR_Repeat_Data_Flag = False;
IR_Data_OK_Flag = False;
Delay(1000);
}
Rearview_OnOff=OFF;
}
else
{
cnt_high=0;
Rearview_OnOff=OFF;
goto exit;
}
}
else
{
goto exit;
}
}
else
{
cnt_high=0;
goto exit;
}
}
}
exit:
EX0=1;
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -