update
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#include "bsp_Led.h"
|
||||
#include "app_timer.h"
|
||||
|
||||
#define LED_ON HAL_GPIO_WritePin (LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET)
|
||||
#define LED_OFF HAL_GPIO_WritePin (LED_GPIO_Port, LED_Pin, GPIO_PIN_SET)
|
||||
#define LED_TOGGLE HAL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin)
|
||||
|
||||
|
||||
|
||||
static void bsp_led_init(void);
|
||||
static void bsp_led_task(void);
|
||||
|
||||
bsp_led_t led =
|
||||
{
|
||||
.init = bsp_led_init,
|
||||
.task = bsp_led_task,
|
||||
};
|
||||
/*其他外设初始化后快速闪烁,提示初始化完成*/
|
||||
static void bsp_led_init(void)
|
||||
{
|
||||
for(u8 i = 0;i < 20;i++)
|
||||
{
|
||||
delay_ms(50);
|
||||
HAL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
|
||||
}
|
||||
}
|
||||
|
||||
static void bsp_led_task(void)
|
||||
{
|
||||
HAL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
|
||||
}
|
||||
Reference in New Issue
Block a user