14[[nodiscard]]
static std::string_view getLedName(
LedStatus::Led led)
16 static constexpr std::array<std::string_view, LedStatus::NUM_LEDS> names = {
17 "power",
"caps",
"kana",
"pause",
"turbo",
"FDD"
27 , msxCliComm(msxCliComm_)
28 , interp(commandController.getInterpreter())
29 , ledStatus(generate_array<NUM_LEDS>([&](auto i) {
33 "Current status for LED",
43 if (ledValue[led] == status)
return;
44 ledValue[led] = status;
51 auto diff = now - lastTime;
64void LedStatus::handleEvent(Led led)
noexcept
66 std::string_view str = ledValue[led] ?
"on":
"off";
67 ledStatus[led].setReadOnlyValue(
TclObject(str));
68 msxCliComm.updateFiltered(
CliComm::LED, getLedName(led), str);
71void LedStatus::executeRT()
74 if (ledValue[i] != ledStatus[i].getValue().getBoolean(interp)) {
75 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)