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:
@@ -42,6 +42,9 @@ void SlaveRxHandler(void)
|
|||||||
|
|
||||||
uint8_t commandId = RxMessage.data[0];
|
uint8_t commandId = RxMessage.data[0];
|
||||||
switch (commandId) {
|
switch (commandId) {
|
||||||
|
case SlaveCommand_JumpToBootloader:
|
||||||
|
JumpToBootloader();
|
||||||
|
break;
|
||||||
case SlaveCommand_SetTestLed:
|
case SlaveCommand_SetTestLed:
|
||||||
TxMessage.length = 0;
|
TxMessage.length = 0;
|
||||||
bool isLedOn = RxMessage.data[1];
|
bool isLedOn = RxMessage.data[1];
|
||||||
@@ -52,9 +55,6 @@ void SlaveRxHandler(void)
|
|||||||
uint8_t brightnessPercent = RxMessage.data[1];
|
uint8_t brightnessPercent = RxMessage.data[1];
|
||||||
LedPwm_SetBrightness(brightnessPercent);
|
LedPwm_SetBrightness(brightnessPercent);
|
||||||
break;
|
break;
|
||||||
case SlaveCommand_JumpToBootloader:
|
|
||||||
JumpToBootloader();
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,9 @@
|
|||||||
typedef enum {
|
typedef enum {
|
||||||
SlaveCommand_RequestProperty,
|
SlaveCommand_RequestProperty,
|
||||||
SlaveCommand_RequestKeyStates,
|
SlaveCommand_RequestKeyStates,
|
||||||
|
SlaveCommand_JumpToBootloader,
|
||||||
SlaveCommand_SetTestLed,
|
SlaveCommand_SetTestLed,
|
||||||
SlaveCommand_SetLedPwmBrightness,
|
SlaveCommand_SetLedPwmBrightness,
|
||||||
SlaveCommand_JumpToBootloader,
|
|
||||||
} slave_command_t;
|
} slave_command_t;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|||||||
Reference in New Issue
Block a user