Interrupts()

来自YFRobotwiki
跳转至: 导航搜索

描述

重新启用中断(在被noInterrupts()禁用之后)。 中断允许某些重要任务在后台进行,默认情况下启用。 某些功能在中断被禁用时不起作用,传入通信可能会被忽略。 中断可能会稍微中断代码的时间,但是,特别关键的代码段可能会被禁用。


示例

void setup() {}

void loop()
{
  noInterrupts();
  // critical, time-sensitive code here
  interrupts();
  // other code here
}


扩展阅读

- noInterrupts()
- attachInterrupt()
- detachInterrupt()




返回Arduino语法参考列表

更多建议和问题欢迎反馈至 YFRobot论坛