diff --git a/john103C6T6/Core/Inc/Proj_setup.h b/john103C6T6/Core/Inc/Proj_setup.h index 49baae8..b3c831d 100644 --- a/john103C6T6/Core/Inc/Proj_setup.h +++ b/john103C6T6/Core/Inc/Proj_setup.h @@ -4,7 +4,9 @@ //**********BEGIN defines*********** //#define OldVer #define MAX_SENSE 32 // НЕ ДЕЛАТЬ МЕНЬШЕ 16 -#define project new_ver//old //new +#define new_ver 1 +#define old_ver 0 +#define project old_ver //new_ver// diff --git a/john103C6T6/Core/Src/stm32f1xx_it.c b/john103C6T6/Core/Src/stm32f1xx_it.c index 40d0b0d..f567e90 100644 --- a/john103C6T6/Core/Src/stm32f1xx_it.c +++ b/john103C6T6/Core/Src/stm32f1xx_it.c @@ -315,7 +315,12 @@ static uint8_t first_in=1; void USART1_IRQHandler(void) { /* USER CODE BEGIN USART1_IRQn 0 */ +#if (project== old_ver) + RS_UART_Handler(&hmodbus1); + return; +#endif + /* USER CODE END USART1_IRQn 0 */ HAL_UART_IRQHandler(&huart1); /* USER CODE BEGIN USART1_IRQn 1 */ @@ -331,8 +336,10 @@ void USART1_IRQHandler(void) void USART2_IRQHandler(void) { /* USER CODE BEGIN USART2_IRQn 0 */ +#if (project== new_ver) RS_UART_Handler(&hmodbus1); return; +#endif /* USER CODE END USART2_IRQn 0 */ HAL_UART_IRQHandler(&huart2); /* USER CODE BEGIN USART2_IRQn 1 */