12345678910111213141516171819202122232425 |
- #include "includes.h"
- /**********************************************************************************************************
- *外部看门狗IO初始化
- ************************************************************************************************************/
- void ExtWatchDogInit()
- {
-
- GPIO_InitTypeDef GPIO_InitStructure;
- RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOA,ENABLE);
- GPIO_InitStructure.GPIO_Pin = EXTWATCHDOG_PIN;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;//GPIO_Mode_IPU; 用IPU输出电压很低
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_Init(EXTWATCHDOG_PORT, &GPIO_InitStructure);
- //高脉冲宽度至少70ns以上,下降沿喂狗
- EXTWATCHDOG_HIGH;
- __nop();__nop();__nop();__nop();__nop();__nop();__nop();__nop();
- EXTWATCHDOG_LOW;
- __nop();__nop();__nop();__nop();__nop();__nop();__nop();__nop();
- EXTWATCHDOG_HIGH;
- __nop();__nop();__nop();__nop();__nop();__nop();__nop();__nop();
- EXTWATCHDOG_LOW;
- }
|