forked from espressif/esp-idf
feat(esp_timer): added esp_timer p4 base support
This commit is contained in:
committed by
Armando (Dou Yiwen)
parent
5f68437c2f
commit
211c3c0e05
@@ -37,6 +37,8 @@
|
|||||||
#include "esp32c6/rtc.h"
|
#include "esp32c6/rtc.h"
|
||||||
#elif CONFIG_IDF_TARGET_ESP32H2
|
#elif CONFIG_IDF_TARGET_ESP32H2
|
||||||
#include "esp32h2/rtc.h"
|
#include "esp32h2/rtc.h"
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32P4
|
||||||
|
#include "esp32p4/rtc.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
|
@@ -192,9 +192,16 @@ esp_err_t esp_timer_impl_init(intr_handler_t alarm_handler)
|
|||||||
#endif
|
#endif
|
||||||
| ESP_INTR_FLAG_IRAM;
|
| ESP_INTR_FLAG_IRAM;
|
||||||
|
|
||||||
|
#if !CONFIG_IDF_TARGET_ESP32P4
|
||||||
|
//TODO: IDF-7486
|
||||||
esp_err_t err = esp_intr_alloc(ETS_SYSTIMER_TARGET2_EDGE_INTR_SOURCE, isr_flags,
|
esp_err_t err = esp_intr_alloc(ETS_SYSTIMER_TARGET2_EDGE_INTR_SOURCE, isr_flags,
|
||||||
&timer_alarm_isr, NULL,
|
&timer_alarm_isr, NULL,
|
||||||
&s_timer_interrupt_handle[(ISR_HANDLERS == 1) ? 0 : xPortGetCoreID()]);
|
&s_timer_interrupt_handle[(ISR_HANDLERS == 1) ? 0 : xPortGetCoreID()]);
|
||||||
|
#else
|
||||||
|
esp_err_t err = esp_intr_alloc(ETS_SYSTIMER_TARGET2_INTR_SOURCE, isr_flags,
|
||||||
|
&timer_alarm_isr, NULL,
|
||||||
|
&s_timer_interrupt_handle[(ISR_HANDLERS == 1) ? 0 : xPortGetCoreID()]);
|
||||||
|
#endif
|
||||||
if (err != ESP_OK) {
|
if (err != ESP_OK) {
|
||||||
ESP_EARLY_LOGE(TAG, "esp_intr_alloc failed (0x%x)", err);
|
ESP_EARLY_LOGE(TAG, "esp_intr_alloc failed (0x%x)", err);
|
||||||
return err;
|
return err;
|
||||||
|
@@ -36,6 +36,8 @@
|
|||||||
#include "esp32c6/rom/ets_sys.h"
|
#include "esp32c6/rom/ets_sys.h"
|
||||||
#elif CONFIG_IDF_TARGET_ESP32H2
|
#elif CONFIG_IDF_TARGET_ESP32H2
|
||||||
#include "esp32h2/rom/ets_sys.h"
|
#include "esp32h2/rom/ets_sys.h"
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32P4
|
||||||
|
#include "esp32p4/rom/ets_sys.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* We abuse 'timer_arg' field of ETSTimer structure to hold a pointer to esp_timer */
|
/* We abuse 'timer_arg' field of ETSTimer structure to hold a pointer to esp_timer */
|
||||||
|
@@ -31,6 +31,8 @@
|
|||||||
#include "esp32c6/rtc.h"
|
#include "esp32c6/rtc.h"
|
||||||
#elif CONFIG_IDF_TARGET_ESP32H2
|
#elif CONFIG_IDF_TARGET_ESP32H2
|
||||||
#include "esp32h2/rtc.h"
|
#include "esp32h2/rtc.h"
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32P4
|
||||||
|
#include "esp32p4/rtc.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__attribute__((unused)) static const char* TAG = "system_time";
|
__attribute__((unused)) static const char* TAG = "system_time";
|
||||||
|
Reference in New Issue
Block a user