app_trace: perform initialization using ESP_SYSTEM_INIT_FN

This commit is contained in:
Ivan Grokhotkov
2022-05-18 01:16:12 +02:00
parent 0e53b32d2e
commit a334cd50ce
4 changed files with 24 additions and 13 deletions

View File

@@ -8,6 +8,7 @@
#include "esp_log.h"
#include "esp_app_trace.h"
#include "esp_app_trace_port.h"
#include "esp_private/startup_internal.h"
#ifdef CONFIG_APPTRACE_DEST_UART0
#define ESP_APPTRACE_DEST_UART_NUM 0
@@ -75,6 +76,11 @@ esp_err_t esp_apptrace_init(void)
return ESP_OK;
}
ESP_SYSTEM_INIT_FN(esp_apptrace_init, ESP_SYSTEM_INIT_ALL_CORES, 115)
{
return esp_apptrace_init();
}
void esp_apptrace_down_buffer_config(uint8_t *buf, uint32_t size)
{
esp_apptrace_channel_t *ch;

View File

@@ -12,6 +12,7 @@
#include "esp_app_trace.h"
#include "esp_log.h"
#include "esp_private/startup_internal.h"
const static char *TAG = "segger_rtt";
@@ -288,4 +289,17 @@ int SEGGER_RTT_ConfigDownBuffer(unsigned BufferIndex, const char* sName, void* p
return 0;
}
/*************************** Init hook ****************************
*
* This init function is placed here because this port file will be
* linked whenever SystemView is used.
*/
ESP_SYSTEM_INIT_FN(sysview_init, BIT(0), 120)
{
SEGGER_SYSVIEW_Conf();
return ESP_OK;
}
/*************************** End of file ****************************/