diff --git a/Src/main.c b/Src/main.c index 76c5ed5..cf228c1 100644 --- a/Src/main.c +++ b/Src/main.c @@ -117,7 +117,7 @@ static uint8_t timeoutFlagADC = 0; // Timeout Flag for for ADC Protection: 0 = uint8_t checksuml; uint8_t checksumh; } Serialcommand; - #elif + #else typedef struct{ uint16_t start; int16_t steer; @@ -529,7 +529,7 @@ int main(void) { ibus_chksum -= command.channels[i]; } if (command.start == IBUS_LENGTH && command.type == IBUS_COMMAND && ibus_chksum == ( command.checksumh << 8) + command.checksuml ) { - #elif + #else if (command.start == START_FRAME && command.checksum == (uint16_t)(command.start ^ command.steer ^ command.speed)) { #endif if (timeoutFlagSerial) { // Check for previous timeout flag @@ -542,7 +542,7 @@ int main(void) { } cmd1 = CLAMP((ibus_captured_value[0] - INPUT_MID) * 2, INPUT_MIN, INPUT_MAX); cmd2 = CLAMP((ibus_captured_value[1] - INPUT_MID) * 2, INPUT_MIN, INPUT_MAX); - #elif + #else cmd1 = CLAMP((int16_t)command.steer, INPUT_MIN, INPUT_MAX); cmd2 = CLAMP((int16_t)command.speed, INPUT_MIN, INPUT_MAX); #endif @@ -1040,4 +1040,4 @@ void SystemClock_Config(void) { /* SysTick_IRQn interrupt configuration */ HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); -} \ No newline at end of file +}