diff --git a/drivers/serial/uart_handlers.c b/drivers/serial/uart_handlers.c index 3212841977..44620d4c45 100644 --- a/drivers/serial/uart_handlers.c +++ b/drivers/serial/uart_handlers.c @@ -49,7 +49,7 @@ static inline void z_vrfy_uart_poll_out(struct device *dev, */ static inline int z_vrfy_uart_tx(struct device *dev, const u8_t *buf, - size_t len, u32_t timeout) + size_t len, s32_t timeout) { Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, tx)); Z_OOPS(Z_SYSCALL_MEMORY_READ(buf, len)); @@ -61,7 +61,7 @@ UART_SIMPLE(tx_abort); #include static inline int z_vrfy_uart_rx_enable(struct device *dev, u8_t *buf, - size_t len, u32_t timeout) + size_t len, s32_t timeout) { Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, rx_enable)); Z_OOPS(Z_SYSCALL_MEMORY_WRITE(buf, len)); diff --git a/include/drivers/uart.h b/include/drivers/uart.h index efb6b3240b..4de313e670 100644 --- a/include/drivers/uart.h +++ b/include/drivers/uart.h @@ -350,11 +350,11 @@ struct uart_driver_api { void *user_data); int (*tx)(struct device *dev, const u8_t *buf, size_t len, - u32_t timeout); + s32_t timeout); int (*tx_abort)(struct device *dev); int (*rx_enable)(struct device *dev, u8_t *buf, size_t len, - u32_t timeout); + s32_t timeout); int (*rx_buf_rsp)(struct device *dev, u8_t *buf, size_t len); int (*rx_disable)(struct device *dev); @@ -460,16 +460,17 @@ static inline int uart_callback_set(struct device *dev, * @param dev UART device structure. * @param buf Pointer to transmit buffer. * @param len Length of transmit buffer. - * @param timeout Timeout in milliseconds. Valid only if flow control is enabled + * @param timeout Timeout in milliseconds. Valid only if flow control is + * enabled. K_FOREVER disables timeout. * * @retval -EBUSY There is already an ongoing transfer. * @retval 0 If successful, negative errno code otherwise. */ __syscall int uart_tx(struct device *dev, const u8_t *buf, size_t len, - u32_t timeout); + s32_t timeout); static inline int z_impl_uart_tx(struct device *dev, const u8_t *buf, - size_t len, u32_t timeout) + size_t len, s32_t timeout) { const struct uart_driver_api *api = @@ -508,17 +509,17 @@ static inline int z_impl_uart_tx_abort(struct device *dev) * @param dev UART device structure. * @param buf Pointer to receive buffer. * @param len Buffer length. - * @param timeout Timeout in milliseconds. + * @param timeout Timeout in milliseconds. K_FOREVER disables timeout. * * @retval -EBUSY RX already in progress. * @retval 0 If successful, negative errno code otherwise. * */ __syscall int uart_rx_enable(struct device *dev, u8_t *buf, size_t len, - u32_t timeout); + s32_t timeout); static inline int z_impl_uart_rx_enable(struct device *dev, u8_t *buf, - size_t len, u32_t timeout) + size_t len, s32_t timeout) { const struct uart_driver_api *api = (const struct uart_driver_api *)dev->driver_api;