fw.h 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include "common.h"
  3. #include "fwimg.h"
  4. #include <zlib.h>
  5. /*
  6. * Additional error codes
  7. */
  8. #define FWUPDATE_ERR_IN_PROGRESS (-10)
  9. #define FWUPDATE_ERR_BAD_CHUNK (-11)
  10. #define FWUPDATE_ERR_ERASE_FAILED (-12)
  11. #define FWUPDATE_ERR_PROGRAM_FAILED (-13)
  12. #define FWUPDATE_ERR_WRITE_PROTECT (-14)
  13. #define FWUPDATE_ERR_NOT_READY (-15)
  14. #define FWUPDATE_ERR_FPGA_JTAG (-16)
  15. #define FWUPDATE_ERR_FPGA_MISMATCH (-17)
  16. #define FWUPDATE_ERR_FPGA_FAILED (-18)
  17. #define FWUPDATE_ERR_UNKNOWN (-19)
  18. #define FWUPDATE_ERR_ESP_NO_PARTITION (-20)
  19. #define FWUPDATE_ERR_ESP_BAD_OTA (-21)
  20. #define FWUPDATE_ERR_ESP_FLASH_FAILED (-22)
  21. #define FWUPDATE_ERR_ESP_BAD_DATA (-23)
  22. #define FWUPDATE_ERR_CONFIG_READ (-24)
  23. #define FWUPDATE_ERR_CONFIG_SAVE (-25)
  24. extern_c int firmware_update_start(read_func_t read_data, token_t token, bool autoreboot);
  25. extern_c int firmware_update_wait(TickType_t delay);
  26. extern_c int esp_update(read_func_t read_func, token_t token, size_t size);
  27. extern_c const char *firmware_errstr(int err);