|
|
@ -16,6 +16,7 @@ |
|
|
修改内容 : 创建文件 |
|
|
修改内容 : 创建文件 |
|
|
|
|
|
|
|
|
******************************************************************************/ |
|
|
******************************************************************************/ |
|
|
|
|
|
#include "bsp_uart.h" |
|
|
|
|
|
|
|
|
/*----------------------------------------------*
|
|
|
/*----------------------------------------------*
|
|
|
* 外部变量说明 * |
|
|
* 外部变量说明 * |
|
|
@ -79,18 +80,35 @@ void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) |
|
|
} |
|
|
} |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
static int check_RS485_1(char *_pBuffer, uint32_t _iSize) |
|
|
|
|
|
{ |
|
|
|
|
|
rd_ComSend(g_ptRS485_1, _pBuffer, _iSize); |
|
|
|
|
|
return _iSize; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static int check_RS485_2(char *_pBuffer, uint32_t _iSize) |
|
|
|
|
|
{ |
|
|
|
|
|
rd_ComSend(g_ptRS485_2, _pBuffer, _iSize); |
|
|
|
|
|
return _iSize; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void SpoolendInit(void) |
|
|
void SpoolendInit(void) |
|
|
{ |
|
|
{ |
|
|
TUartUserData *ptUartUserData = UART_userdata_init(0, -1, 512); |
|
|
TUartUserData *ptUartUserData = UART_userdata_init(0, 115200, 512); |
|
|
g_ptRS485_1 = rd_ComCreate(check_MK32Data, decode_MK32Data, E28_SBUS_Send, ptUartUserData->m_buf_size, ptUartUserData); |
|
|
g_ptRS485_1 = rd_ComCreate(check_RS485_1, NULL, RS485_1_Send, ptUartUserData->m_buf_size, ptUartUserData); |
|
|
UART_IT_init(g_ptRS485_1); |
|
|
|
|
|
TUartUserData *ptUartUserData1 = UART_userdata_init(0, -1, 512); |
|
|
|
|
|
g_ptRS485_1 = rd_ComCreate(check_MK32Data, decode_MK32Data, E28_SBUS_Send, ptUartUserData1->m_buf_size, ptUartUserData1); |
|
|
|
|
|
UART_IT_init(g_ptRS485_1); |
|
|
UART_IT_init(g_ptRS485_1); |
|
|
|
|
|
TUartUserData *ptUartUserData1 = UART_userdata_init(0, 115200, 512); |
|
|
|
|
|
g_ptRS485_2 = rd_ComCreate(check_RS485_2, NULL, RS485_2_Send, ptUartUserData1->m_buf_size, ptUartUserData1); |
|
|
|
|
|
UART_IT_init(g_ptRS485_2); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void SpoolendTask(void) |
|
|
void SpoolendTask(void) |
|
|
{ |
|
|
{ |
|
|
|
|
|
char pcBuffer1[52] = {0}; |
|
|
|
|
|
char pcBuffer2[52] = {0}; |
|
|
|
|
|
__disable_irq(); |
|
|
|
|
|
rd_ComRead(g_ptRS485_1, pcBuffer1, sizeof(pcBuffer1)); |
|
|
|
|
|
rd_ComRead(g_ptRS485_2, pcBuffer2, sizeof(pcBuffer2)); |
|
|
|
|
|
__enable_irq(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|