chargeController/APP/businessLogic/Src/bl_comm.c

77 lines
1.3 KiB
C

#include "bl_comm.h"
#include "uart_dev.h"
#include "interruptSend.h"
#include "SOE.h"
uint8_t rs485_buff[buffLen]={0x00};
/**
* @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))
// 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)
{
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))
InRingQueue(&dev->uart_ring_queue, c);
start_bat485Rx_It();
}
/**
* @brief gw485串口中断发送回调函数
* @param
* @retval
*
*/
void gw485_TxIt(void)
{
setSendOverStateGw();
}
/**
* @brief bat485串口中断发送回调函数
* @param
* @retval
*
*/
void bat485_TxIt(void)
{
setSendOverStateBat();
}