forked from gronod/squeezelite-esp32
applied platformio structure
This commit is contained in:
10
lib/platform_console/app_recovery/CMakeLists.txt
Normal file
10
lib/platform_console/app_recovery/CMakeLists.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
idf_component_register( SRC_DIRS .
|
||||
INCLUDE_DIRS .
|
||||
PRIV_REQUIRES bootloader_support
|
||||
)
|
||||
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--undefined=esp_app_desc")
|
||||
idf_build_get_property(project_ver PROJECT_VER)
|
||||
message("******************* ${project_ver}")
|
||||
string(SUBSTRING "${project_ver}" 0 31 PROJECT_VER_CUT)
|
||||
set_source_files_properties(recovery.c PROPERTIES COMPILE_DEFINITIONS "PROJECT_VER=\"${PROJECT_VER_CUT}\"")
|
||||
6
lib/platform_console/app_recovery/application_name.h
Normal file
6
lib/platform_console/app_recovery/application_name.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
#include "sdkconfig.h"
|
||||
#ifndef CONFIG_PROJECT_NAME
|
||||
#pragma message "Defaulting project name."
|
||||
#define CONFIG_PROJECT_NAME "Squeezelite-ESP32"
|
||||
#endif
|
||||
52
lib/platform_console/app_recovery/recovery.c
Normal file
52
lib/platform_console/app_recovery/recovery.c
Normal file
@@ -0,0 +1,52 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "application_name.h"
|
||||
#include "esp_err.h"
|
||||
#include "esp_app_format.h"
|
||||
|
||||
extern esp_err_t process_recovery_ota(const char * bin_url, char * bin_buffer, uint32_t length);
|
||||
|
||||
const __attribute__((section(".rodata_desc"))) esp_app_desc_t esp_app_desc = {
|
||||
.magic_word = ESP_APP_DESC_MAGIC_WORD,
|
||||
.version = PROJECT_VER,
|
||||
.project_name = CONFIG_PROJECT_NAME,
|
||||
.idf_ver = IDF_VER,
|
||||
|
||||
#ifdef CONFIG_BOOTLOADER_APP_SECURE_VERSION
|
||||
.secure_version = CONFIG_BOOTLOADER_APP_SECURE_VERSION,
|
||||
#else
|
||||
.secure_version = 0,
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_APP_COMPILE_TIME_DATE
|
||||
.time = __TIME__,
|
||||
.date = __DATE__,
|
||||
#else
|
||||
.time = "",
|
||||
.date = "",
|
||||
#endif
|
||||
};
|
||||
|
||||
void register_optional_cmd(void) {
|
||||
}
|
||||
|
||||
int main(int argc, char **argv){
|
||||
return 1;
|
||||
}
|
||||
|
||||
void register_squeezelite(){
|
||||
}
|
||||
|
||||
void register_external(void) {
|
||||
}
|
||||
|
||||
void deregister_external(void) {
|
||||
}
|
||||
|
||||
void decode_restore(int external) {
|
||||
}
|
||||
|
||||
esp_err_t start_ota(const char * bin_url, char * bin_buffer, uint32_t length)
|
||||
{
|
||||
return process_recovery_ota(bin_url,bin_buffer,length);
|
||||
}
|
||||
Reference in New Issue
Block a user