optimize init sequenze
show SplashScreen while connecting Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
10
firmware/components/analytics/CMakeLists.txt
Normal file
10
firmware/components/analytics/CMakeLists.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
idf_component_register(SRCS
|
||||
src/analytics.c
|
||||
INCLUDE_DIRS "include"
|
||||
REQUIRES
|
||||
rmaker_common
|
||||
esp_insights
|
||||
rmaker_common
|
||||
)
|
||||
|
||||
target_add_binary_data(${COMPONENT_TARGET} "insights_auth_key.txt" TEXT)
|
10
firmware/components/analytics/include/analytics.h
Normal file
10
firmware/components/analytics/include/analytics.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
void analytics_init(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
20
firmware/components/analytics/src/analytics.c
Normal file
20
firmware/components/analytics/src/analytics.c
Normal file
@@ -0,0 +1,20 @@
|
||||
#include "analytics.h"
|
||||
#include "esp_insights.h"
|
||||
#include "esp_rmaker_utils.h"
|
||||
|
||||
extern const char insights_auth_key_start[] asm("_binary_insights_auth_key_txt_start");
|
||||
extern const char insights_auth_key_end[] asm("_binary_insights_auth_key_txt_end");
|
||||
|
||||
void analytics_init(void)
|
||||
{
|
||||
esp_insights_config_t config = {
|
||||
.log_type = ESP_DIAG_LOG_TYPE_ERROR | ESP_DIAG_LOG_TYPE_EVENT | ESP_DIAG_LOG_TYPE_WARNING,
|
||||
.node_id = NULL,
|
||||
.auth_key = insights_auth_key_start,
|
||||
.alloc_ext_ram = false,
|
||||
};
|
||||
|
||||
esp_insights_init(&config);
|
||||
|
||||
esp_rmaker_time_sync_init(NULL);
|
||||
}
|
Reference in New Issue
Block a user