From 7db7269a92f409f321e0ff76e8fa8ca8357da551 Mon Sep 17 00:00:00 2001 From: jiangguangming Date: Fri, 2 Dec 2022 14:41:07 +0800 Subject: [PATCH] esp_rom: patch systimer_hal_init/deinit for esp32h2 rom --- components/esp_rom/esp32h2/ld/esp32h2.rom.ld | 6 ++++-- components/esp_rom/patches/esp_rom_systimer.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/components/esp_rom/esp32h2/ld/esp32h2.rom.ld b/components/esp_rom/esp32h2/ld/esp32h2.rom.ld index 3f7a7a2930..74a19aad2f 100644 --- a/components/esp_rom/esp32h2/ld/esp32h2.rom.ld +++ b/components/esp_rom/esp32h2/ld/esp32h2.rom.ld @@ -183,8 +183,10 @@ wdt_hal_is_enabled = 0x400003b4; ***************************************/ /* Functions */ -systimer_hal_init = 0x400003b8; -systimer_hal_deinit = 0x400003bc; +/* The following ROM functions are commented out because they're patched in the esp_rom_systimer.c */ +/* systimer_hal_init = 0x400003b8; */ +/* systimer_hal_deinit = 0x400003bc; */ + systimer_hal_set_tick_rate_ops = 0x400003c0; systimer_hal_get_counter_value = 0x400003c4; systimer_hal_get_time = 0x400003c8; diff --git a/components/esp_rom/patches/esp_rom_systimer.c b/components/esp_rom/patches/esp_rom_systimer.c index bf930139a1..1b71b6f7f7 100644 --- a/components/esp_rom/patches/esp_rom_systimer.c +++ b/components/esp_rom/patches/esp_rom_systimer.c @@ -64,7 +64,7 @@ void systimer_hal_counter_value_advance(systimer_hal_context_t *hal, uint32_t co } #endif // CONFIG_IDF_TARGET_ESP32C2 -#if CONFIG_IDF_TARGET_ESP32C6 +#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 void systimer_hal_init(systimer_hal_context_t *hal) { hal->dev = &SYSTIMER;