add assert for serial v2

This commit is contained in:
tfx2001 2022-08-13 20:27:11 +08:00 committed by Man, Jianting (Meco)
parent 405e0da093
commit 218cdbce4e
1 changed files with 1 additions and 0 deletions

View File

@ -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;