Skip to content

Commit

Permalink
Fix CriticalSection.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Jun 14, 2022
1 parent b53dbe7 commit 554d393
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/bus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl<USB: UsbPeripheral> UsbBus<USB> {
self.peripheral
}

fn configure_all(&self, cs: &CriticalSection) {
fn configure_all(&self, cs: CriticalSection<'_>) {
let regs = self.regs.borrow(cs);

// Rx FIFO
Expand Down Expand Up @@ -108,7 +108,7 @@ impl<USB: UsbPeripheral> UsbBus<USB> {
}
}

fn deconfigure_all(&self, cs: &CriticalSection) {
fn deconfigure_all(&self, cs: CriticalSection<'_>) {
let regs = self.regs.borrow(cs);

// disable interrupts
Expand Down
8 changes: 4 additions & 4 deletions src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl EndpointIn {
}
}

pub fn configure(&self, _cs: &CriticalSection) {
pub fn configure(&self, _cs: CriticalSection<'_>) {
if self.index() == 0 {
let mpsiz = match self.descriptor.max_packet_size {
8 => 0b11,
Expand All @@ -100,7 +100,7 @@ impl EndpointIn {
}
}

pub fn deconfigure(&self, _cs: &CriticalSection) {
pub fn deconfigure(&self, _cs: CriticalSection<'_>) {
let regs = self.usb.endpoint_in(self.index() as usize);

// deactivating endpoint
Expand Down Expand Up @@ -163,7 +163,7 @@ impl EndpointOut {
}
}

pub fn configure(&self, _cs: &CriticalSection) {
pub fn configure(&self, _cs: CriticalSection<'_>) {
if self.index() == 0 {
let mpsiz = match self.descriptor.max_packet_size {
8 => 0b11,
Expand All @@ -189,7 +189,7 @@ impl EndpointOut {
}
}

pub fn deconfigure(&self, _cs: &CriticalSection) {
pub fn deconfigure(&self, _cs: CriticalSection<'_>) {
let regs = self.usb.endpoint_out(self.index() as usize);

// deactivating endpoint
Expand Down

0 comments on commit 554d393

Please sign in to comment.