MeterLogger
|
#include <esp8266.h>
#include "driver/gpio16.h"
#include "watchdog.h"
#include "unix_time.h"
#include "wifi.h"
#include "config.h"
#include "led.h"
#include "debug.h"
Go to the source code of this file.
Data Structures | |
struct | watchdog_t |
Functions | |
ICACHE_FLASH_ATTR static void | ext_watchdog_timer_func (void *arg) |
ICACHE_FLASH_ATTR static void | wifi_reconnect_timer_func (void *arg) |
ICACHE_FLASH_ATTR static void | watchdog_timer_func (void *arg) |
ICACHE_FLASH_ATTR void | init_watchdog () |
ICACHE_FLASH_ATTR void | start_watchdog () |
ICACHE_FLASH_ATTR void | stop_watchdog () |
ICACHE_FLASH_ATTR bool | add_watchdog (uint32_t id, watchdog_type_t type, uint32_t timeout) |
ICACHE_FLASH_ATTR bool | remove_watchdog (uint32_t id) |
ICACHE_FLASH_ATTR void | reset_watchdog (uint32_t id) |
Variables | |
static os_timer_t | watchdog_timer |
static os_timer_t | ext_watchdog_timer |
static os_timer_t | wifi_reconnect_timer |
watchdog_t | watchdog_list [WATCHDOG_MAX] |
volatile uint8_t | watchdog_list_len |
ICACHE_FLASH_ATTR bool add_watchdog | ( | uint32_t | id, |
watchdog_type_t | type, | ||
uint32_t | timeout | ||
) |
Definition at line 155 of file watchdog.c.
References get_uptime(), watchdog_t::id, watchdog_t::last_reset, os_printf, watchdog_t::timeout, watchdog_t::type, watchdog_list_len, and WATCHDOG_MAX.
|
static |
Definition at line 25 of file watchdog.c.
References gpio16_input_get(), and gpio16_output_set().
Referenced by start_watchdog().
ICACHE_FLASH_ATTR void init_watchdog | ( | ) |
ICACHE_FLASH_ATTR bool remove_watchdog | ( | uint32_t | id | ) |
Definition at line 175 of file watchdog.c.
References watchdog_t::id, NOT_ENABLED, os_printf, watchdog_t::timeout, watchdog_t::type, and watchdog_list_len.
ICACHE_FLASH_ATTR void reset_watchdog | ( | uint32_t | id | ) |
Definition at line 194 of file watchdog.c.
References get_uptime(), watchdog_t::last_reset, os_printf, and WATCHDOG_MAX.
ICACHE_FLASH_ATTR void start_watchdog | ( | ) |
Definition at line 130 of file watchdog.c.
References ext_watchdog_timer, ext_watchdog_timer_func(), gpio16_output_conf(), gpio16_output_set(), NULL, os_printf, os_timer_arm, os_timer_disarm, os_timer_func_t, os_timer_setfn, watchdog_timer, and watchdog_timer_func().
ICACHE_FLASH_ATTR void stop_watchdog | ( | ) |
Definition at line 148 of file watchdog.c.
References ext_watchdog_timer, os_printf, and os_timer_disarm.
|
static |
Definition at line 72 of file watchdog.c.
References ext_watchdog_timer, get_uptime(), watchdog_t::last_reset, led_pattern_b(), NETWORK_RESTART, NETWORK_RESTART_DELAY, NOT_ENABLED, NULL, NULL_MODE, os_printf, os_timer_arm, os_timer_disarm, os_timer_func_t, os_timer_setfn, REBOOT, REBOOT_VIA_EXT_WD, set_my_auto_connect(), system_restart(), WATCHDOG_MAX, wifi_reconnect_timer, wifi_reconnect_timer_func(), wifi_set_opmode_current(), wifi_station_disconnect(), and wifi_stop_scan().
Referenced by start_watchdog().
|
static |
Definition at line 34 of file watchdog.c.
References syscfg_t::ap_enabled, led_stop_pattern(), NULL, os_printf, os_timer_arm, os_timer_disarm, os_timer_func_t, os_timer_setfn, set_my_auto_connect(), STATION_MODE, STATIONAP_MODE, sys_cfg, wifi_get_opmode(), wifi_reconnect_timer, wifi_scan_is_running(), wifi_set_opmode_current(), wifi_start_scan(), and wifi_station_connect().
Referenced by watchdog_timer_func().
|
static |
Definition at line 12 of file watchdog.c.
Referenced by start_watchdog(), stop_watchdog(), and watchdog_timer_func().
watchdog_t watchdog_list[WATCHDOG_MAX] |
Definition at line 22 of file watchdog.c.
volatile uint8_t watchdog_list_len |
Definition at line 23 of file watchdog.c.
Referenced by add_watchdog(), init_watchdog(), and remove_watchdog().
|
static |
Definition at line 11 of file watchdog.c.
Referenced by start_watchdog().
|
static |
Definition at line 13 of file watchdog.c.
Referenced by watchdog_timer_func(), and wifi_reconnect_timer_func().