65
65
static int (* input_handler )(unsigned char c );
66
66
/*---------------------------------------------------------------------------*/
67
67
static bool
68
- usable (void )
68
+ usable_rx (void )
69
69
{
70
70
if (BOARD_IOID_UART_RX == IOID_UNUSED ||
71
- BOARD_IOID_UART_TX == IOID_UNUSED ||
71
+ CC26XX_UART_CONF_ENABLE == 0 ) {
72
+ return false;
73
+ }
74
+
75
+ return true;
76
+ }
77
+ /*---------------------------------------------------------------------------*/
78
+ static bool
79
+ usable_tx (void )
80
+ {
81
+ if (BOARD_IOID_UART_TX == IOID_UNUSED ||
72
82
CC26XX_UART_CONF_ENABLE == 0 ) {
73
83
return false;
74
84
}
@@ -271,7 +281,7 @@ cc26xx_uart_init()
271
281
bool interrupts_disabled ;
272
282
273
283
/* Return early if disabled by user conf or if ports are misconfigured */
274
- if (usable () == false ) {
284
+ if (! usable_rx () && ! usable_tx () ) {
275
285
return ;
276
286
}
277
287
299
309
cc26xx_uart_write_byte (uint8_t c )
300
310
{
301
311
/* Return early if disabled by user conf or if ports are misconfigured */
302
- if (usable () == false) {
312
+ if (usable_tx () == false) {
303
313
return ;
304
314
}
305
315
@@ -316,7 +326,7 @@ cc26xx_uart_set_input(int (*input)(unsigned char c))
316
326
input_handler = input ;
317
327
318
328
/* Return early if disabled by user conf or if ports are misconfigured */
319
- if (usable () == false) {
329
+ if (usable_rx () == false) {
320
330
return ;
321
331
}
322
332
@@ -348,7 +358,7 @@ uint8_t
348
358
cc26xx_uart_busy (void )
349
359
{
350
360
/* Return early if disabled by user conf or if ports are misconfigured */
351
- if (usable () == false) {
361
+ if (usable_tx () == false) {
352
362
return UART_IDLE ;
353
363
}
354
364
0 commit comments