📄 func.c
字号:
#define __FUNCC__
#include "Header\Include.h"
//---------------------------------------------
void SetVolume()
{
unsigned int iVolume;
if((stOsdUserData.Volume == 0) || (GET_MUTE_STATE() == STATE_MUTEON))
{
if(_VOLUME_INV) bVOLUME_PWM = 255;
else bVOLUME_PWM = 0;
MUTE_ON();
return;
}
MUTE_OFF();
iVolume = (unsigned int)(_MAX_VOLUME - _MIN_VOLUME) * stOsdUserData.Volume / 100;
if(_VOLUME_INV)
iVolume = _MAX_VOLUME - iVolume;
else
iVolume = _MIN_VOLUME + iVolume;
#if(_VOLUME_CTRL_TYPE == _PWM_MCU)
bVOLUME_PWM = iVolume;
#elif(_VOLUME_CTRL_TYPE == _PWM_SCALER)
SetRTDPWM(bVOLUME_PWM,iVolume);
#endif
}
//---------------------------------------------
unsigned char code ucSourceMask = (_VGA_SUPPORT << _SOURCE_VGA) |
(_TMDS_SUPPORT << _SOURCE_DVI);
bit ChangeSource()
{
unsigned char i;
unsigned char ucMask = ucSourceMask >> (stSystemData.InputSource + 1);
//Find next source
for(i=stSystemData.InputSource + 1;i<_INPUT_PORT_MAX;i++)
{
if(ucMask & 0x01)
{
stSystemData.InputSource = i;
return 1;
}
ucMask >>= 1;
}
ucMask = ucSourceMask;
for(i=0;i<stSystemData.InputSource;i++)
{
if(ucMask & 0x01)
{
stSystemData.InputSource = i;
return 1;
}
ucMask >>= 1;
}
return 0;
}
//---------------------------------------------
#if(_KEY_TYPE == _KEY_ADC)
//------------------------------------------------------------
#if(_MCU_TYPE == _MYSON_MTV512 || _MCU_TYPE == _STK_6021)
unsigned char GetADCData(unsigned char ucADID)
{
BYTE ucADCCurrData = 0;
MCU_ADC_F10 = 0x80 | (0x01 << ucADID); // Enable ADC
CTimerDelayXms(3);
ucADCCurrData = (MCU_ADC_F10 & 0x3f); // Read ADC data
MCU_ADC_F10 = 0x00; // Disable ADC
return ucADCCurrData;
}
#endif //#if(_MCU_TYPE == _MYSON_MTV512 || _MCU_TYPE == _STK_6021)
#endif //#if(KEY_TYPE == KEY_ADC)
//------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -