OTA Work in progress

This commit is contained in:
Sebastien
2019-09-19 11:41:20 -04:00
committed by Sebastien Leclerc
parent 3bd886b8df
commit 8aedca48a7
18 changed files with 439 additions and 252 deletions

View File

@@ -2,7 +2,7 @@ set(COMPONENT_ADD_INCLUDEDIRS . )
set(COMPONENT_SRCS "esp_app_main.c" "platform_esp32.c" "cmd_wifi.c" "console.c" "nvs_utilities.c" "cmd_squeezelite.c")
set(REQUIRES esp_common)
set(REQUIRES_COMPONENTS freertos squeezelite nvs_flash esp32 spi_flash newlib log console )
set(REQUIRES_COMPONENTS freertos squeezelite nvs_flash esp32 spi_flash newlib log console ota )
register_component()

View File

@@ -16,7 +16,7 @@ extern "C" {
#include "cmd_wifi.h"
#include "cmd_nvs.h"
#include "cmd_i2ctools.h"
#include "cmd_ota.h"
#ifdef __cplusplus
}
#endif

View File

@@ -33,6 +33,11 @@ static void * console_thread();
void console_start();
static const char * TAG = "console";
#if (RECOVERY_APPLICATION )
extern void start_ota(const char * bin_url);
#endif
/* Prompt to be printed before each line.
* This can be customized, made dynamic, etc.
*/
@@ -235,7 +240,13 @@ void console_start() {
esp_console_register_help_command();
register_system();
register_nvs();
#if !RECOVERY_APPLICATION
#pragma message "compiling for squeezelite""
register_squeezelite();
#else
#pragma message "compiling for recovery"
register_ota_cmd();
#endif
register_i2ctools();
printf("\n"
"Type 'help' to get the list of commands.\n"

View File

@@ -80,10 +80,7 @@ bool wait_for_wifi(){
ESP_LOGI(TAG,"WiFi Connected!");
}
}
return connected;
}
void app_main()

View File

@@ -28,3 +28,10 @@ extern bool wait_for_wifi();
extern void console_start();
extern pthread_cond_t wifi_connect_suspend_cond;
extern pthread_t wifi_connect_suspend_mutex;
#ifndef RECOVERY_APPLICATION
#define RECOVERY_APPLICATION 0
#else
#undef RECOVERY_APPLICATION
#define RECOVERY_APPLICATION 1
#endif