esp-hal: otg_fs: drop obsolete late cnak quirk (#2621)
* esp-hal: otg_fs: drop obsolete late cnak quirk * build: bump embassy-usb-synopsys-otg to 0.2.0
This commit is contained in:
parent
62994578c2
commit
d66281609b
@ -29,7 +29,7 @@ embassy-embedded-hal = { version = "0.2.0", optional = true }
|
|||||||
embassy-futures = "0.1.1"
|
embassy-futures = "0.1.1"
|
||||||
embassy-sync = "0.6.1"
|
embassy-sync = "0.6.1"
|
||||||
embassy-usb-driver = { version = "0.1.0", optional = true }
|
embassy-usb-driver = { version = "0.1.0", optional = true }
|
||||||
embassy-usb-synopsys-otg = { version = "0.1.0", optional = true }
|
embassy-usb-synopsys-otg = { version = "0.2.0", optional = true }
|
||||||
embedded-can = { version = "0.4.1", optional = true }
|
embedded-can = { version = "0.4.1", optional = true }
|
||||||
embedded-hal = "1.0.0"
|
embedded-hal = "1.0.0"
|
||||||
embedded-hal-async = "1.0.0"
|
embedded-hal-async = "1.0.0"
|
||||||
|
|||||||
@ -195,7 +195,6 @@ pub mod asynch {
|
|||||||
extra_rx_fifo_words: RX_FIFO_EXTRA_SIZE_WORDS,
|
extra_rx_fifo_words: RX_FIFO_EXTRA_SIZE_WORDS,
|
||||||
endpoint_count: Usb::ENDPOINT_COUNT,
|
endpoint_count: Usb::ENDPOINT_COUNT,
|
||||||
phy_type: PhyType::InternalFullSpeed,
|
phy_type: PhyType::InternalFullSpeed,
|
||||||
quirk_setup_late_cnak: quirk_setup_late_cnak(),
|
|
||||||
calculate_trdt_fn: |_| 5,
|
calculate_trdt_fn: |_| 5,
|
||||||
};
|
};
|
||||||
Self {
|
Self {
|
||||||
@ -342,29 +341,13 @@ pub mod asynch {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn quirk_setup_late_cnak() -> bool {
|
|
||||||
// Our CID register is 4 bytes offset from what's in embassy-usb-synopsys-otg
|
|
||||||
let cid = unsafe {
|
|
||||||
Driver::REGISTERS
|
|
||||||
.as_ptr()
|
|
||||||
.cast::<u32>()
|
|
||||||
.add(0x40)
|
|
||||||
.read_volatile()
|
|
||||||
};
|
|
||||||
// ESP32-Sx has a different CID register value, too
|
|
||||||
cid == 0x4f54_400a || cid & 0xf000 == 0x1000
|
|
||||||
}
|
|
||||||
|
|
||||||
#[handler(priority = crate::interrupt::Priority::max())]
|
#[handler(priority = crate::interrupt::Priority::max())]
|
||||||
fn interrupt_handler() {
|
fn interrupt_handler() {
|
||||||
let setup_late_cnak = quirk_setup_late_cnak();
|
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
on_interrupt(
|
on_interrupt(
|
||||||
Driver::REGISTERS,
|
Driver::REGISTERS,
|
||||||
&STATE,
|
&STATE,
|
||||||
Usb::ENDPOINT_COUNT,
|
Usb::ENDPOINT_COUNT,
|
||||||
setup_late_cnak,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user