/********************** 头文件 *************************/ #include "bsp_gpio.h" /********************** 变量区 *************************/ /********************** 函数声明区 *************************/ void gpio_init(void) { nrf_gpio_cfg_output(LED); nrf_gpio_cfg_input(28,NRF_GPIO_PIN_PULLUP); nrf_gpio_cfg_input(29,NRF_GPIO_PIN_PULLUP); nrf_gpio_cfg_input(2,NRF_GPIO_PIN_PULLUP); nrf_gpio_cfg_input(3,NRF_GPIO_PIN_PULLUP); nrf_gpio_cfg_output(MT_EN); gpio_mt_run(50); } static uint32_t mt_time = 0; void gpio_mt_run(uint32_t tim) { mt_time = tim; nrf_gpio_pin_write(MT_EN,1); } void gpio_mt_process(void) { if(mt_time>0){ mt_time--; if(mt_time==0) nrf_gpio_pin_write(MT_EN,0); } }