| 58 | } |
| 59 | |
| 60 | void at_cli_init(void) |
| 61 | { |
| 62 | rt_base_t level; |
| 63 | rt_device_t console; |
| 64 | |
| 65 | rt_sem_init(&console_rx_notice, "cli_c", 0, RT_IPC_FLAG_FIFO); |
| 66 | |
| 67 | /* create RX FIFO */ |
| 68 | console_rx_fifo = rt_ringbuffer_create(AT_CLI_FIFO_SIZE); |
| 69 | /* created must success */ |
| 70 | RT_ASSERT(console_rx_fifo); |
| 71 | |
| 72 | level = rt_hw_interrupt_disable(); |
| 73 | console = rt_console_get_device(); |
| 74 | if (console) |
| 75 | { |
| 76 | /* backup RX indicate */ |
| 77 | odev_rx_ind = console->rx_indicate; |
| 78 | rt_device_set_rx_indicate(console, console_getchar_rx_ind); |
| 79 | } |
| 80 | |
| 81 | rt_hw_interrupt_enable(level); |
| 82 | } |
| 83 | |
| 84 | void at_cli_deinit(void) |
| 85 | { |
no test coverage detected