Beispiel #1
0
/** Handler for the WDT hardware module interrupt. */
void WDT_Handler(void)
{
	wdt_clear_early_warning();

	if (wdt_early_warning_callback) {
		wdt_early_warning_callback();
	}
}
/**
 * \brief Test Early Warning of Watchdog module
 *
 * If last reset cause was not Watchdog, following the Watchdog initialization
 * and enabling in the previous test, this function will wait for
 * CONF_WDT_EARLY_WARNING_WAIT_MS and will check if early warning flag is set.
 * Consequently, clear the early warning flag.
 *
 * \param test Current test case.
 */
static void run_wdt_early_warning_test(const struct test_case *test)
{
	/* Check if last reset was by Watchdog module */
	if (wdr_flag == false) {
		/* Wait for Early Warning flag to be set */
		delay_ms(CONF_WDT_EARLY_WARNING_WAIT_MS);

		/* Check if the Early Warning flag is set */
		test_assert_true(test, wdt_is_early_warning() == true,
				"Early Warning failed \n");

		/* Clear the Early Warning flag */
		wdt_clear_early_warning();
	}
}