fix error

This commit is contained in:
chinky 2023-04-28 15:10:24 +08:00
parent d1787b7520
commit 2ec3b73b89
2 changed files with 4 additions and 3 deletions

View File

@ -179,7 +179,7 @@ typedef struct rt_serial_device rt_serial_t;
*/
struct rt_uart_ops
{
int (*init)(struct rt_serial_device *serial);
rt_err_t (*init)(struct rt_serial_device *serial);
rt_err_t (*configure)(struct rt_serial_device *serial, struct serial_configure *cfg);
rt_err_t (*control)(struct rt_serial_device *serial, int cmd, void *arg);

View File

@ -1403,9 +1403,10 @@ rt_err_t rt_hw_serial_register(struct rt_serial_device *serial,
rt_err_t ret;
struct rt_device *device;
RT_ASSERT(serial != RT_NULL);
struct serial_configure uart_conf = RT_SERIAL_CONFIG_DEFAULT;
serial->config = RT_SERIAL_CONFIG_DEFAULT;
serial->bufsz = RT_SERIAL_FIFO_BUFSZ;
rt_memcpy(&serial->config, &uart_conf, sizeof(uart_conf));
serial->bufsz = uart_conf.bufsz;
device = &(serial->parent);