You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.1 KiB
49 lines
1.1 KiB
#include "led.h"
|
|
/**
|
|
* @brief 初始化LED1 PA4
|
|
* 将PE4配置为输出模式,初始化为高电平
|
|
*/
|
|
void led_config(void)
|
|
{
|
|
debug_led_pin = 0; //将PB6配置为输出模式
|
|
debug_led_port |= (0x01 << 6); //将PB6初始化高电平
|
|
}
|
|
|
|
void jerk_key_config(void)
|
|
{
|
|
/**
|
|
* @brief 初始化蜂鸣器 PB0
|
|
* 初始化为低电平默认不响
|
|
*
|
|
*/
|
|
jerk_pin = 1; //输入
|
|
}
|
|
void beep_config(void)
|
|
{
|
|
/**
|
|
* @brief jt的引脚初始化 PA0
|
|
* 模式设置为输入模式,获取PAT0的电平
|
|
*
|
|
*/
|
|
beep_pin = 0; //输出
|
|
beep_port &= ~(0x01 << 0); //低电平
|
|
}
|
|
|
|
|
|
|
|
void debug_light_ctrl_process_in_main_loop() {
|
|
/**
|
|
* @brief 蓝色灯的闪烁300ms
|
|
*
|
|
*/
|
|
static uint32_t last_ctrl_light_ticket = 0;
|
|
|
|
uint16_t flicker_period = configDebugLightFlipPeriodMS;
|
|
if (hal_has_passedms(last_ctrl_light_ticket) > flicker_period) {
|
|
static uint8_t debuglight_state = false;
|
|
DEBUG_LIGHT_IO() = debuglight_state;
|
|
debuglight_state = !debuglight_state;
|
|
last_ctrl_light_ticket = hal_get_ticket();
|
|
}
|
|
}
|
|
|