油温探头读取正常
This commit is contained in:
+24
-23
@@ -26,6 +26,7 @@
|
||||
#include "Param/param.h"
|
||||
#include "ADS8321/ads8321.h"
|
||||
#include "CPY_PROT/cpy_prot.h"
|
||||
#include "OSU/osu.h"
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
@@ -61,6 +62,8 @@ UART_HandleTypeDef huart1;
|
||||
UART_HandleTypeDef huart3;
|
||||
DMA_HandleTypeDef hdma_uart4_tx;
|
||||
DMA_HandleTypeDef hdma_uart4_rx;
|
||||
DMA_HandleTypeDef hdma_usart3_rx;
|
||||
DMA_HandleTypeDef hdma_usart3_tx;
|
||||
|
||||
/* Definitions for defaultTask */
|
||||
osThreadId_t defaultTaskHandle;
|
||||
@@ -820,7 +823,7 @@ static void MX_USART3_UART_Init(void)
|
||||
|
||||
/* USER CODE END USART3_Init 1 */
|
||||
huart3.Instance = USART3;
|
||||
huart3.Init.BaudRate = 9600;
|
||||
huart3.Init.BaudRate = 115200;
|
||||
huart3.Init.WordLength = UART_WORDLENGTH_8B;
|
||||
huart3.Init.StopBits = UART_STOPBITS_1;
|
||||
huart3.Init.Parity = UART_PARITY_NONE;
|
||||
@@ -871,6 +874,12 @@ static void MX_DMA_Init(void)
|
||||
/* DMA1_Stream2_IRQn interrupt configuration */
|
||||
HAL_NVIC_SetPriority(DMA1_Stream2_IRQn, 5, 0);
|
||||
HAL_NVIC_EnableIRQ(DMA1_Stream2_IRQn);
|
||||
/* DMA1_Stream3_IRQn interrupt configuration */
|
||||
HAL_NVIC_SetPriority(DMA1_Stream3_IRQn, 5, 0);
|
||||
HAL_NVIC_EnableIRQ(DMA1_Stream3_IRQn);
|
||||
/* DMA1_Stream4_IRQn interrupt configuration */
|
||||
HAL_NVIC_SetPriority(DMA1_Stream4_IRQn, 5, 0);
|
||||
HAL_NVIC_EnableIRQ(DMA1_Stream4_IRQn);
|
||||
|
||||
}
|
||||
|
||||
@@ -950,6 +959,18 @@ void ifilaAdust(void)
|
||||
__HAL_TIM_SET_COMPARE(&htim1, TIM_CHANNEL_1, gusDuty);
|
||||
}
|
||||
|
||||
void HAL_UARTEx_RxEventCallback_UART3(UART_HandleTypeDef *huart, uint16_t Size);
|
||||
void HAL_UARTEx_RxEventCallback_UART4(UART_HandleTypeDef *huart, uint16_t Size);
|
||||
void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size)
|
||||
{
|
||||
if (huart->Instance == huart3.Instance) {
|
||||
HAL_UARTEx_RxEventCallback_UART3(huart, Size);
|
||||
} else if (huart->Instance == huart4.Instance) {
|
||||
HAL_UARTEx_RxEventCallback_UART4(huart, Size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* USER CODE END 4 */
|
||||
|
||||
/* USER CODE BEGIN Header_StartDefaultTask */
|
||||
@@ -980,8 +1001,7 @@ void StartDefaultTask(void *argument)
|
||||
|
||||
HAL_TIMEx_PWMN_Start(&htim1, TIM_CHANNEL_1);
|
||||
|
||||
|
||||
// sampleInit();
|
||||
osuInit();
|
||||
iapThreadInit();
|
||||
cpyProtInit();
|
||||
HAL_IWDG_Refresh(&hiwdg1);
|
||||
@@ -992,9 +1012,7 @@ void StartDefaultTask(void *argument)
|
||||
osDelay(2);
|
||||
i++;
|
||||
ifilaAdust();
|
||||
// giIapThreadStatus++;
|
||||
// giAdcThreadStatus++;
|
||||
// giCmdThreadStatus++;
|
||||
|
||||
if (i % 250 != 0) {
|
||||
continue;
|
||||
}
|
||||
@@ -1012,23 +1030,6 @@ void StartDefaultTask(void *argument)
|
||||
|
||||
HAL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
|
||||
|
||||
// if (giIapThreadStatus > 3) {
|
||||
// printf("giIapThreadStatus error\n");
|
||||
// iFaultFlag = 1;
|
||||
// }
|
||||
// if (giAdcThreadStatus > 6) {
|
||||
// printf("giAdcThreadStatus error\n");
|
||||
// iFaultFlag = 1;
|
||||
// }
|
||||
// if (giCmdThreadStatus > 2) {
|
||||
// printf("giCmdThreadStatus error\n");
|
||||
// iFaultFlag = 1;
|
||||
// }
|
||||
// if (iFaultFlag) {
|
||||
// while (1) {
|
||||
// // 等看门狗自动复位
|
||||
// }
|
||||
// }
|
||||
}
|
||||
/* USER CODE END 5 */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user