mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-09 04:57:06 +03:00
Trim app and recovery binaries
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
idf_component_register( SRCS operator.cpp tools.c trace.c
|
||||
REQUIRES esp_common pthread
|
||||
PRIV_REQUIRES esp_http_client esp-tls
|
||||
PRIV_REQUIRES esp_http_client esp-tls json
|
||||
INCLUDE_DIRS .
|
||||
)
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#error CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS must be at least 2
|
||||
#endif
|
||||
|
||||
#include "cJSON.h"
|
||||
const static char TAG[] = "tools";
|
||||
|
||||
/****************************************************************************************
|
||||
@@ -318,11 +319,30 @@ static esp_err_t http_event_handler(esp_http_client_event_t *evt) {
|
||||
return ESP_FAIL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
|
||||
time_t millis() {
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
return (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
|
||||
}
|
||||
|
||||
void dump_json_content(const char* prefix, cJSON* json, int level) {
|
||||
if (!json) {
|
||||
ESP_LOG_LEVEL(level,TAG, "%s: empty!", prefix);
|
||||
return;
|
||||
}
|
||||
char* output = cJSON_Print(json);
|
||||
if (output) {
|
||||
ESP_LOG_LEVEL(level,TAG, "%s: \n%s", prefix, output);
|
||||
}
|
||||
FREE_AND_NULL(output);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "cJSON.h"
|
||||
#include "time.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -70,6 +74,9 @@ void vTaskDeleteEXTRAM(TaskHandle_t xTask);
|
||||
|
||||
extern const char unknown_string_placeholder[];
|
||||
|
||||
time_t millis();
|
||||
void dump_json_content(const char* prefix, cJSON* json, int level);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user