如何在AVR单片机中使用看门狗
How to use watchdog in AVR microcontroller
您好,我正在研究看门狗,但我有点困惑,它向我显示了一些错误。我正在使用 AVR(AVR128DB48)。
错误:
WDTO_4S' undeclared (first use in this function)
recipe for target 'main.o' failed
代码:
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/wdt.h>
int main(void)
{
wdt_enable(WDTO_4S);
while(1)
{
wdt_reset();
}
return(0);
}
从未使用过这部分,但我可以快速 Google 搜索。从内联文档 header 本身:
#define WDTO_4S 8
Note: This is only available on the ATtiny2313, ATtiny24, ATtiny44, ATtiny84, ATtiny25, ATtiny45, ATtiny85, ATtiny261, ATtiny461, ATtiny861, ATmega48, ATmega88, ATmega168, ATmega48P, ATmega88P, ATmega168P, ATmega328P, ATmega164P, ATmega324P, ATmega644P, ATmega644, ATmega640, ATmega1280, ATmega1281, ATmega2560, ATmega2561, ATmega8HVA, ATmega16HVA, ATmega32HVB, ATmega406, ATmega1284P, AT90PWM1, AT90PWM2, AT90PWM2B, AT90PWM3, AT90PWM3B, AT90PWM216, AT90PWM316, AT90PWM81, AT90USB82, AT90USB162, AT90USB646, AT90USB647, AT90USB1286, AT90USB1287, ATtiny48, ATtiny88.
您好,我正在研究看门狗,但我有点困惑,它向我显示了一些错误。我正在使用 AVR(AVR128DB48)。
错误:
WDTO_4S' undeclared (first use in this function)
recipe for target 'main.o' failed
代码:
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/wdt.h>
int main(void)
{
wdt_enable(WDTO_4S);
while(1)
{
wdt_reset();
}
return(0);
}
从未使用过这部分,但我可以快速 Google 搜索。从内联文档 header 本身:
#define WDTO_4S 8
Note: This is only available on the ATtiny2313, ATtiny24, ATtiny44, ATtiny84, ATtiny25, ATtiny45, ATtiny85, ATtiny261, ATtiny461, ATtiny861, ATmega48, ATmega88, ATmega168, ATmega48P, ATmega88P, ATmega168P, ATmega328P, ATmega164P, ATmega324P, ATmega644P, ATmega644, ATmega640, ATmega1280, ATmega1281, ATmega2560, ATmega2561, ATmega8HVA, ATmega16HVA, ATmega32HVB, ATmega406, ATmega1284P, AT90PWM1, AT90PWM2, AT90PWM2B, AT90PWM3, AT90PWM3B, AT90PWM216, AT90PWM316, AT90PWM81, AT90USB82, AT90USB162, AT90USB646, AT90USB647, AT90USB1286, AT90USB1287, ATtiny48, ATtiny88.