Microchip® Advanced Software Framework

wdt_example_sam4l.c File Reference

Watchdog Timer (WDT) example for SAM4L.

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

#include <asf.h>
#include "conf_example.h"

Macros

#define BLINK_PERIOD   500
 LED blink time in millisecond. More...
 
#define WDT_RESTART_PERIOD   2000
 Watchdog period in millisecond. More...
 

Functions

static void configure_console (void)
 Configure serial console. More...
 
int main (void)
 
static void set_toggle_flag (void)
 Interrupt handler for EIC interrupt. More...
 
void SysTick_Handler (void)
 Handler for System Tick interrupt. More...
 

Variables

volatile uint8_t g_b_button_event = 0
 Push button event. More...
 
volatile bool g_b_systick_event = false
 System Tick event flag. More...
 
volatile uint32_t g_ul_ms_ticks = 0
 System tick increased by 1 every millisecond. More...
 
struct wdt_config g_wdt_cfg
 WDT configuration. More...
 
struct wdt_dev_inst g_wdt_inst
 WDT instance. More...
 

#define BLINK_PERIOD   500

LED blink time in millisecond.

Referenced by main().

#define WDT_RESTART_PERIOD   2000

Watchdog period in millisecond.

Referenced by main().

static void configure_console ( void  )
static

Configure serial console.

References uart_rs232_options::baudrate, and stdio_serial_init().

Referenced by main().

static void set_toggle_flag ( void  )
static

Interrupt handler for EIC interrupt.

References eic_line_clear_interrupt(), eic_line_interrupt_is_pending(), and g_b_button_event.

Referenced by main().

void SysTick_Handler ( void  )

Handler for System Tick interrupt.

References g_b_systick_event, and g_ul_ms_ticks.

volatile uint8_t g_b_button_event = 0

Push button event.

Referenced by main(), and set_toggle_flag().

volatile bool g_b_systick_event = false

System Tick event flag.

Referenced by main(), and SysTick_Handler().

volatile uint32_t g_ul_ms_ticks = 0

System tick increased by 1 every millisecond.

struct wdt_config g_wdt_cfg

WDT configuration.

Referenced by main().

struct wdt_dev_inst g_wdt_inst

WDT instance.

Referenced by main().