diff --git a/Src/util.c b/Src/util.c index 4aa43ab..629273a 100644 --- a/Src/util.c +++ b/Src/util.c @@ -731,7 +731,7 @@ void readCommand(void) { timeoutCntSerial = SERIAL_TIMEOUT; // Limit timout counter value } // Most probably we are out-of-sync. Try to re-sync by reseting the DMA - if (main_loop_counter % 30 == 0) { + if (command.start != IBUS_LENGTH && command.start != 0xFF && main_loop_counter % 2 == 0) { HAL_UART_DMAStop(&huart); HAL_UART_Receive_DMA(&huart, (uint8_t *)&command, sizeof(command)); } @@ -753,7 +753,7 @@ void readCommand(void) { timeoutCntSerial = SERIAL_TIMEOUT; // Limit timout counter value } // Most probably we are out-of-sync. Try to re-sync by reseting the DMA - if (main_loop_counter % 30 == 0) { + if (command.start != SERIAL_START_FRAME && command.start != 0xFFFF && main_loop_counter % 2 == 0) { HAL_UART_DMAStop(&huart); HAL_UART_Receive_DMA(&huart, (uint8_t *)&command, sizeof(command)); } @@ -787,7 +787,7 @@ void readCommand(void) { timeoutCntSerial_L = SERIAL_TIMEOUT; // Limit timout counter value } // Most probably we are out-of-sync. Try to re-sync by reseting the DMA - if (main_loop_counter % 30 == 0) { + if (Sideboard_Lnew.start != SERIAL_START_FRAME && Sideboard_Lnew.start != 0xFFFF && main_loop_counter % 2 == 0) { HAL_UART_DMAStop(&huart2); HAL_UART_Receive_DMA(&huart2, (uint8_t *)&Sideboard_Lnew, sizeof(Sideboard_Lnew)); } @@ -810,7 +810,7 @@ void readCommand(void) { timeoutCntSerial_R = SERIAL_TIMEOUT; // Limit timout counter value } // Most probably we are out-of-sync. Try to re-sync by reseting the DMA - if (main_loop_counter % 30 == 0) { + if (Sideboard_Rnew.start != SERIAL_START_FRAME && Sideboard_Rnew.start != 0xFFFF && main_loop_counter % 2 == 0) { HAL_UART_DMAStop(&huart3); HAL_UART_Receive_DMA(&huart3, (uint8_t *)&Sideboard_Rnew, sizeof(Sideboard_Rnew)); } @@ -818,7 +818,7 @@ void readCommand(void) { timeoutFlagSerial = timeoutFlagSerial_R; #endif #if defined(SIDEBOARD_SERIAL_USART2) && defined(SIDEBOARD_SERIAL_USART3) - timeoutFlagSerial = timeoutFlagSerial_L | timeoutFlagSerial_R; + timeoutFlagSerial = timeoutFlagSerial_L || timeoutFlagSerial_R; #endif #ifdef VARIANT_HOVERCAR diff --git a/docs/mainboard_pics.pptx b/docs/mainboard_pics.pptx index 2af66e0..e1a4c7e 100644 Binary files a/docs/mainboard_pics.pptx and b/docs/mainboard_pics.pptx differ diff --git a/docs/pictures/mainboard_pinout.png b/docs/pictures/mainboard_pinout.png index cf6cc97..c55cb00 100644 Binary files a/docs/pictures/mainboard_pinout.png and b/docs/pictures/mainboard_pinout.png differ