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

  1. #include "led.h"
  2. /**
  3. * @brief LED1 PA4
  4. * PE4配置为输出模式
  5. */
  6. void led_config(void)
  7. {
  8. debug_led_pin = 0; //将PB6配置为输出模式
  9. debug_led_port |= (0x01 << 6); //将PB6初始化高电平
  10. }
  11. void jerk_key_config(void)
  12. {
  13. /**
  14. * @brief PB0
  15. *
  16. *
  17. */
  18. jerk_pin = 1; //输入
  19. }
  20. void beep_config(void)
  21. {
  22. /**
  23. * @brief jt的引脚初始化 PA0
  24. * PAT0的电平
  25. *
  26. */
  27. beep_pin = 0; //输出
  28. beep_port &= ~(0x01 << 0); //低电平
  29. }
  30. void debug_light_ctrl_process_in_main_loop() {
  31. /**
  32. * @brief 300ms
  33. *
  34. */
  35. static uint32_t last_ctrl_light_ticket = 0;
  36. uint16_t flicker_period = configDebugLightFlipPeriodMS;
  37. if (hal_has_passedms(last_ctrl_light_ticket) > flicker_period) {
  38. static uint8_t debuglight_state = false;
  39. DEBUG_LIGHT_IO() = debuglight_state;
  40. debuglight_state = !debuglight_state;
  41. last_ctrl_light_ticket = hal_get_ticket();
  42. }
  43. }