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.

45 lines
1.4 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. # README
  2. ```html
  3. 串口中断频繁触发:
  4. 发送缓冲器空中断
  5. 接收缓冲器满中断
  6. 接收帧错误中断
  7. 这三个中断一直为真
  8. PS:由于接收帧错误中断为真,导致串口中断频繁触发
  9. 并且在中断中有串口发送函数,调用printf时也有串口发送函数,这就造成了调用printf时while ((status == RESET) && (count != 0x1CE2));会等待,从而导致按键触发不灵敏或者丢失事件
  10. ```
  11. fputc的方法实现
  12. ![image-20220307142829750](markdown.assets/%E8%BD%AF%E4%BB%B6%E5%87%BA%E9%94%99%E8%AE%B0%E5%BD%95.assets/image-20220307142829750.png)
  13. 串口中断
  14. ![image-20220307142849314](markdown.assets/%E8%BD%AF%E4%BB%B6%E5%87%BA%E9%94%99%E8%AE%B0%E5%BD%95.assets/image-20220307142849314.png)
  15. ## 第一个BUG现象
  16. ![image-20220303182554789](markdown.assets/%E8%BD%AF%E4%BB%B6%E5%87%BA%E9%94%99%E8%AE%B0%E5%BD%95.assets/image-20220303182554789.png)
  17. ```
  18. 当着这几根线连接开发板时,按键使用正常
  19. 当着这几根线不连接开发板时,按键反应迟钝偶尔还会丢失事件
  20. ```
  21. ## 如何解决
  22. ![image-20220307142302109](markdown.assets/%E8%BD%AF%E4%BB%B6%E5%87%BA%E9%94%99%E8%AE%B0%E5%BD%95.assets/image-20220307142302109.png)
  23. ## 第二个BUG现象
  24. ```
  25. 按键使用下降沿触发的时候,按键反应迟钝偶尔还会丢失事件
  26. ```
  27. 造成这个bug的原因和第一个BUG一样