Microchip® Advanced Software Framework

wdt_example.c File Reference

AVR XMEGA WDT driver example.

Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.

#include <asf.h>

Enumerations

enum  wdt_example_state_t {
  START_OF_PROG = 1,
  WDT_MCU_RESET = 2,
  REFRESH_NO_WIN = 3,
  REFRESH_WINDOW = 4,
  WDT_RST_NO_WIN = 5,
  WDT_RST_WINDOW = 6,
  WDT_RST_RFSH_W = 7,
  END_OF_PROG = 8,
  ERROR_STATE = 9
}
 brief States of the example. More...
 

Functions

static void led_display (uint8_t led_val)
 LED display value. More...
 
int main (void)
 Main function. More...
 

Variables

enum wdt_example_state_t state_flag
 Global variables not initialized. More...
 

brief States of the example.

Enumerator
START_OF_PROG 

Writing tests in WDT.

WDT_MCU_RESET 

MCU reset using WDT.

REFRESH_NO_WIN 

WDT in normal mode, 8x wdt_reset() before TIMEOUT (TO)

REFRESH_WINDOW 

WDT in window mode, 4x wdt_reset() when window is opened & before TO.

WDT_RST_NO_WIN 

WDT in normal mode, no wdt_reset(), reaching the TO.

WDT_RST_WINDOW 

WDT in window mode, no wdt_reset(), reaching the TO.

WDT_RST_RFSH_W 

WDT in window mode, wdt_reset() when window is closed.

END_OF_PROG 

MCU software Reset and the program restarts.

ERROR_STATE 

WDT error (loop without end)

static void led_display ( uint8_t  led_val)
static

LED display value.

Parameters
led_valLED display value

Referenced by main().

enum wdt_example_state_t state_flag

Global variables not initialized.