diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-01-19 23:30:47 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-01-19 23:30:47 +0100 |
| commit | a2eb46e9e458abec477a118ddbec12ae3f9f0900 (patch) | |
| tree | 55fafc86f88ca7e4959fc7e35fe3daa41021704b | |
| parent | b0b59d87cad3cce73f817dbb67fe8df397f678e4 (diff) | |
| parent | d781e231cd8491e1985bf78374ba13038eb64081 (diff) | |
Merge pull request #2258 from ExplodingWaffle/patch-1
make usart::State private
| -rw-r--r-- | embassy-stm32/src/usart/buffered.rs | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/embassy-stm32/src/usart/buffered.rs b/embassy-stm32/src/usart/buffered.rs index 962547bd7..f8e0bfda5 100644 --- a/embassy-stm32/src/usart/buffered.rs +++ b/embassy-stm32/src/usart/buffered.rs | |||
| @@ -82,23 +82,25 @@ impl<T: BasicInstance> interrupt::typelevel::Handler<T::Interrupt> for Interrupt | |||
| 82 | } | 82 | } |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | /// Buffered UART State | 85 | pub(crate) use sealed::State; |
| 86 | pub struct State { | 86 | pub(crate) mod sealed { |
| 87 | rx_waker: AtomicWaker, | 87 | use super::*; |
| 88 | rx_buf: RingBuffer, | 88 | pub struct State { |
| 89 | 89 | pub(crate) rx_waker: AtomicWaker, | |
| 90 | tx_waker: AtomicWaker, | 90 | pub(crate) rx_buf: RingBuffer, |
| 91 | tx_buf: RingBuffer, | 91 | pub(crate) tx_waker: AtomicWaker, |
| 92 | } | 92 | pub(crate) tx_buf: RingBuffer, |
| 93 | 93 | } | |
| 94 | impl State { | 94 | |
| 95 | /// Create new state | 95 | impl State { |
| 96 | pub const fn new() -> Self { | 96 | /// Create new state |
| 97 | Self { | 97 | pub const fn new() -> Self { |
| 98 | rx_buf: RingBuffer::new(), | 98 | Self { |
| 99 | tx_buf: RingBuffer::new(), | 99 | rx_buf: RingBuffer::new(), |
| 100 | rx_waker: AtomicWaker::new(), | 100 | tx_buf: RingBuffer::new(), |
| 101 | tx_waker: AtomicWaker::new(), | 101 | rx_waker: AtomicWaker::new(), |
| 102 | tx_waker: AtomicWaker::new(), | ||
| 103 | } | ||
| 102 | } | 104 | } |
| 103 | } | 105 | } |
| 104 | } | 106 | } |
