Skip to content

PinGroup::read always reads from bank 0 #981

@jannic

Description

@jannic

The setters in PinGroup carefully select the correct bank to write to, e.g.:

    pub fn set(&mut self, state: PinState) {
        use super::pin::pin_sealed::PinIdOps;
        let mask = self.0.write_mask();
        let head_id = self.0.head.borrow().id();
        if state == PinState::Low {
            head_id.sio_out_clr().write(|w| unsafe { w.bits(mask) });
        } else {
            head_id.sio_out_set().write(|w| unsafe { w.bits(mask) });
        }
    }

However, read() always reads bank 0:

    pub fn read(&self) -> u32 {
        let mask = self.0.read_mask();
        crate::sio::Sio::read_bank0() & mask
    }

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