mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-12-16 02:43:47 +08:00
feat(esp8266): Refactor task watch dog
1. Remove old watch dog function 2. Put WIFI NVS index table from RAM to flash
This commit is contained in:
@@ -117,10 +117,31 @@
|
||||
|
||||
//Interrupt remap control registers define{{
|
||||
#define EDGE_INT_ENABLE_REG (PERIPHS_DPORT_BASEADDR + 0x04)
|
||||
#define WDT_EDGE_INT_ENABLE() SET_PERI_REG_MASK(EDGE_INT_ENABLE_REG, BIT0)
|
||||
#define TM1_EDGE_INT_ENABLE() SET_PERI_REG_MASK(EDGE_INT_ENABLE_REG, BIT1)
|
||||
#define TM1_EDGE_INT_DISABLE() CLEAR_PERI_REG_MASK(EDGE_INT_ENABLE_REG, BIT1)
|
||||
//}}
|
||||
|
||||
|
||||
//Watch dog reg {{
|
||||
#define PERIPHS_WDT_BASEADDR 0x60000900
|
||||
|
||||
#define WDT_CTL_ADDRESS 0
|
||||
#define WDT_OP_ADDRESS 0x4
|
||||
#define WDT_OP_ND_ADDRESS 0x8
|
||||
#define WDT_RST_ADDRESS 0x14
|
||||
|
||||
#define WDT_CTL_RSTLEN_MASK 0x38
|
||||
#define WDT_CTL_RSPMOD_MASK 0x6
|
||||
#define WDT_CTL_EN_MASK 0x1
|
||||
|
||||
#define WDT_CTL_RSTLEN_LSB 0x3
|
||||
#define WDT_CTL_RSPMOD_LSB 0x1
|
||||
#define WDT_CTL_EN_LSB 0
|
||||
|
||||
#define WDT_FEED_VALUE 0x73
|
||||
//}}
|
||||
|
||||
//RTC reg {{
|
||||
#define REG_RTC_BASE PERIPHS_RTC_BASEADDR
|
||||
|
||||
|
||||
37
components/esp8266/include/esp_task_wdt.h
Normal file
37
components/esp8266/include/esp_task_wdt.h
Normal file
@@ -0,0 +1,37 @@
|
||||
// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "esp_err.h"
|
||||
|
||||
/**
|
||||
* @brief Initialize the Task Watchdog Timer (TWDT)
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: Initialization was successful
|
||||
* - ESP_ERR_NO_MEM: Initialization failed due to lack of memory
|
||||
*
|
||||
* @note esp_task_wdt_init() must only be called after the scheduler
|
||||
* started
|
||||
*/
|
||||
esp_err_t esp_task_wdt_init(void);
|
||||
|
||||
/**
|
||||
* @brief Reset(Feed) the Task Watchdog Timer (TWDT) on behalf of the currently
|
||||
* running task
|
||||
*/
|
||||
void esp_task_wdt_reset(void);
|
||||
@@ -149,6 +149,8 @@ extern wifi_osi_funcs_t s_wifi_osi_funcs;
|
||||
#define wifi_rand() \
|
||||
s_wifi_osi_funcs.rand()
|
||||
|
||||
void *osi_task_top_sp(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user