17[[nodiscard]]
static std::string_view getLedName(
LedStatus::Led led)
19 static constexpr std::array<std::string_view, LedStatus::NUM_LEDS> names = {
20 "power",
"caps",
"kana",
"pause",
"turbo",
"FDD"
30 , msxCliComm(msxCliComm_)
31 , interp(commandController.getInterpreter())
32 , ledStatus(generate_array<NUM_LEDS>([&](auto i) {
36 "Current status for LED",
46 if (ledValue[led] == status)
return;
47 ledValue[led] = status;
54 auto diff = now - lastTime;
67void LedStatus::handleEvent(Led led)
noexcept
69 std::string_view str = ledValue[led] ?
"on":
"off";
70 ledStatus[led].setReadOnlyValue(
TclObject(str));
74void LedStatus::executeRT()
77 if (ledValue[i] != ledStatus[i].getValue().getBoolean(interp)) {
78 handleEvent(
static_cast<Led>(i));
LedStatus(RTScheduler &rtScheduler, CommandController &commandController, MSXCliComm &msxCliComm)
void setLed(Led led, bool status)
void scheduleRT(uint64_t delta)
uint64_t getTime()
Get current (real) time in us.
This file implemented 3 utility functions:
constexpr void fill(ForwardRange &&range, const T &value)
TemporaryString tmpStrCat(Ts &&... ts)
constexpr auto xrange(T e)