fix(serial,drv_pin): 修复serial方法检查错误,修复PIN驱动中断关闭错误

感谢Lucas反馈问题
This commit is contained in:
MacRsh
2025-04-07 19:50:46 +08:00
parent 8cfcbfedf8
commit c945804480
3 changed files with 12 additions and 2 deletions

View File

@@ -276,7 +276,7 @@ static int mr_serial_ioctl(struct mr_dev *dev, int cmd, void *args)
if (args != MR_NULL) {
size_t bufsz = *(size_t *)args;
if (ops->stop_dma_rx) {
if (ops->stop_dma_rx == MR_NULL) {
return MR_EIO;
}
ops->stop_dma_rx(serial);
@@ -299,6 +299,10 @@ static int mr_serial_ioctl(struct mr_dev *dev, int cmd, void *args)
if (args != MR_NULL) {
size_t bufsz = *(size_t *)args;
if (serial->nonblock_state != MR_DISABLE) {
return MR_EBUSY;
}
uint8_t *pool = mr_realloc(serial->dma_wr_buf, bufsz);
if ((pool == MR_NULL) && (bufsz != 0)) {
return MR_ENOMEM;