Watchdog.h 712 Bytes
Newer Older
Martin Horauer's avatar
Martin Horauer committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/** Watchdog class for the XMC MCU family.
 *
 * Example:
 */

#ifndef WATCHDOG_H
#define WATCHDOG_H
#include "mbed.h"

class Watchdog {
public:
    /** Create HelloWorld instance
     */
    Watchdog();

    /** Delete HelloWorld instance
     */
    ~Watchdog();

    /** Print the text
     *
     * @param timeout in seconds
     */
    void configure(float timeout);

    /** Watchdog service
     */
    void service();

    /** Check if watchdog was cause of reset
     *
     * @returns
     *  true    watchdog was cause of reset
     *  fasle   watchdog was not cause of reset
     */
    bool watchdogCausedReset();

private:

    double wdt_time;
    bool wdreset;
};


#endif // WATCHDOG_H

/*EOF*/