2021-04-03 22:08:51 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
#include <FreeRTOS.h>
|
|
|
|
#include <timers.h>
|
|
|
|
#include "Screen.h"
|
|
|
|
#include <lvgl/lvgl.h>
|
|
|
|
|
|
|
|
namespace Pinetime {
|
|
|
|
namespace Controllers {
|
|
|
|
class Battery;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Applications {
|
|
|
|
namespace Screens {
|
|
|
|
|
2021-04-18 13:28:14 -04:00
|
|
|
class BatteryInfo : public Screen {
|
|
|
|
public:
|
|
|
|
BatteryInfo(DisplayApp* app, Pinetime::Controllers::Battery& batteryController);
|
|
|
|
~BatteryInfo() override;
|
2021-04-03 22:08:51 -04:00
|
|
|
|
2021-04-18 13:28:14 -04:00
|
|
|
bool Refresh() override;
|
2021-04-03 22:08:51 -04:00
|
|
|
|
2021-04-18 13:28:14 -04:00
|
|
|
void UpdateScreen();
|
|
|
|
void UpdateAnim();
|
2021-04-03 22:08:51 -04:00
|
|
|
|
2021-04-18 13:28:14 -04:00
|
|
|
private:
|
|
|
|
Pinetime::Controllers::Battery& batteryController;
|
2021-04-03 22:08:51 -04:00
|
|
|
|
2021-04-18 13:28:14 -04:00
|
|
|
lv_obj_t* voltage;
|
|
|
|
lv_obj_t* percent;
|
|
|
|
lv_obj_t* charging_bar;
|
|
|
|
lv_obj_t* status;
|
2021-04-03 22:08:51 -04:00
|
|
|
|
2021-04-18 13:28:14 -04:00
|
|
|
lv_task_t* taskUpdate;
|
|
|
|
lv_task_t* taskAnim;
|
2021-04-03 22:08:51 -04:00
|
|
|
|
2021-04-18 13:28:14 -04:00
|
|
|
int8_t animation = 0;
|
|
|
|
int8_t batteryPercent = -1;
|
|
|
|
float batteryVoltage = 0.0f;
|
2021-04-03 22:08:51 -04:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|