Microchip® Advanced Software Framework

unit_tests.c File Reference

Unit tests for RSWDT driver.

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

#include <stdint.h>
#include <stdbool.h>
#include <board.h>
#include <sysclk.h>
#include <rswdt.h>
#include <string.h>
#include <unit_test/suite.h>
#include <stdio_serial.h>
#include <conf_test.h>
#include <conf_board.h>

Functions

static void delay_ms (uint32_t ul_dly_ticks)
 Delay number of tick Systicks (happens every 1 ms). More...
 
int main (void)
 Run RSWDT driver unit tests. More...
 
static void run_rswdt_test (const struct test_case *test)
 Test reinforced safety watchdog setting. More...
 
void SysTick_Handler (void)
 SysTick handler. More...
 
void WDT_Handler (void)
 RSWDT interrupt handler.RSWDT and WDT are the same as the interrupt number. More...
 

Variables

static volatile int gs_rswdt_triggered = 0U
 
static volatile uint32_t gs_ul_ms_ticks = 0U
 

static void delay_ms ( uint32_t  ul_dly_ticks)
static

Delay number of tick Systicks (happens every 1 ms).

References gs_ul_ms_ticks.

Referenced by run_rswdt_test().

static void run_rswdt_test ( const struct test_case test)
static

Test reinforced safety watchdog setting.

This test sets the reinforced safety watchdog to trigger an interrupt every 100ms.

Parameters
testCurrent test case.

References delay_ms(), gs_rswdt_triggered, rswdt_init(), RSWDT_IRQn, rswdt_restart(), and test_assert_true.

Referenced by main().

void SysTick_Handler ( void  )

SysTick handler.

References gs_ul_ms_ticks.

void WDT_Handler ( void  )

RSWDT interrupt handler.RSWDT and WDT are the same as the interrupt number.

References gs_rswdt_triggered.

volatile int gs_rswdt_triggered = 0U
static

Referenced by run_rswdt_test(), and WDT_Handler().

volatile uint32_t gs_ul_ms_ticks = 0U
static

Referenced by delay_ms(), and SysTick_Handler().