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.