summaryrefslogtreecommitdiffstats
path: root/bsps/shared
diff options
context:
space:
mode:
authorKinsey Moore <kinsey.moore@oarcorp.com>2024-01-02 14:36:52 -0600
committerJoel Sherrill <joel@rtems.org>2024-01-10 14:43:53 -0600
commit150dcf5e476c6d712626c4df1f8fa3a4df8c5929 (patch)
tree7ce819328e7e793696b5500961bf8824cf94e16c /bsps/shared
parentbsps/aarch64/cache: Clean up unused fuctions (diff)
downloadrtems-150dcf5e476c6d712626c4df1f8fa3a4df8c5929.tar.bz2
libio: Clean up usage of rtems_termios_device_mode
This cleans up outputUsesInterrupts usage with rtems_termios_device_mode enum values. The outputUsesInterrupts member was typed as an int, named as if it were a boolean value, and used as if it were a rtems_termios_device_mode enum. In this patch, values assigned to outputUsesInterrupts have been converted to the corresponding rtems_termios_device_mode enum value, conversions from deviceOutputUsesInterrupts have been made explicit, and uses of rtems_termios_device_mode enum values with deviceOutputUsesInterrupts have been converted to booleans.
Diffstat (limited to 'bsps/shared')
-rw-r--r--bsps/shared/dev/serial/console-polled.c2
-rw-r--r--bsps/shared/dev/serial/legacy-console.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/bsps/shared/dev/serial/console-polled.c b/bsps/shared/dev/serial/console-polled.c
index 0fc765cb64..37ad5b8f18 100644
--- a/bsps/shared/dev/serial/console-polled.c
+++ b/bsps/shared/dev/serial/console-polled.c
@@ -113,7 +113,7 @@ rtems_device_driver console_open(
NULL, /* setAttributes */
NULL, /* stopRemoteTx */
NULL, /* startRemoteTx */
- 0 /* outputUsesInterrupts */
+ TERMIOS_POLLED /* outputUsesInterrupts */
};
assert( minor == 0 );
diff --git a/bsps/shared/dev/serial/legacy-console.c b/bsps/shared/dev/serial/legacy-console.c
index 7da87276b0..698439b247 100644
--- a/bsps/shared/dev/serial/legacy-console.c
+++ b/bsps/shared/dev/serial/legacy-console.c
@@ -234,7 +234,11 @@ rtems_device_driver console_open(
Callbacks.stopRemoteTx = NULL;
Callbacks.startRemoteTx = NULL;
}
- Callbacks.outputUsesInterrupts = cptr->pDeviceFns->deviceOutputUsesInterrupts;
+ if (cptr->pDeviceFns->deviceOutputUsesInterrupts) {
+ Callbacks.outputUsesInterrupts = TERMIOS_IRQ_DRIVEN;
+ } else {
+ Callbacks.outputUsesInterrupts = TERMIOS_POLLED;
+ }
/* XXX what about
* Console_Port_Tbl[minor].ulMargin,