diff options
author | Keith Packard <keithp@keithp.com> | 2017-05-15 08:58:21 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2017-05-15 08:58:21 -0700 |
commit | f132a22995235f3002e4a2bb8771c9b5738efb30 (patch) | |
tree | 3a7a154b25fd70e0f996af191c8e9204e74716a4 /src/stmf0/ao_arch_funcs.h | |
parent | 2536640b852feff41975d2da50befdda91ee6303 (diff) |
altos/stmf: Fix up serial port flow control configuration bits
Compute whether any sw/hw flow control is in use.
Compute whether hw flow control is in use as a separate value.
These make the code a bit easier to follow.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/stmf0/ao_arch_funcs.h')
-rw-r--r-- | src/stmf0/ao_arch_funcs.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/stmf0/ao_arch_funcs.h b/src/stmf0/ao_arch_funcs.h index c38ce41a..01d51f90 100644 --- a/src/stmf0/ao_arch_funcs.h +++ b/src/stmf0/ao_arch_funcs.h @@ -310,6 +310,27 @@ void ao_i2c_init(void); /* ao_serial_stm.c */ + +#if USE_SERIAL_1_FLOW && USE_SERIAL_1_SW_FLOW || USE_SERIAL_2_FLOW && USE_SERIAL_2_SW_FLOW +#define HAS_SERIAL_SW_FLOW 1 +#else +#define HAS_SERIAL_SW_FLOW 0 +#endif + +#if USE_SERIAL_2_FLOW && !USE_SERIAL_2_SW_FLOW +#define USE_SERIAL_2_HW_FLOW 1 +#endif + +#if USE_SERIAL_1_FLOW && !USE_SERIAL_1_SW_FLOW +#define USE_SERIAL_1_HW_FLOW 1 +#endif + +#if USE_SERIAL_1_HW_FLOW || USE_SERIAL_2_HW_FLOW +#define HAS_SERIAL_HW_FLOW 1 +#else +#define HAS_SERIAL_HW_FLOW 0 +#endif + struct ao_stm_usart { struct ao_fifo rx_fifo; struct ao_fifo tx_fifo; |