mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
reset_reasons: EFUSE_RST is treated as POWERON_RST
ESP32 does not have the EFUSE_RST, the rest chips has this reset reason.
This commit is contained in:
@@ -68,7 +68,11 @@ static const char *TAG = "clk";
|
||||
rtc_config_t cfg = RTC_CONFIG_DEFAULT();
|
||||
soc_reset_reason_t rst_reas;
|
||||
rst_reas = esp_rom_get_reset_reason(0);
|
||||
if (rst_reas == RESET_REASON_CHIP_POWER_ON) {
|
||||
if (rst_reas == RESET_REASON_CHIP_POWER_ON
|
||||
#if SOC_EFUSE_HAS_EFUSE_RST_BUG
|
||||
|| rst_reas == RESET_REASON_CORE_EFUSE_CRC
|
||||
#endif
|
||||
) {
|
||||
cfg.cali_ocode = 1;
|
||||
}
|
||||
rtc_init(cfg);
|
||||
|
||||
@@ -1,16 +1,8 @@
|
||||
// Copyright 2018 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.
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "esp_system.h"
|
||||
#include "esp_rom_sys.h"
|
||||
@@ -26,6 +18,9 @@ static esp_reset_reason_t get_reset_reason(soc_reset_reason_t rtc_reset_reason,
|
||||
{
|
||||
switch (rtc_reset_reason) {
|
||||
case RESET_REASON_CHIP_POWER_ON:
|
||||
#if SOC_EFUSE_HAS_EFUSE_RST_BUG
|
||||
case RESET_REASON_CORE_EFUSE_CRC:
|
||||
#endif
|
||||
return ESP_RST_POWERON;
|
||||
|
||||
case RESET_REASON_CPU0_SW:
|
||||
|
||||
Reference in New Issue
Block a user