diff --git a/src/config.rs b/src/config.rs index f6eb47b..e232237 100644 --- a/src/config.rs +++ b/src/config.rs @@ -151,6 +151,8 @@ pub struct Config { pub extra_stop_bits: bool, /// Whether parity bits should be used. pub parity: Parity, + /// Whether to wait for CTS before sending. + pub observe_cts: bool, } impl Config { @@ -176,6 +178,7 @@ impl Config { data_bits: WordLength::EightBits, extra_stop_bits: false, parity: Parity::Disabled, + observe_cts: false, }; } diff --git a/src/lib.rs b/src/lib.rs index dfc8c2a..8dfb22a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -681,7 +681,7 @@ impl Uart16550 { // Software flow control. TODO, what to do with hardware flow control? // Is this something we can and should support? - if !mcr.contains(MCR::LOOP_BACK) && !msr.contains(MSR::CTS) { + if self.config.observe_cts && !mcr.contains(MCR::LOOP_BACK) && !msr.contains(MSR::CTS) { return Err(ByteSendError::RemoteNotClearToSend); }