Skip to content

SPI::_acquire() is inefficient #179

Open
@multiplemonomials

Description

@multiplemonomials

Currently, the SPI::_acquire() function is pretty inefficient: if the current SPI class instance does not own the peripheral, it reinitializes the ENTIRE spi hardware peripheral, including setting up clocking and pins again. This has got to be a bit of a performance drain if you are trying to rapidly switch an SPI bus between multiple chips (even though it does mean that you can use the same SPI peripheral on your MCU with multiple pin mappings which is cool). Ideally:

  • General setup such as clocking and DMA channels should only be set up once for a given hardware peripheral
  • Pin mappings should only be changed in acquire() if the previous owner used different pin mappings than the current instance

Metadata

Metadata

Assignees

No one assigned

    Labels

    TaskNot a bug per se, just something that needs to be done

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions