squeezelite-ota.h 1.1 KB

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