mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-21 00:27:19 +08:00
[serial-v2]fix the data type error
This commit is contained in:
parent
a61bbdd6d0
commit
4a7ef40dc7
@ -178,7 +178,7 @@ struct rt_uart_ops
|
|||||||
int (*putc)(struct rt_serial_device *serial, char c);
|
int (*putc)(struct rt_serial_device *serial, char c);
|
||||||
int (*getc)(struct rt_serial_device *serial);
|
int (*getc)(struct rt_serial_device *serial);
|
||||||
|
|
||||||
rt_size_t (*transmit)(struct rt_serial_device *serial,
|
rt_ssize_t (*transmit)(struct rt_serial_device *serial,
|
||||||
rt_uint8_t *buf,
|
rt_uint8_t *buf,
|
||||||
rt_size_t size,
|
rt_size_t size,
|
||||||
rt_uint32_t tx_flag);
|
rt_uint32_t tx_flag);
|
||||||
|
@ -455,6 +455,7 @@ static rt_ssize_t _serial_fifo_tx_blocking_nbuf(struct rt_device *dev,
|
|||||||
{
|
{
|
||||||
struct rt_serial_device *serial;
|
struct rt_serial_device *serial;
|
||||||
struct rt_serial_tx_fifo *tx_fifo = RT_NULL;
|
struct rt_serial_tx_fifo *tx_fifo = RT_NULL;
|
||||||
|
rt_ssize_t rst;
|
||||||
|
|
||||||
RT_ASSERT(dev != RT_NULL);
|
RT_ASSERT(dev != RT_NULL);
|
||||||
if (size == 0) return 0;
|
if (size == 0) return 0;
|
||||||
@ -476,14 +477,14 @@ static rt_ssize_t _serial_fifo_tx_blocking_nbuf(struct rt_device *dev,
|
|||||||
|
|
||||||
tx_fifo->activated = RT_TRUE;
|
tx_fifo->activated = RT_TRUE;
|
||||||
/* Call the transmit interface for transmission */
|
/* Call the transmit interface for transmission */
|
||||||
serial->ops->transmit(serial,
|
rst = serial->ops->transmit(serial,
|
||||||
(rt_uint8_t *)buffer,
|
(rt_uint8_t *)buffer,
|
||||||
size,
|
size,
|
||||||
RT_SERIAL_TX_BLOCKING);
|
RT_SERIAL_TX_BLOCKING);
|
||||||
/* Waiting for the transmission to complete */
|
/* Waiting for the transmission to complete */
|
||||||
rt_completion_wait(&(tx_fifo->tx_cpt), RT_WAITING_FOREVER);
|
rt_completion_wait(&(tx_fifo->tx_cpt), RT_WAITING_FOREVER);
|
||||||
|
|
||||||
return size;
|
return rst;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user