@@ -54,7 +54,11 @@ static struct native_uart_status native_uart_status_0;
54
54
55
55
static struct uart_driver_api np_uart_driver_api_0 = {
56
56
.poll_out = np_uart_poll_out ,
57
+ #if defined(CONFIG_NATIVE_UART_0_ON_OWN_PTY )
57
58
.poll_in = np_uart_tty_poll_in ,
59
+ #else
60
+ .poll_in = np_uart_stdin_poll_in ,
61
+ #endif
58
62
};
59
63
60
64
#if defined(CONFIG_UART_NATIVE_POSIX_PORT_1_ENABLE )
@@ -89,11 +93,9 @@ static int np_uart_0_init(const struct device *dev)
89
93
90
94
d -> in_fd = tty_fn ;
91
95
d -> out_fd = tty_fn ;
92
- np_uart_driver_api_0 .poll_in = np_uart_tty_poll_in ;
93
96
} else { /* NATIVE_UART_0_ON_STDINOUT */
94
97
d -> in_fd = np_uart_ptty_get_stdin_fileno ();
95
98
d -> out_fd = np_uart_ptty_get_stdout_fileno ();
96
- np_uart_driver_api_0 .poll_in = np_uart_stdin_poll_in ;
97
99
}
98
100
99
101
return 0 ;
@@ -160,8 +162,7 @@ static void np_uart_poll_out(const struct device *dev,
160
162
* @retval 0 If a character arrived and was stored in p_char
161
163
* @retval -1 If no character was available to read
162
164
*/
163
- static int np_uart_stdin_poll_in (const struct device * dev ,
164
- unsigned char * p_char )
165
+ static int __maybe_unused np_uart_stdin_poll_in (const struct device * dev , unsigned char * p_char )
165
166
{
166
167
int in_f = ((struct native_uart_status * )dev -> data )-> in_fd ;
167
168
static bool disconnected ;
@@ -189,8 +190,7 @@ static int np_uart_stdin_poll_in(const struct device *dev,
189
190
* @retval 0 If a character arrived and was stored in p_char
190
191
* @retval -1 If no character was available to read
191
192
*/
192
- static int np_uart_tty_poll_in (const struct device * dev ,
193
- unsigned char * p_char )
193
+ static int __maybe_unused np_uart_tty_poll_in (const struct device * dev , unsigned char * p_char )
194
194
{
195
195
int n = -1 ;
196
196
int in_f = ((struct native_uart_status * )dev -> data )-> in_fd ;
0 commit comments