mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[apps] Gather all code regarding exam mode in ExamModeCOnfiguration file
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "apps_container.h"
|
||||
#include "apps_container_storage.h"
|
||||
#include "global_preferences.h"
|
||||
#include "exam_mode_configuration.h"
|
||||
#include <ion.h>
|
||||
#include <poincare/init.h>
|
||||
#include <poincare/exception_checkpoint.h>
|
||||
@@ -325,16 +326,9 @@ void AppsContainer::redrawWindow() {
|
||||
}
|
||||
|
||||
void AppsContainer::activateExamMode(GlobalPreferences::ExamMode examMode) {
|
||||
assert(examMode == GlobalPreferences::ExamMode::Standard || examMode == GlobalPreferences::ExamMode::Dutch);
|
||||
assert(examMode != GlobalPreferences::ExamMode::Off && examMode != GlobalPreferences::ExamMode::Unknown);
|
||||
reset();
|
||||
/* The Dutch exam mode LED is supposed to be orange but we can only make
|
||||
* blink "pure" colors: with RGB leds on or off (as the PWM is used for
|
||||
* blinking). The closest "pure" color is Yellow. Moreover, Orange LED is
|
||||
* already used when the battery is charging. Using yellow, we can assert
|
||||
* that the yellow LED only means that Dutch exam mode is on and avoid
|
||||
* confusing states when the battery is charging and states when the Dutch
|
||||
* exam mode is on. */
|
||||
Ion::LED::setColor(examMode == GlobalPreferences::ExamMode::Dutch ? KDColorYellow : KDColorRed);
|
||||
Ion::LED::setColor(ExamModeConfiguration::examModeColor(examMode));
|
||||
Ion::LED::setBlinking(1000, 0.1f);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user