mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-31 13:20:26 +08:00
[net][at] Fix receive error data when AT CLI exits.
This commit is contained in:
parent
3bfb9eec25
commit
622fa0e7ce
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
|
|
||||||
#define AT_SW_VERSION "0.2.4"
|
#define AT_SW_VERSION "0.2.5"
|
||||||
|
|
||||||
#define DBG_ENABLE
|
#define DBG_ENABLE
|
||||||
#define DBG_SECTION_NAME "AT"
|
#define DBG_SECTION_NAME "AT"
|
||||||
|
@ -100,9 +100,6 @@ void at_cli_deinit(void)
|
|||||||
rt_base_t int_lvl;
|
rt_base_t int_lvl;
|
||||||
rt_device_t console;
|
rt_device_t console;
|
||||||
|
|
||||||
rt_sem_detach(&console_rx_notice);
|
|
||||||
rt_ringbuffer_destroy(console_rx_fifo);
|
|
||||||
|
|
||||||
int_lvl = rt_hw_interrupt_disable();
|
int_lvl = rt_hw_interrupt_disable();
|
||||||
console = rt_console_get_device();
|
console = rt_console_get_device();
|
||||||
if (console && odev_rx_ind)
|
if (console && odev_rx_ind)
|
||||||
@ -111,6 +108,9 @@ void at_cli_deinit(void)
|
|||||||
rt_device_set_rx_indicate(console, odev_rx_ind);
|
rt_device_set_rx_indicate(console, odev_rx_ind);
|
||||||
}
|
}
|
||||||
rt_hw_interrupt_enable(int_lvl);
|
rt_hw_interrupt_enable(int_lvl);
|
||||||
|
|
||||||
|
rt_sem_detach(&console_rx_notice);
|
||||||
|
rt_ringbuffer_destroy(console_rx_fifo);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef AT_USING_SERVER
|
#ifdef AT_USING_SERVER
|
||||||
@ -272,15 +272,16 @@ static void client_cli_parser(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rt_thread_delete(at_client);
|
|
||||||
rt_sem_detach(&client_rx_notice);
|
|
||||||
rt_ringbuffer_destroy(client_rx_fifo);
|
|
||||||
/* restore client device RX indicate */
|
/* restore client device RX indicate */
|
||||||
{
|
{
|
||||||
int_lvl = rt_hw_interrupt_disable();
|
int_lvl = rt_hw_interrupt_disable();
|
||||||
rt_device_set_rx_indicate(client->device, client_odev_rx_ind);
|
rt_device_set_rx_indicate(client->device, client_odev_rx_ind);
|
||||||
rt_hw_interrupt_enable(int_lvl);
|
rt_hw_interrupt_enable(int_lvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rt_thread_delete(at_client);
|
||||||
|
rt_sem_detach(&client_rx_notice);
|
||||||
|
rt_ringbuffer_destroy(client_rx_fifo);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user