Files
Upsilon/ion/src/device/bootloader/drivers/led.cpp
2022-03-17 20:05:20 +01:00

24 lines
525 B
C++

#include <ion/led.h>
#include <ion/battery.h>
#include <ion/usb.h>
#include <ion/exam_mode.h>
namespace Ion {
namespace LED {
KDColor updateColorWithPlugAndCharge() {
KDColor ledColor = getColor();
if (ExamMode::FetchExamMode() == 0) { // If exam mode is on, we do not update the LED with the plugged/charging state
if (USB::isPlugged()) {
ledColor = Battery::isCharging() ? KDColorOrange : KDColorGreen;
} else {
ledColor = KDColorBlack;
}
setColor(ledColor);
}
return ledColor;
}
}
}