mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 12:35:28 +00:00
Support ESP32S3 Beta 3 target
Update ROM API. Port changes from bringup branch.
This commit is contained in:
@@ -17,30 +17,22 @@
|
||||
|
||||
#include "esp_attr.h"
|
||||
#include "esp32s3/clk.h"
|
||||
#include "esp32s3/rom/ets_sys.h"
|
||||
#include "soc/rtc.h"
|
||||
|
||||
#define MHZ (1000000)
|
||||
|
||||
// g_ticks_us defined in ROMs for PRO and APP CPU
|
||||
extern uint32_t g_ticks_per_us_pro;
|
||||
|
||||
int IRAM_ATTR esp_clk_cpu_freq(void)
|
||||
{
|
||||
return g_ticks_per_us_pro * MHZ;
|
||||
return ets_get_cpu_frequency() * MHZ;
|
||||
}
|
||||
|
||||
int IRAM_ATTR esp_clk_apb_freq(void)
|
||||
{
|
||||
return MIN(g_ticks_per_us_pro, 80) * MHZ;
|
||||
return MIN(ets_get_cpu_frequency(), 80) * MHZ;
|
||||
}
|
||||
|
||||
int IRAM_ATTR esp_clk_xtal_freq(void)
|
||||
{
|
||||
return rtc_clk_xtal_freq_get() * MHZ;
|
||||
}
|
||||
|
||||
void IRAM_ATTR ets_update_cpu_frequency(uint32_t ticks_per_us)
|
||||
{
|
||||
/* Update scale factors used by esp_rom_delay_us */
|
||||
g_ticks_per_us_pro = ticks_per_us;
|
||||
}
|
||||
|
Reference in New Issue
Block a user