From 218cdbce4ede46193a584f2ad5e3dec2170f1538 Mon Sep 17 00:00:00 2001 From: tfx2001 Date: Sat, 13 Aug 2022 20:27:11 +0800 Subject: [PATCH] add assert for serial v2 --- components/drivers/serial/serial_v2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/components/drivers/serial/serial_v2.c b/components/drivers/serial/serial_v2.c index d0d0f6f722..b1e5002d0c 100644 --- a/components/drivers/serial/serial_v2.c +++ b/components/drivers/serial/serial_v2.c @@ -897,6 +897,7 @@ static rt_err_t rt_serial_init(struct rt_device *dev) RT_ASSERT(dev != RT_NULL); serial = (struct rt_serial_device *)dev; + RT_ASSERT(serial->ops->transmit != RT_NULL); /* initialize rx/tx */ serial->serial_rx = RT_NULL;