Skip to content

rx_pin and tx_pin erroneously named in the Embassy example #228

Description

@mschnell1

A small glitch but it took me a while to detect my own problems duue to this:

my current code is:

    let uart_result = BufferedUart::new(
        uart_device,
        IrqsLpuart1,
        rx_pin,
        tx_pin,
       ....

in the original Embassy example the namkes of rx_pin and tx_pin are swapped that created a major confusion on my site.

in fact the ultimate origin of the confusion is with Embassy . here they go:

impl<'d> BufferedUart<'d> {
    /// Create a new bidirectional buffered UART driver
    pub fn new<T: Instance>(
        peri: impl Peripheral<P = T> + 'd,
        _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd,
        rx: impl Peripheral<P = impl RxPin<T>> + 'd,
        tx: impl Peripheral<P = impl TxPin<T>> + 'd,
        tx_buffer: &'d mut [u8],
        rx_buffer: &'d mut [u8],
        config: Config,
    ) -> Result<Self, ConfigError> {

having the sequence of the pins reverse regarding the sequence of the buffers. :( :( :(

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions