Rearrange slave_command_t enum values a bit to reflect their relative importance and rearrange a related case block too.

This commit is contained in:
László Monda
2017-10-01 22:21:00 +02:00
parent 858586ef2a
commit 724d72132a
2 changed files with 4 additions and 4 deletions

View File

@@ -42,6 +42,9 @@ void SlaveRxHandler(void)
uint8_t commandId = RxMessage.data[0];
switch (commandId) {
case SlaveCommand_JumpToBootloader:
JumpToBootloader();
break;
case SlaveCommand_SetTestLed:
TxMessage.length = 0;
bool isLedOn = RxMessage.data[1];
@@ -52,9 +55,6 @@ void SlaveRxHandler(void)
uint8_t brightnessPercent = RxMessage.data[1];
LedPwm_SetBrightness(brightnessPercent);
break;
case SlaveCommand_JumpToBootloader:
JumpToBootloader();
break;
}
}

View File

@@ -12,9 +12,9 @@
typedef enum {
SlaveCommand_RequestProperty,
SlaveCommand_RequestKeyStates,
SlaveCommand_JumpToBootloader,
SlaveCommand_SetTestLed,
SlaveCommand_SetLedPwmBrightness,
SlaveCommand_JumpToBootloader,
} slave_command_t;
typedef enum {