squeezelite-ota.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * squeezelite-ota.h
  3. *
  4. * Created on: 25 sept. 2019
  5. * Author: sle11
  6. */
  7. #pragma once
  8. #include "esp_attr.h"
  9. #include "esp_image_format.h"
  10. #include "esp_ota_ops.h"
  11. //
  12. // ERASE BLOCK needs to be a multiple of sector size. If a different multiple is passed
  13. // the OTA process will adjust. Here, we need to strike the balance between speed and
  14. // stability. The larger the blocks, the faster the erase will be, but the more likely
  15. // the system will throw WDT while the flash chip is locked and the more likely
  16. // the OTA process will derail
  17. #define OTA_FLASH_ERASE_BLOCK (uint32_t)249856
  18. // We're running the OTA without squeezelite in the background, so we can set a comfortable
  19. // amount of stack to avoid overflows.
  20. #define OTA_STACK_SIZE 10240
  21. // To speed up processing, we set this priority to a number that is higher than normal
  22. // tasks
  23. #define OTA_TASK_PRIOTITY 6
  24. const char * ota_get_status();
  25. uint8_t ota_get_pct_complete();
  26. esp_err_t start_ota(const char * bin_url, char * bin_buffer, uint32_t length);
  27. in_addr_t discover_ota_server(int max);