isResetByWDT()

描述

判断上次系统是否曾经被看门狗计时器重置过。

语法


TimerWDT.isResetByWDT()

参数

无。

回传

此函式将回传 boolean 值如下:

  • true:本次开机是由于系统被看门狗计时器重置所引起。
  • false:系统上次是正常关机,没有被看门狗计时器重置。

范例

#include <TimerWDT.h>
 
void setup() 
{
  Serial.begin(9600);
  if(TimerWDT.isResetByWDT() == true)
    Serial.println("Reset by WDT");
  else
    Serial.println("Not reset by WDT");
}
 
void loop()
{
  // 使用者程式 ...
}

See also

reset()


函式库参考主页面

The text of the 86Duino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.