feat:新建项目文件
BLV主机C1P模块
This commit is contained in:
33
MCU_Driver/led.c
Normal file
33
MCU_Driver/led.c
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* led.c
|
||||
*
|
||||
* Created on: 2025<32><35>5<EFBFBD><35>15<31><35>
|
||||
* Author: cc
|
||||
*/
|
||||
|
||||
#include "led.h"
|
||||
#include "debug.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
__attribute__((section(".non_0_wait"))) void SYS_LED_Init(void)
|
||||
{
|
||||
GPIOA_ModeCfg(GPIO_Pin_12,GPIO_ModeOut_PP); //LED
|
||||
|
||||
SYS_LED_ON;
|
||||
}
|
||||
|
||||
__attribute__((section(".non_0_wait"))) void SYS_LED_Task(void)
|
||||
{
|
||||
static uint32_t led_tick = 0;
|
||||
|
||||
if(SysTick_1ms - led_tick >= 1000 ){
|
||||
led_tick = SysTick_1ms;
|
||||
|
||||
SYS_LED_FLIP;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user