fix(battery): Better safety checks
This commit is contained in:
parent
b89536af2b
commit
260519ec55
1 changed files with 5 additions and 2 deletions
|
@ -67,7 +67,10 @@ void BatteryModule::subthread_runner()
|
||||||
{
|
{
|
||||||
std::this_thread::yield();
|
std::this_thread::yield();
|
||||||
|
|
||||||
const auto dur = std::chrono::duration<double>(
|
std::chrono::duration<double> dur = 1s;
|
||||||
|
|
||||||
|
if (this->animation_charging)
|
||||||
|
dur = std::chrono::duration<double>(
|
||||||
float(this->animation_charging->get_framerate()) / 1000.0f);
|
float(this->animation_charging->get_framerate()) / 1000.0f);
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
Loading…
Reference in a new issue