From 5dd3b8e0be3fa3de0a28b277f13b1000f227a18c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Fri, 22 Sep 2017 01:17:58 +0200 Subject: [PATCH] Handle SlaveCommand_JumpToBootloader --- left/src/slave_protocol_handler.c | 6 +++++- shared/slave_protocol.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/left/src/slave_protocol_handler.c b/left/src/slave_protocol_handler.c index 7f8993c..553b566 100644 --- a/left/src/slave_protocol_handler.c +++ b/left/src/slave_protocol_handler.c @@ -8,6 +8,7 @@ #include "main.h" #include "init_peripherals.h" #include "bool_array_converter.h" +#include "kboot.h" void SetError(uint8_t error); void SetGenericError(void); @@ -39,7 +40,7 @@ void SlaveProtocolHandler(void) break; case SlaveCommand_SetTestLed: SlaveTxSize = 0; - bool isLedOn = SlaveRxBuffer[1]; +// bool isLedOn = SlaveRxBuffer[1]; // TEST_LED_SET(isLedOn); break; case SlaveCommand_SetLedPwmBrightness: @@ -47,5 +48,8 @@ void SlaveProtocolHandler(void) uint8_t brightnessPercent = SlaveRxBuffer[1]; LedPwm_SetBrightness(brightnessPercent); break; + case SlaveCommand_JumpToBootloader: + JumpToKboot(); + break; } } diff --git a/shared/slave_protocol.h b/shared/slave_protocol.h index 530a7cb..ac95cbb 100644 --- a/shared/slave_protocol.h +++ b/shared/slave_protocol.h @@ -7,6 +7,7 @@ SlaveCommand_GetKeyStates, SlaveCommand_SetTestLed, SlaveCommand_SetLedPwmBrightness, + SlaveCommand_JumpToBootloader, } slave_command_t; #endif