Contiki 3.x
watchdog.c
Go to the documentation of this file.
1 /**
2  * \addtogroup mbxxx-platform
3  *
4  * @{
5  */
6 
7 /*
8  * Copyright (c) 2010, STMicroelectronics.
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  * notice, this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above
17  * copyright notice, this list of conditions and the following
18  * disclaimer in the documentation and/or other materials provided
19  * with the distribution.
20  * 3. The name of the author may not be used to endorse or promote
21  * products derived from this software without specific prior
22  * written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
25  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
28  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
30  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35  *
36  */
37 
38 /**
39 * \file
40 * Watchdog
41 * \author
42 * Salvatore Pitrulli <salvopitru@users.sourceforge.net>
43 */
44 
45 #include <stdio.h>
46 #include "dev/watchdog.h"
47 #include PLATFORM_HEADER
48 #include "hal/error.h"
49 #include "hal/hal.h"
50 
51 /*---------------------------------------------------------------------------*/
52 void
54 {
55 
56 }
57 /*---------------------------------------------------------------------------*/
58 void
60 {
61  /*
62  * We setup the watchdog to reset the device after 2.048 seconds,
63  * unless watchdog_periodic() is called.
64  */
66 }
67 /*---------------------------------------------------------------------------*/
68 void
70 {
71  /* This function is called periodically to restart the watchdog timer. */
72  halResetWatchdog();
73 }
74 /*---------------------------------------------------------------------------*/
75 void
77 {
79 }
80 /*---------------------------------------------------------------------------*/
81 void
83 {
84  halReboot();
85 }
86 /*---------------------------------------------------------------------------*/
87 /** @} */
void watchdog_start(void)
Starts the WDT in watchdog mode if enabled by user configuration, maximum interval.
Definition: watchdog.c:49
void halInternalEnableWatchDog(void)
Enables the watchdog timer.
Definition: micro-common.c:17
void halInternalDisableWatchDog(uint8_t magicKey)
Disables the watchdog timer.
Definition: micro-common.c:31
void watchdog_reboot(void)
Keeps control until the WDT throws a reset signal.
Definition: watchdog.c:128
void halReboot(void)
Restarts the microcontroller and therefore everything else.
Definition: micro.c:43
void watchdog_stop(void)
In watchdog mode, the WDT can not be stopped.
Definition: watchdog.c:58
void watchdog_periodic(void)
Writes the WDT clear sequence.
Definition: watchdog.c:64
Generic set of HAL includes for all platforms.
Return codes for API functions and module definitions.
#define MICRO_DISABLE_WATCH_DOG_KEY
The value that must be passed as the single parameter to halInternalDisableWatchDog() in order to suc...
Definition: micro-common.h:52
void watchdog_init(void)
Copyright (c) 2014, Analog Devices, Inc.
Definition: watchdog.c:42