int32_t serial_send_stream_abort (serial_t *obj) { PHAL_RUART_OP pHalRuartOp; PHAL_RUART_ADAPTER pHalRuartAdapter=(PHAL_RUART_ADAPTER)&(obj->hal_uart_adp); int ret; pHalRuartOp = &(obj->hal_uart_op); ret = pHalRuartOp->HalRuartStopSend((VOID*)pHalRuartAdapter); HalRuartResetTxFifo((VOID*)pHalRuartAdapter); return (ret); }
int32_t serial_send_stream_abort (serial_t *obj) { PHAL_RUART_OP pHalRuartOp; PHAL_RUART_ADAPTER pHalRuartAdapter=(PHAL_RUART_ADAPTER)&(obj->hal_uart_adp); int ret; pHalRuartOp = &(obj->hal_uart_op); HalRuartEnterCritical(pHalRuartAdapter); ret = pHalRuartOp->HalRuartStopSend((VOID*)pHalRuartAdapter); HalRuartExitCritical(pHalRuartAdapter); if (HAL_OK != ret) { return -ret; } HalRuartResetTxFifo((VOID*)pHalRuartAdapter); ret = obj->tx_len - pHalRuartAdapter->TxCount; return (ret); }