|
@@ -1,5 +1,5 @@
|
|
|
/*
|
|
|
- * Copyright (c) 2006-2023, RT-Thread Development Team
|
|
|
+ * Copyright (c) 2006-2025, RT-Thread Development Team
|
|
|
*
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
*
|
|
@@ -10,6 +10,7 @@
|
|
|
* 2018-08-17 chenyong multiple client support
|
|
|
* 2021-03-17 Meco Man fix a buf of leaking memory
|
|
|
* 2021-07-14 Sszl fix a buf of leaking memory
|
|
|
+ * 2025-01-02 dongly support SERIAL_V2
|
|
|
*/
|
|
|
|
|
|
#include <at.h>
|
|
@@ -960,6 +961,10 @@ int at_client_init(const char *dev_name, rt_size_t recv_bufsz, rt_size_t send_bu
|
|
|
RT_ASSERT(client->device->type == RT_Device_Class_Char);
|
|
|
|
|
|
rt_device_set_rx_indicate(client->device, at_client_rx_ind);
|
|
|
+
|
|
|
+#ifdef RT_USING_SERIAL_V2
|
|
|
+ open_result = rt_device_open(client->device, RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_RX_NON_BLOCKING);
|
|
|
+#else
|
|
|
/* using DMA mode first */
|
|
|
open_result = rt_device_open(client->device, RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_DMA_RX);
|
|
|
/* using interrupt mode when DMA mode not supported */
|
|
@@ -967,6 +972,7 @@ int at_client_init(const char *dev_name, rt_size_t recv_bufsz, rt_size_t send_bu
|
|
|
{
|
|
|
open_result = rt_device_open(client->device, RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_INT_RX);
|
|
|
}
|
|
|
+#endif /* RT_USING_SERIAL_V2 */
|
|
|
RT_ASSERT(open_result == RT_EOK);
|
|
|
}
|
|
|
else
|