代码拉取完成,页面将自动刷新
同步操作将从 汽车电子/BT_00253_BYD_FAN 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include "sys_api.h"
SLEEP_STRUCT sleep;
u8 time_wakeup_flag=0x00;
void LPTIMNVIC_Config(FunctionalState Cmd);
void Sleep_ctr(void)//
{
#if SLEEP_EN
if( sleep.sleep_en)
{
Output[STB_OUT].GPIOx->PBSC=Output[STB_OUT].PIN;
Output[M_5V_EN].GPIOx->PBC=Output[M_5V_EN].PIN;
}
#endif
}
void EXit_Sleep(void)
{
sleep.sleep_en=0X00;
sleep.sleep_time_ms=0x00;
EXTI->IMASK&=~(1<<15);
EXTI->IMASK&=~(1<<5);
if(sleep.sleep_en==0)
{
sleep.sleep_en=0X00;
mcu_iwdg_clr();
system_init();
SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
}
#if CAN_EN
can_sleepflag=0x00;
_rCanTx.StopsendTime=0x00;
_rCanTx.stopsend=FALSE;
#endif
sleep.sleep_interrupt = 0x00;
SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
}
//B4 B3 C11 C10 B5
void Exit_Config(void)
{
NVIC_InitType NVIC_InitStructure;
EXTI_InitType EXTI_InitStructure;
RCC_EnableAPB1PeriphClk(RCC_APB1_PERIPH_PWR, ENABLE);
GPIO_ConfigEXTILine(GPIOB_PORT_SOURCE, GPIO_PIN_SOURCE15); //PA5
GPIO_ConfigEXTILine(GPIOA_PORT_SOURCE, GPIO_PIN_SOURCE5); //PB15
NVIC_Init(&NVIC_InitStructure);
EXTI_DeInit();
/*Set key input interrupt priority*/
NVIC_InitStructure.NVIC_IRQChannel = EXTI4_15_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPriority = 2;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
/*Configure key EXTI line*/
EXTI_InitStructure.EXTI_Line = EXTI_LINE5;
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling; // EXTI_Trigger_Rising;
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_InitPeripheral(&EXTI_InitStructure);
EXTI_InitStructure.EXTI_Line = EXTI_LINE5;
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising_Falling; // EXTI_Trigger_Rising;
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_InitPeripheral(&EXTI_InitStructure);
EXTI->IMASK&=~(1<<5);
EXTI->IMASK&=~(1<<15);
/* Enable the LSI source */
RCC_EnableLsi(ENABLE);
LPTIMNVIC_Config(ENABLE);
RCC_ConfigLPTIMClk(RCC_LPTIMCLK_SRC_LSI);
RCC_EnableAPB1PeriphClk(RCC_APB1_PERIPH_LPTIM,ENABLE);
/* Enable interrupt */
LPTIM_SetPrescaler(LPTIM,LPTIM_PRESCALER_DIV1);
LPTIM_EnableIT_CMPM(LPTIM);
/* config lptim ARR and compare register */
LPTIM_Enable(LPTIM);
LPTIM_SetAutoReload(LPTIM,35000);
LPTIM_SetCompare(LPTIM,0);
LPTIM_StartCounter(LPTIM,LPTIM_OPERATING_MODE_CONTINUOUS);
}
void LPTIMNVIC_Config(FunctionalState Cmd)
{
EXTI_InitType EXTI_InitStructure;
NVIC_InitType NVIC_InitStructure;
EXTI_ClrITPendBit(EXTI_LINE23);
EXTI_InitStructure.EXTI_Line = EXTI_LINE23;
#ifdef __TEST_SEVONPEND_WFE_NVIC_DIS__
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Event;
#else
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
#endif
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising;
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_InitPeripheral(&EXTI_InitStructure);
/* Enable the RTC Alarm Interrupt */
NVIC_InitStructure.NVIC_IRQChannel = LPTIM_TIM6_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPriority = 3;
NVIC_InitStructure.NVIC_IRQChannelCmd = Cmd;
NVIC_Init(&NVIC_InitStructure);
}
void DBG_init(void)
{
#if SYS_RUN
DBG_ConfigPeriph(DBG_STOP , ENABLE);
DBG_ConfigPeriph(DBG_TIM1_STOP , ENABLE);
DBG_ConfigPeriph(DBG_TIM3_STOP , ENABLE);
DBG_ConfigPeriph(DBG_TIM4_STOP , ENABLE);
DBG_ConfigPeriph(DBG_CAN_STOP , ENABLE);
DBG_ConfigPeriph(DBG_IWDG_STOP , ENABLE);
#endif
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。