1
0
mirror of https://github.com/MatMoul/g810-led.git synced 2024-12-23 01:06:11 +00:00

remove unneeded switch

This commit is contained in:
cornernote 2020-01-17 10:45:26 +10:30
parent b881e69698
commit f1284cc0b7

View File

@ -770,25 +770,12 @@ bool LedKeyboard::setOnBoardMode(OnBoardMode onBoardMode) {
byte_buffer_t data; byte_buffer_t data;
switch (currentDevice.model) { switch (currentDevice.model) {
case KeyboardModel::g815: case KeyboardModel::g815:
switch (onBoardMode) { data = { 0x11, 0xff, 0x11, 0x1a, onBoardMode };
case LedKeyboard::OnBoardMode::board:
data = { 0x11, 0xff, 0x11, 0x1a, 0x01 };
data.resize(20, 0x00); data.resize(20, 0x00);
return sendDataInternal(data); return sendDataInternal(data);
case LedKeyboard::OnBoardMode::software:
data = { 0x11, 0xff, 0x11, 0x1b, 0x02 };
data.resize(20, 0x00);
return sendDataInternal(data);
default:
break;
}
break;
default: default:
return false; return false;
} }
data.push_back((unsigned char)onBoardMode);
data.resize(20, 0x00);
return sendDataInternal(data);
} }
bool LedKeyboard::setNativeEffect(NativeEffect effect, NativeEffectPart part, bool LedKeyboard::setNativeEffect(NativeEffect effect, NativeEffectPart part,