mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-30 12:10:03 +02:00
[ion/bench] Clean Led command
This commit is contained in:
@@ -11,22 +11,22 @@ namespace Command {
|
||||
void LED(const char * input) {
|
||||
if (strcmp(input, sON) == 0) {
|
||||
Ion::Device::LED::init();
|
||||
Ion::Console::writeLine(sOK);
|
||||
reply(sOK);
|
||||
return;
|
||||
}
|
||||
if (strcmp(input, sOFF) == 0) {
|
||||
Ion::Device::LED::shutdown();
|
||||
Ion::Console::writeLine(sOK);
|
||||
reply(sOK);
|
||||
return;
|
||||
}
|
||||
if (input == nullptr || input[0] != '0' || input[1] != 'x' || !isHex(input[2]) ||!isHex(input[3]) || !isHex(input[4]) || !isHex(input[5]) || !isHex(input[6]) || !isHex(input[7]) || input[8] != NULL) {
|
||||
Ion::Console::writeLine(sSyntaxError);
|
||||
reply(sSyntaxError);
|
||||
return;
|
||||
}
|
||||
uint32_t hexColor = hexNumber(input+2);
|
||||
KDColor ledColor = KDColor::RGB24(hexColor);
|
||||
Ion::LED::setColor(ledColor);
|
||||
Ion::Console::writeLine(sOK);
|
||||
reply(sOK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user