update_task_i.h 706 B

123456789101112131415161718192021222324
  1. #pragma once
  2. #include <storage/storage.h>
  3. #define UPDATE_TASK_NOERR 0
  4. #define UPDATE_TASK_FAILED -1
  5. typedef struct UpdateTask {
  6. UpdateTaskState state;
  7. string_t update_path;
  8. UpdateManifest* manifest;
  9. FuriThread* thread;
  10. Storage* storage;
  11. File* file;
  12. updateProgressCb status_change_cb;
  13. void* status_change_cb_state;
  14. } UpdateTask;
  15. void update_task_set_progress(UpdateTask* update_task, UpdateTaskStage stage, uint8_t progress);
  16. bool update_task_parse_manifest(UpdateTask* update_task);
  17. bool update_task_open_file(UpdateTask* update_task, string_t filename);
  18. int32_t update_task_worker_flash_writer(void* context);
  19. int32_t update_task_worker_backup_restore(void* context);