Files
squeezelite-esp32/components/squeezelite-ota/squeezelite-ota.h
Sebastien 39058213fa Merge remote-tracking branch 'origin/httpd' into master-cmake
Conflicts:
	.cproject
	.gitmodules
	.project
	.pydevproject
	.settings/language.settings.xml
	.settings/org.eclipse.cdt.core.prefs
	components/cmd_i2c/CMakeLists.txt
	components/cmd_i2c/cmd_i2ctools.c
	components/cmd_i2c/component.mk
	components/cmd_nvs/cmd_nvs.c
	components/cmd_nvs/component.mk
	components/cmd_system/cmd_system.c
	components/cmd_system/component.mk
	components/config/config.c
	components/config/config.h
	components/config/nvs_utilities.c
	components/display/CMakeLists.txt
	components/driver_bt/CMakeLists.txt
	components/driver_bt/component.mk
	components/raop/raop.c
	components/services/CMakeLists.txt
	components/squeezelite-ota/cmd_ota.c
	components/squeezelite-ota/squeezelite-ota.c
	components/squeezelite-ota/squeezelite-ota.h
	components/squeezelite/component.mk
	components/telnet/CMakeLists.txt
	components/wifi-manager/CMakeLists.txt
	components/wifi-manager/dns_server.c
	components/wifi-manager/http_server.c
	components/wifi-manager/http_server.h
	components/wifi-manager/wifi_manager.c
	components/wifi-manager/wifi_manager.h
	main/CMakeLists.txt
	main/console.c
	main/esp_app_main.c
	main/platform_esp32.h
2020-03-10 13:55:22 -04:00

35 lines
1.0 KiB
C

/*
* squeezelite-ota.h
*
* Created on: 25 sept. 2019
* Author: sle11
*/
#pragma once
#include "esp_attr.h"
#include "esp_image_format.h"
#include "esp_ota_ops.h"
//
// ERASE BLOCK needs to be a multiple of sector size. If a different multiple is passed
// the OTA process will adjust. Here, we need to strike the balance between speed and
// stability. The larger the blocks, the faster the erase will be, but the more likely
// the system will throw WDT while the flash chip is locked and the more likely
// the OTA process will derail
#define OTA_FLASH_ERASE_BLOCK (uint32_t)249856
// We're running the OTA without squeezelite in the background, so we can set a comfortable
// amount of stack to avoid overflows.
#define OTA_STACK_SIZE 10240
// To speed up processing, we set this priority to a number that is higher than normal
// tasks
#define OTA_TASK_PRIOTITY 6
esp_err_t start_ota(const char * bin_url);
const char * ota_get_status();
uint8_t ota_get_pct_complete();
esp_err_t start_ota(const char * bin_url, char * bin_buffer, uint32_t length);