mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2024-12-23 20:51:31 +11:00
Merge pull request #411 from jannic/fix-usb-sie_status
Fix clearing usb sie_status flags
This commit is contained in:
commit
62f1ab2159
|
@ -538,24 +538,8 @@ impl UsbBusTrait for UsbBus {
|
||||||
.bit_is_set()
|
.bit_is_set()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
fn suspend(&self) {
|
fn suspend(&self) {}
|
||||||
interrupt::free(|cs| {
|
fn resume(&self) {}
|
||||||
let inner = self.inner.borrow(cs).borrow_mut();
|
|
||||||
inner
|
|
||||||
.ctrl_reg
|
|
||||||
.sie_status
|
|
||||||
.modify(|_, w| w.suspended().set_bit());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
fn resume(&self) {
|
|
||||||
interrupt::free(|cs| {
|
|
||||||
let inner = self.inner.borrow(cs).borrow_mut();
|
|
||||||
inner
|
|
||||||
.ctrl_reg
|
|
||||||
.sie_status
|
|
||||||
.modify(|_, w| w.resume().set_bit());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
fn poll(&self) -> PollResult {
|
fn poll(&self) -> PollResult {
|
||||||
interrupt::free(|cs| {
|
interrupt::free(|cs| {
|
||||||
let mut inner = self.inner.borrow(cs).borrow_mut();
|
let mut inner = self.inner.borrow(cs).borrow_mut();
|
||||||
|
@ -565,8 +549,10 @@ impl UsbBusTrait for UsbBus {
|
||||||
if sie_status.bus_reset().bit_is_set() {
|
if sie_status.bus_reset().bit_is_set() {
|
||||||
return PollResult::Reset;
|
return PollResult::Reset;
|
||||||
} else if sie_status.suspended().bit_is_set() {
|
} else if sie_status.suspended().bit_is_set() {
|
||||||
|
inner.ctrl_reg.sie_status.write(|w| w.suspended().set_bit());
|
||||||
return PollResult::Suspend;
|
return PollResult::Suspend;
|
||||||
} else if sie_status.resume().bit_is_set() {
|
} else if sie_status.resume().bit_is_set() {
|
||||||
|
inner.ctrl_reg.sie_status.write(|w| w.resume().set_bit());
|
||||||
return PollResult::Resume;
|
return PollResult::Resume;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue