From d66281609b4c593ad07d0eb68a86efbbdb364f23 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 12 Dec 2024 00:49:16 +0100 Subject: [PATCH] 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 --- esp-hal/Cargo.toml | 2 +- esp-hal/src/otg_fs.rs | 17 ----------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/esp-hal/Cargo.toml b/esp-hal/Cargo.toml index 9ff288876..d28f9c221 100644 --- a/esp-hal/Cargo.toml +++ b/esp-hal/Cargo.toml @@ -29,7 +29,7 @@ embassy-embedded-hal = { version = "0.2.0", optional = true } embassy-futures = "0.1.1" embassy-sync = "0.6.1" 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-hal = "1.0.0" embedded-hal-async = "1.0.0" diff --git a/esp-hal/src/otg_fs.rs b/esp-hal/src/otg_fs.rs index 6b680b502..764cb22a6 100644 --- a/esp-hal/src/otg_fs.rs +++ b/esp-hal/src/otg_fs.rs @@ -195,7 +195,6 @@ pub mod asynch { extra_rx_fifo_words: RX_FIFO_EXTRA_SIZE_WORDS, endpoint_count: Usb::ENDPOINT_COUNT, phy_type: PhyType::InternalFullSpeed, - quirk_setup_late_cnak: quirk_setup_late_cnak(), calculate_trdt_fn: |_| 5, }; 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::() - .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())] fn interrupt_handler() { - let setup_late_cnak = quirk_setup_late_cnak(); - unsafe { on_interrupt( Driver::REGISTERS, &STATE, Usb::ENDPOINT_COUNT, - setup_late_cnak, ) } }