aboutsummaryrefslogtreecommitdiffstats
path: root/source/monitor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/monitor.cpp')
-rw-r--r--source/monitor.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/source/monitor.cpp b/source/monitor.cpp
index 08a62d5..6ef97e9 100644
--- a/source/monitor.cpp
+++ b/source/monitor.cpp
@@ -39,30 +39,31 @@ void Monitor::threadMonitor(void *)
#endif
};
- palClearLine(LINE_LED_RED);
- palClearLine(LINE_LED_YELLOW);
+ palSetLine(LINE_LED_RED);
+ palSetLine(LINE_LED_GREEN);
+ palSetLine(LINE_LED_BLUE);
while (1) {
bool isidle = run_status == RunStatus::Idle;
- auto led = isidle ? LINE_LED_GREEN : LINE_LED_YELLOW;
+ auto led = isidle ? LINE_LED_GREEN : LINE_LED_BLUE;
auto delay = isidle ? 500 : 250;
- palSetLine(led);
+ palToggleLine(led);
chThdSleepMilliseconds(delay);
- palClearLine(led);
+ palToggleLine(led);
chThdSleepMilliseconds(delay);
- if (run_status == RunStatus::Idle && readButton()) {
- palSetLine(LINE_LED_RED);
- palSetLine(LINE_LED_YELLOW);
+ if (isidle && readButton()) {
+ palClearLine(LINE_LED_GREEN);
+ palClearLine(LINE_LED_BLUE);
chSysLock();
while (readButton())
asm("nop");
while (!readButton())
asm("nop");
chSysUnlock();
- palClearLine(LINE_LED_RED);
- palClearLine(LINE_LED_YELLOW);
+ palSetLine(LINE_LED_GREEN);
+ palSetLine(LINE_LED_BLUE);
chThdSleepMilliseconds(500);
}
@@ -70,9 +71,9 @@ void Monitor::threadMonitor(void *)
if (auto err = EM.hasError(); err ^ erroron) {
erroron = err;
if (err)
- palSetLine(LINE_LED_RED);
- else
palClearLine(LINE_LED_RED);
+ else
+ palSetLine(LINE_LED_RED);
}
}
}