Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -176,6 +178,7 @@ impl Config {
data_bits: WordLength::EightBits,
extra_stop_bits: false,
parity: Parity::Disabled,
observe_cts: false,
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ impl<B: Backend> Uart16550<B> {

// 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);
}

Expand Down