chargeController/APP/businessLogic/Src/bl_comm.c

76 lines
1.3 KiB
C
Raw Normal View History

2024-12-06 09:38:25 +00:00
#include "bl_comm.h"
#include "uart_dev.h"
2024-12-18 09:43:14 +00:00
#include "interruptSend.h"
2024-12-06 09:38:25 +00:00
uint8_t rs485_buff[buffLen]={0x00};
2024-12-06 09:38:25 +00:00
/**
* @brief gw485串口接收中断回调函数
* @param
* @retval
*
*/
void gw485_RxIt(void)
{
// uart_device_info *dev = (uart_device_info *)g_gw485_uart2_handle;
// if(!RingQueueFull(&dev->uart_ring_queue))
2024-12-18 09:43:14 +00:00
// InRingQueue(&dev->uart_ring_queue, rx_gw485_buf[0]);
setIdleStateGw();
uint8_t c = 0;
c = rx_gw485_buf[0];
uart_device_info *dev = (uart_device_info *)g_gw485_uart2_handle;
if(!RingQueueFull(&dev->uart_ring_queue))
InRingQueue(&dev->uart_ring_queue, c);
start_gw485Rx_It();
}
/**
* @brief bat485串口接收中断回调函数
* @param
* @retval
*
*/
void bat485_RxIt(void)
{
2024-12-18 09:43:14 +00:00
setIdleStateBat();
uint8_t c = 0;
c = rx_bat485_buf[0];
uart_device_info *dev = (uart_device_info *)g_bat485_uart3_handle;
if(!RingQueueFull(&dev->uart_ring_queue))
2024-12-18 09:43:14 +00:00
InRingQueue(&dev->uart_ring_queue, c);
start_bat485Rx_It();
2024-12-18 09:43:14 +00:00
}
/**
* @brief gw485串口中断发送回调函数
* @param
* @retval
*
*/
void gw485_TxIt(void)
{
setSendOverStateGw();
}
/**
* @brief bat485串口中断发送回调函数
* @param
* @retval
*
*/
void bat485_TxIt(void)
{
setSendOverStateBat();
}