Lines Matching +full:re +full:- +full:sending

1 /* ipm_console.c - Console messages to/from another processor */
6 * SPDX-License-Identifier: Apache-2.0
35 k_sem_take(&driver_data->sem, K_FOREVER); in ipm_console_thread()
37 ret = ring_buf_item_get(&driver_data->rb, &type, in ipm_console_thread()
38 (uint8_t *)&config_info->line_buf[pos], in ipm_console_thread()
47 if (config_info->line_buf[pos] == '\n' || in ipm_console_thread()
48 pos == config_info->lb_size - 2) { in ipm_console_thread()
49 if (pos != config_info->lb_size - 2) { in ipm_console_thread()
50 config_info->line_buf[pos] = '\0'; in ipm_console_thread()
52 config_info->line_buf[pos + 1] = '\0'; in ipm_console_thread()
54 if (config_info->flags & IPM_CONSOLE_PRINTK) { in ipm_console_thread()
56 config_info->line_buf); in ipm_console_thread()
58 if (config_info->flags & IPM_CONSOLE_STDOUT) { in ipm_console_thread()
60 config_info->line_buf); in ipm_console_thread()
69 * re-enable it. in ipm_console_thread()
75 if (driver_data->channel_disabled && in ipm_console_thread()
76 ring_buf_item_space_get(&driver_data->rb)) { in ipm_console_thread()
78 ipm_set_enabled(driver_data->ipm_device, 1); in ipm_console_thread()
79 driver_data->channel_disabled = 0; in ipm_console_thread()
95 ret = ring_buf_item_put(&driver_data->rb, 0, id, NULL, 0); in ipm_console_receive_callback()
97 k_sem_give(&driver_data->sem); in ipm_console_receive_callback()
102 * This works without losing data if the sending side tries to send in ipm_console_receive_callback()
103 * more characters because the sending side is making an ipm_send() in ipm_console_receive_callback()
105 * re-enables the channel and consumes the data. in ipm_console_receive_callback()
107 if (ring_buf_item_space_get(&driver_data->rb) == 0) { in ipm_console_receive_callback()
109 driver_data->channel_disabled = 1; in ipm_console_receive_callback()
117 d->config; in ipm_console_receiver_init()
118 struct ipm_console_receiver_runtime_data *driver_data = d->data; in ipm_console_receiver_init()
121 ipm = device_get_binding(config_info->bind_to); in ipm_console_receiver_init()
125 config_info->bind_to); in ipm_console_receiver_init()
126 return -EINVAL; in ipm_console_receiver_init()
130 printk("IPM driver %s doesn't support 8-bit id values", in ipm_console_receiver_init()
131 config_info->bind_to); in ipm_console_receiver_init()
132 return -EINVAL; in ipm_console_receiver_init()
135 driver_data->ipm_device = ipm; in ipm_console_receiver_init()
136 driver_data->channel_disabled = 0; in ipm_console_receiver_init()
137 k_sem_init(&driver_data->sem, 0, K_SEM_MAX_LIMIT); in ipm_console_receiver_init()
138 ring_buf_item_init(&driver_data->rb, config_info->rb_size32, in ipm_console_receiver_init()
139 config_info->ring_buf_data); in ipm_console_receiver_init()
143 k_thread_create(&driver_data->rx_thread, config_info->thread_stack, in ipm_console_receiver_init()