This commit is contained in:
王绪洁 2025-01-20 14:53:58 +08:00
parent 4114fe70d7
commit 9e357c0254
4 changed files with 9 additions and 22 deletions

View File

@ -319,7 +319,7 @@ void USART2_IRQHandler(void)
/* USER CODE BEGIN USART2_IRQn 0 */
if (__HAL_UART_GET_FLAG(&huart2, UART_FLAG_RXNE) != RESET)
{
HAL_UART_Receive(&huart2, &receive_data, 1, 100);
HAL_UART_Receive(&huart2, &receive_data, 1, 10);
hart2_uart2.rx_data[hart2_uart2.rx_num] = receive_data;
hart2_uart2.rx_num++;
__HAL_UART_CLEAR_IDLEFLAG(&huart2);

View File

@ -87,7 +87,6 @@ void MX_UART5_Init(void)
Error_Handler();
}
/* USER CODE BEGIN UART5_Init 2 */
// HAL_UART_Receive_IT(&huart5, &hart1_uart5.rx_data, 1);
__HAL_UART_ENABLE_IT(&huart5, UART_IT_RXNE); // 接收中断
__HAL_UART_ENABLE_IT(&huart5, UART_IT_IDLE); // 空闲中断
/* USER CODE END UART5_Init 2 */

View File

@ -148,24 +148,7 @@
<Name>-U420014000D0000504A51544E -O2254 -SF1800 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(2BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8000 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F4xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F407VGTx$CMSIS\Flash\STM32F4xx_1024.FLM)</Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint>
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>198</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134230312</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>../Core/Src/main.c</Filename>
<ExecCommand></ExecCommand>
<Expression>\\TEST2\../Core/Src/main.c\198</Expression>
</Bp>
</Breakpoint>
<Breakpoint/>
<WatchWindow1>
<Ww>
<count>0</count>
@ -227,6 +210,11 @@
<WinNumber>1</WinNumber>
<ItemText>hart2_uart2</ItemText>
</Ww>
<Ww>
<count>12</count>
<WinNumber>1</WinNumber>
<ItemText>ad7124_analog</ItemText>
</Ww>
</WatchWindow1>
<MemoryWindow1>
<Mm>

View File

@ -34,7 +34,7 @@ static err_t tcpecho_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t
HAL_UART_Transmit(&huart2, hart2_uart2.tx_data, p->tot_len, 1000);
HART2_RTS_RECEIVE;
#endif
#if 0
#if 1
memcpy(hart1_uart5.tx_data, (int *)p->payload, p->tot_len);
HART1_RTS_SEND;
HAL_UART_Transmit(&huart5, hart1_uart5.tx_data, p->tot_len, 1000);
@ -44,7 +44,7 @@ static err_t tcpecho_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t
memcpy(ble1_uart6.tx_data, (int *)p->payload, p->tot_len);
dma_usart_send(&huart6, ble1_uart6.tx_data, p->tot_len);
#endif
#if 1
#if 0
memcpy(ble2_uart3.tx_data, (int *)p->payload, p->tot_len);
dma_usart_send(&huart3, ble2_uart3.tx_data, p->tot_len);
#endif