squeezelite-ota.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. #include "sys/param.h"
  12. #if RECOVERY_APPLICATION
  13. #define CODE_RAM_LOCATION
  14. #define RECOVERY_IRAM_FUNCTION IRAM_ATTR
  15. #else
  16. #define RECOVERY_IRAM_FUNCTION
  17. #define CODE_RAM_LOCATION
  18. #endif
  19. // ERASE BLOCK needs to be a multiple of sector size. If a different multiple is passed
  20. // the OTA process will adjust. Here, we need to strike the balance between speed and
  21. // stability. The larger the blocks, the faster the erase will be, but the more likely
  22. // the system will throw WDT while the flash chip is locked and the more likely
  23. // the OTA process will derail
  24. #define OTA_FLASH_ERASE_BLOCK (uint32_t)249856
  25. // We're running the OTA without squeezelite in the background, so we can set a comfortable
  26. // amount of stack to avoid overflows.
  27. #define OTA_STACK_SIZE 10240
  28. // To speed up processing, we set this priority to a number that is higher than normal
  29. // tasks
  30. #define OTA_TASK_PRIOTITY 6
  31. esp_err_t start_ota(const char * bin_url, char * bin_buffer, uint32_t length);