2024-01-17 01:16:06 -05:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2016-2024 Espressif Systems (Shanghai) CO LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2017-09-22 11:26:09 -04:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "sdkconfig.h"
|
|
|
|
|
2020-07-21 05:15:19 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2017-09-22 11:26:09 -04:00
|
|
|
typedef enum {
|
|
|
|
ESP_PM_TRACE_IDLE,
|
|
|
|
ESP_PM_TRACE_TICK,
|
|
|
|
ESP_PM_TRACE_FREQ_SWITCH,
|
|
|
|
ESP_PM_TRACE_CCOMPARE_UPDATE,
|
|
|
|
ESP_PM_TRACE_ISR_HOOK,
|
2018-04-12 06:18:45 -04:00
|
|
|
ESP_PM_TRACE_SLEEP,
|
2017-09-22 11:26:09 -04:00
|
|
|
ESP_PM_TRACE_TYPE_MAX
|
|
|
|
} esp_pm_trace_event_t;
|
|
|
|
|
2019-07-16 05:33:30 -04:00
|
|
|
void esp_pm_trace_init(void);
|
2017-09-22 11:26:09 -04:00
|
|
|
void esp_pm_trace_enter(esp_pm_trace_event_t event, int core_id);
|
|
|
|
void esp_pm_trace_exit(esp_pm_trace_event_t event, int core_id);
|
|
|
|
|
|
|
|
#ifdef CONFIG_PM_TRACE
|
|
|
|
|
|
|
|
#define ESP_PM_TRACE_ENTER(event, core_id) \
|
|
|
|
esp_pm_trace_enter(ESP_PM_TRACE_ ## event, core_id)
|
|
|
|
#define ESP_PM_TRACE_EXIT(event, core_id) \
|
|
|
|
esp_pm_trace_exit(ESP_PM_TRACE_ ## event, core_id)
|
|
|
|
|
|
|
|
#else // CONFIG_PM_TRACE
|
|
|
|
|
2019-02-28 08:58:47 -05:00
|
|
|
#define ESP_PM_TRACE_ENTER(type, core_id) do { (void) core_id; } while(0)
|
|
|
|
#define ESP_PM_TRACE_EXIT(type, core_id) do { (void) core_id; } while(0)
|
2017-09-22 11:26:09 -04:00
|
|
|
|
|
|
|
#endif // CONFIG_PM_TRACE
|
2020-07-21 05:15:19 -04:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
2020-11-10 02:40:01 -05:00
|
|
|
#endif
|