summaryrefslogtreecommitdiff
path: root/digital/zigbit/bitcloud/stack/Components/HAL/avr/common/src/resetReason.c
diff options
context:
space:
mode:
authorFlorent Duchon2012-12-26 17:36:00 +0100
committerFlorent Duchon2013-02-13 21:21:12 +0100
commitb24866225a6301d3a663f874725e83c012dc25d3 (patch)
treeca527a2aab9abcdfbaf244c53ca63f0c531892b0 /digital/zigbit/bitcloud/stack/Components/HAL/avr/common/src/resetReason.c
parent2ba279f4eb2f23fa08a7c13465d16ae6ba5d0f96 (diff)
digital/beacon: add bitcloud stack into common directory digital/zigbit
Diffstat (limited to 'digital/zigbit/bitcloud/stack/Components/HAL/avr/common/src/resetReason.c')
-rw-r--r--digital/zigbit/bitcloud/stack/Components/HAL/avr/common/src/resetReason.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/digital/zigbit/bitcloud/stack/Components/HAL/avr/common/src/resetReason.c b/digital/zigbit/bitcloud/stack/Components/HAL/avr/common/src/resetReason.c
new file mode 100644
index 00000000..0fecaa11
--- /dev/null
+++ b/digital/zigbit/bitcloud/stack/Components/HAL/avr/common/src/resetReason.c
@@ -0,0 +1,59 @@
+/**************************************************************************//**
+ \file halWdtInit.c
+
+ \brief Implementation of the reset reason interface.
+
+ \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:
+ 5/12/07 A. Khromykh - Created
+ ******************************************************************************/
+/******************************************************************************
+ * WARNING: CHANGING THIS FILE MAY AFFECT CORE FUNCTIONALITY OF THE STACK. *
+ * EXPERT USERS SHOULD PROCEED WITH CAUTION. *
+ ******************************************************************************/
+
+/******************************************************************************
+ Includes section
+******************************************************************************/
+#include <resetReason.h>
+#include <types.h>
+#include <wdtCtrl.h>
+
+/******************************************************************************
+ External variables section
+******************************************************************************/
+extern uint8_t halResetReason; // contains the reset reason
+
+/******************************************************************************
+ Implementations section
+******************************************************************************/
+/******************************************************************************
+Returns the reset reason.
+Parameters:
+ none.
+Returns:
+ The reason of reset.
+******************************************************************************/
+HAL_ResetReason_t HAL_ReadResetReason(void)
+{
+ return (HAL_ResetReason_t)halResetReason;
+}
+
+/******************************************************************************
+Software reset.
+******************************************************************************/
+void HAL_WarmReset(void)
+{
+
+ halResetReason = TEMP_WARM_RESET;
+ wdt_enable(0);
+ while(1);
+}
+//eof resetReason.c