From df9e7376e6a2c7d989d28d8c4f9880aae5a41c38 Mon Sep 17 00:00:00 2001 From: murmur Date: Thu, 19 Dec 2024 23:34:37 +0800 Subject: [PATCH] update transDataToMotorValve --- Core/Inc/main.h | 2 +- Core/Src/main.c | 11 +++++++++++ Core/motor | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Core/Inc/main.h b/Core/Inc/main.h index 643006b..1dd54fb 100644 --- a/Core/Inc/main.h +++ b/Core/Inc/main.h @@ -55,7 +55,7 @@ extern volatile uint8_t motorRxEnd; /* Exported functions prototypes ---------------------------------------------*/ void Error_Handler(void); - +void transDataToMotorValve(uint8_t *data, uint16_t len); /* USER CODE BEGIN EFP */ /* USER CODE END EFP */ diff --git a/Core/Src/main.c b/Core/Src/main.c index 5491a13..f6ab2ff 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -69,6 +69,17 @@ void transDataToHost(uint8_t *data, uint16_t len) HAL_GPIO_WritePin(DIR1_GPIO_Port, DIR1_Pin, GPIO_PIN_RESET); // HAL_Delay(100); } + +void transDataToMotorValve(uint8_t *data, uint16_t len) +{ + // 开启uart3 dma + HAL_GPIO_WritePin(DIR2_GPIO_Port, DIR2_Pin, GPIO_PIN_SET); + // HAL_Delay(100); + // HAL_UART_Transmit_DMA(&huart2, data, len); + HAL_UART_Transmit(&huart2, data, len, 100); + HAL_GPIO_WritePin(DIR2_GPIO_Port, DIR2_Pin, GPIO_PIN_RESET); + // HAL_Delay(100); +} /* USER CODE END PFP */ /* Private user code ---------------------------------------------------------*/ diff --git a/Core/motor b/Core/motor index e4ee1c0..ce85303 160000 --- a/Core/motor +++ b/Core/motor @@ -1 +1 @@ -Subproject commit e4ee1c0eecad3dcc04ef071132ef67d852a0c974 +Subproject commit ce8530303e7042bb58c67772ecd9c32586df1fdb