From b24866225a6301d3a663f874725e83c012dc25d3 Mon Sep 17 00:00:00 2001 From: Florent Duchon Date: Wed, 26 Dec 2012 17:36:00 +0100 Subject: digital/beacon: add bitcloud stack into common directory digital/zigbit --- .../Components/HAL/avr/atmega1281/common/src/wdt.c | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 digital/zigbit/bitcloud/stack/Components/HAL/avr/atmega1281/common/src/wdt.c (limited to 'digital/zigbit/bitcloud/stack/Components/HAL/avr/atmega1281/common/src/wdt.c') diff --git a/digital/zigbit/bitcloud/stack/Components/HAL/avr/atmega1281/common/src/wdt.c b/digital/zigbit/bitcloud/stack/Components/HAL/avr/atmega1281/common/src/wdt.c new file mode 100644 index 00000000..d9c5a859 --- /dev/null +++ b/digital/zigbit/bitcloud/stack/Components/HAL/avr/atmega1281/common/src/wdt.c @@ -0,0 +1,79 @@ +/**************************************************************************//** + \file wdt.c + + \brief Implementation of WDT interrupt handler. + + \author + Atmel Corporation: http://www.atmel.com \n + Support email: avr@atmel.com + + Copyright (c) 2008-2011, Atmel Corporation. All rights reserved. + Licensed under Atmel's Limited License Agreement (BitCloudTM). + + \internal + History: + 29/05/07 E. Ivanov - Created + ******************************************************************************/ +/****************************************************************************** + * WARNING: CHANGING THIS FILE MAY AFFECT CORE FUNCTIONALITY OF THE STACK. * + * EXPERT USERS SHOULD PROCEED WITH CAUTION. * + ******************************************************************************/ + +#include +#include +#include +#include + +/****************************************************************************** + Global variables section +******************************************************************************/ +void (*halWdtCallback)(void) = NULL; + +/******************************************************************************* +Registers WDT fired callback. +Parameters: + wdtCallback - callback. +Returns: + none. +*******************************************************************************/ +void HAL_RegisterWdtCallback(void (*wdtCallback)(void)) +{ + halWdtCallback = wdtCallback; +} + +/******************************************************************************* +Starts WDT with interval. +Parameters: + interval - interval. +Returns: + none. +*******************************************************************************/ +void HAL_StartWdt(HAL_WdtInterval_t interval) +{ + uint8_t i = 0; + + if (halWdtCallback) + i = (1<