0a0f28fff4
* Make firmware updating more foolproof and fix bugs * No need to manually handle overflow * Make startTime TickType_t * Don't process TouchEvents::None * Fix sleep getting re-enabled issue more directly
44 lines
913 B
C++
44 lines
913 B
C++
#pragma once
|
|
|
|
#include "Screen.h"
|
|
#include <lvgl/src/lv_core/lv_obj.h>
|
|
#include "FreeRTOS.h"
|
|
|
|
namespace Pinetime {
|
|
namespace Controllers {
|
|
class Ble;
|
|
}
|
|
namespace Applications {
|
|
namespace Screens {
|
|
|
|
class FirmwareUpdate : public Screen {
|
|
public:
|
|
FirmwareUpdate(DisplayApp* app, Pinetime::Controllers::Ble& bleController);
|
|
~FirmwareUpdate() override;
|
|
|
|
bool Refresh() override;
|
|
|
|
private:
|
|
enum class States { Idle, Running, Validated, Error };
|
|
Pinetime::Controllers::Ble& bleController;
|
|
lv_obj_t* bar1;
|
|
lv_obj_t* percentLabel;
|
|
lv_obj_t* titleLabel;
|
|
mutable char percentStr[10];
|
|
|
|
States state = States::Idle;
|
|
|
|
void DisplayProgression() const;
|
|
|
|
bool OnButtonPushed() override;
|
|
|
|
void UpdateValidated();
|
|
|
|
void UpdateError();
|
|
|
|
TickType_t startTime;
|
|
};
|
|
}
|
|
}
|
|
}
|