Microchip® Advanced Software Framework

xmega/drivers/wdt/unit_tests/unit_tests.c File Reference

Unit tests for Watchdog timer module.

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

#include <conf_test.h>
#include <asf.h>

Functions

int main (void)
 Set up and run test suite. More...
 
static void mdelay (uint16_t ms)
 Delay for ms milliseconds. More...
 
static void run_reset_cause_test (const struct test_case *test)
 Run test to check last reset cause. More...
 

Variables

bool wdt_rc
 Flag to indicate if last reset is caused by watchdog timeout. More...
 

static void mdelay ( uint16_t  ms)
static

Delay for ms milliseconds.

Parameters
msnumber of milliseconds to busy wait

References sysclk_get_cpu_hz().

Referenced by main().

static void run_reset_cause_test ( const struct test_case test)
static

Run test to check last reset cause.

This test will pass if last reset was caused by a watchdog timeout.

Parameters
testCurrent test case.

References test_assert_true, and wdt_rc.

Referenced by main().

bool wdt_rc

Flag to indicate if last reset is caused by watchdog timeout.

Referenced by main(), and run_reset_cause_test().