mirror of
https://github.com/espressif/esp-idf.git
synced 2026-08-03 21:50:39 +03:00
change(esp_hal_rtc_timer): unify lp_timer/rtc_timer naming to RTC_TIMER
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2010-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2010-2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -9,9 +9,7 @@
|
||||
#include "esp_cpu.h"
|
||||
#include "soc/wdev_reg.h"
|
||||
|
||||
#if SOC_LP_TIMER_SUPPORTED
|
||||
#include "hal/lp_timer_hal.h"
|
||||
#endif
|
||||
#include "hal/rtc_timer_hal.h"
|
||||
|
||||
#ifndef BOOTLOADER_BUILD
|
||||
#include "esp_random.h"
|
||||
@@ -47,7 +45,7 @@
|
||||
assert(buffer != NULL);
|
||||
|
||||
for (size_t i = 0; i < length; i++) {
|
||||
#if SOC_LP_TIMER_SUPPORTED
|
||||
#if SOC_RTC_TIMER_V2_SUPPORTED
|
||||
random = REG_READ(WDEV_RND_REG);
|
||||
start = esp_cpu_get_cycle_count();
|
||||
do {
|
||||
@@ -57,7 +55,7 @@
|
||||
|
||||
// XOR the RT slow clock, which is asynchronous, to add some entropy and improve
|
||||
// the distribution
|
||||
uint32_t current_rtc_timer_counter = (lp_timer_hal_get_cycle_count() & 0xFF);
|
||||
uint32_t current_rtc_timer_counter = (rtc_timer_hal_get_cycle_count(0) & 0xFF);
|
||||
random = random ^ current_rtc_timer_counter;
|
||||
|
||||
buffer_bytes[i] = random & 0xFF;
|
||||
|
||||
Reference in New Issue
Block a user