新手看不懂代码,求助啊..
时间:10-02
整理:3721RD
点击:
求助大神给我解释下,这是怎么回事。C语言太薄弱了,没看懂这个代码是什么意思,又是睡眠又是唤醒的。
void System_Stop_Mode(void)
{
volatile uint32_t nKB_Config;
RF_PowerOff(); //RF Sleep
#if MEMS_Enable
MEMS_PMU6050_Sleep(); //Sensor Sleep
#endif
Codec_PowerControl(DISABLE, CODEC_MOD_DAC); //DAC Sleep
Codec_PowerControl(DISABLE, CODEC_MOD_ADC); //ADC Sleep
I2S_stop(); //I2S sleep
IO_Sleep_Mode(); //IO sleep
UT_Delay_100us(); //
UT_Delay_100us(); //
MCU_Sleep_Mode(); //MCU sleep
//============================ System Wake up
UT_Delay_100us(); //
SN_WDT->FEED = 0x55AA; //Clear Watch Dog Timer
IO_Wake_Mode(); //IO Wakeup
if(RemoteNoVoiceFlag==1) //Initial Sleep Time
{
sleep_cnt = TIME_SLEEP_NoVoice;
}
else
{
sleep_cnt = TIME_SLEEP;
}
error_continue_cnt = 0;
rate_error = 0;
rate_total[0] = 0;
rate_total[1] = 0;
#if MEMS_Enable
// if((KeyStatus&KEY_AIRMOUSE_DISABLE) != KEY_AIRMOUSE_DISABLE)
if((KeyStatus&KEY_AIRMOUSE_DISABLE) == KEY_AIRMOUSE_DISABLE)//xzj
{
MEMS_PMU6050_WakeUp(); //Sensor Wakeup
}
#endif
if(RemoteNoVoiceFlag==0)
Audio_Init();
audio_flag = 0;//|= AUDIO_CONTROL_MASK;
audio_flag &= ~AUDIO_ENABLE_MASK;
audio_volume = 0;
// initial register
Adpcm_Enc_valprev = 0x8000;
Adpcm_Enc_index = 0;
bSYSTEM_WAKEUP_FLAG = 1;
bSYSTEM_SLEEP_FLAG = 0;
bSYSTEM_STOP_FLAG = 0;
bAR_ALU_Reset = 1;
RemoteCodecSettingFlag=1;
RF_PowerOn();
RF_Switch2Receiver();
RF_RX_Enable();
}
void System_Stop_Mode(void)
{
volatile uint32_t nKB_Config;
RF_PowerOff(); //RF Sleep
#if MEMS_Enable
MEMS_PMU6050_Sleep(); //Sensor Sleep
#endif
Codec_PowerControl(DISABLE, CODEC_MOD_DAC); //DAC Sleep
Codec_PowerControl(DISABLE, CODEC_MOD_ADC); //ADC Sleep
I2S_stop(); //I2S sleep
IO_Sleep_Mode(); //IO sleep
UT_Delay_100us(); //
UT_Delay_100us(); //
MCU_Sleep_Mode(); //MCU sleep
//============================ System Wake up
UT_Delay_100us(); //
SN_WDT->FEED = 0x55AA; //Clear Watch Dog Timer
IO_Wake_Mode(); //IO Wakeup
if(RemoteNoVoiceFlag==1) //Initial Sleep Time
{
sleep_cnt = TIME_SLEEP_NoVoice;
}
else
{
sleep_cnt = TIME_SLEEP;
}
error_continue_cnt = 0;
rate_error = 0;
rate_total[0] = 0;
rate_total[1] = 0;
#if MEMS_Enable
// if((KeyStatus&KEY_AIRMOUSE_DISABLE) != KEY_AIRMOUSE_DISABLE)
if((KeyStatus&KEY_AIRMOUSE_DISABLE) == KEY_AIRMOUSE_DISABLE)//xzj
{
MEMS_PMU6050_WakeUp(); //Sensor Wakeup
}
#endif
if(RemoteNoVoiceFlag==0)
Audio_Init();
audio_flag = 0;//|= AUDIO_CONTROL_MASK;
audio_flag &= ~AUDIO_ENABLE_MASK;
audio_volume = 0;
// initial register
Adpcm_Enc_valprev = 0x8000;
Adpcm_Enc_index = 0;
bSYSTEM_WAKEUP_FLAG = 1;
bSYSTEM_SLEEP_FLAG = 0;
bSYSTEM_STOP_FLAG = 0;
bAR_ALU_Reset = 1;
RemoteCodecSettingFlag=1;
RF_PowerOn();
RF_Switch2Receiver();
RF_RX_Enable();
}