From f1284cc0b7e4c9c54741354ef53802446650682a Mon Sep 17 00:00:00 2001 From: cornernote Date: Fri, 17 Jan 2020 10:45:26 +1030 Subject: [PATCH] remove unneeded switch --- src/classes/Keyboard.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/classes/Keyboard.cpp b/src/classes/Keyboard.cpp index 1c3b286..db26562 100644 --- a/src/classes/Keyboard.cpp +++ b/src/classes/Keyboard.cpp @@ -770,25 +770,12 @@ bool LedKeyboard::setOnBoardMode(OnBoardMode onBoardMode) { byte_buffer_t data; switch (currentDevice.model) { case KeyboardModel::g815: - switch (onBoardMode) { - case LedKeyboard::OnBoardMode::board: - data = { 0x11, 0xff, 0x11, 0x1a, 0x01 }; - data.resize(20, 0x00); - return sendDataInternal(data); - case LedKeyboard::OnBoardMode::software: - data = { 0x11, 0xff, 0x11, 0x1b, 0x02 }; - data.resize(20, 0x00); - return sendDataInternal(data); - default: - break; - } - break; + data = { 0x11, 0xff, 0x11, 0x1a, onBoardMode }; + data.resize(20, 0x00); + return sendDataInternal(data); default: return false; } - data.push_back((unsigned char)onBoardMode); - data.resize(20, 0x00); - return sendDataInternal(data); } bool LedKeyboard::setNativeEffect(NativeEffect effect, NativeEffectPart part,