aboutsummaryrefslogtreecommitdiff
path: root/src/uart.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/uart.rs')
-rw-r--r--src/uart.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/uart.rs b/src/uart.rs
index 3209a318d..cd504a6c6 100644
--- a/src/uart.rs
+++ b/src/uart.rs
@@ -118,7 +118,7 @@ impl<I: Instance> Uart<I> {
118 StopBits::Two => w.sbns().two(), 118 StopBits::Two => w.sbns().two(),
119 }; 119 };
120 // OSR field encodes (osr-1); use raw bits to avoid a long match on all variants 120 // OSR field encodes (osr-1); use raw bits to avoid a long match on all variants
121 let raw_osr = osr.saturating_sub(1) as u8; 121 let raw_osr = osr.saturating_sub(1);
122 unsafe { w.osr().bits(raw_osr).sbr().bits(sbr) } 122 unsafe { w.osr().bits(raw_osr).sbr().bits(sbr) }
123 }); 123 });
124 // 3) CTRL baseline and parity 124 // 3) CTRL baseline and parity
@@ -195,6 +195,12 @@ pub struct RingBuffer {
195 count: usize, 195 count: usize,
196} 196}
197 197
198impl Default for RingBuffer {
199 fn default() -> Self {
200 Self::new()
201 }
202}
203
198impl RingBuffer { 204impl RingBuffer {
199 pub const fn new() -> Self { 205 pub const fn new() -> Self {
200 Self { 206 Self {