stm32: fix usb
This commit is contained in:
parent
dea09876e0
commit
7cb46ac720
@ -17,11 +17,11 @@ use embassy::time::{Duration, Timer};
|
|||||||
use embassy::util::Forever;
|
use embassy::util::Forever;
|
||||||
use embassy_extras::usb::usb_serial::UsbSerial;
|
use embassy_extras::usb::usb_serial::UsbSerial;
|
||||||
use embassy_extras::usb::Usb;
|
use embassy_extras::usb::Usb;
|
||||||
|
use embassy_stm32::hal::otg_fs::{UsbBus, USB};
|
||||||
|
use embassy_stm32::hal::prelude::*;
|
||||||
use embassy_stm32::{interrupt, pac, rtc};
|
use embassy_stm32::{interrupt, pac, rtc};
|
||||||
use futures::future::{select, Either};
|
use futures::future::{select, Either};
|
||||||
use futures::pin_mut;
|
use futures::pin_mut;
|
||||||
use stm32f4xx_hal::otg_fs::{UsbBus, USB};
|
|
||||||
use stm32f4xx_hal::prelude::*;
|
|
||||||
use usb_device::bus::UsbBusAllocator;
|
use usb_device::bus::UsbBusAllocator;
|
||||||
use usb_device::prelude::*;
|
use usb_device::prelude::*;
|
||||||
|
|
||||||
|
@ -46,6 +46,6 @@ embedded-hal = { version = "0.2.4" }
|
|||||||
embedded-dma = { version = "0.1.2" }
|
embedded-dma = { version = "0.1.2" }
|
||||||
bxcan = "0.5.0"
|
bxcan = "0.5.0"
|
||||||
nb = "*"
|
nb = "*"
|
||||||
stm32f4xx-hal = { version = "0.9.0", features = ["rt", "can"], optional = true }
|
stm32f4xx-hal = { version = "0.9.0", features = ["rt", "can", "usb_fs"], optional = true }
|
||||||
stm32l0xx-hal = { version = "0.7.0", features = ["rt"], optional = true }
|
stm32l0xx-hal = { version = "0.7.0", features = ["rt"], optional = true }
|
||||||
futures = { version = "0.3.5", default-features = false, features = ["async-await"] }
|
futures = { version = "0.3.5", default-features = false, features = ["async-await"] }
|
@ -1,8 +1,8 @@
|
|||||||
|
use crate::hal::bb;
|
||||||
|
use crate::hal::rcc::Clocks;
|
||||||
use core::cell::Cell;
|
use core::cell::Cell;
|
||||||
use core::convert::TryInto;
|
use core::convert::TryInto;
|
||||||
use core::sync::atomic::{compiler_fence, AtomicU32, Ordering};
|
use core::sync::atomic::{compiler_fence, AtomicU32, Ordering};
|
||||||
use stm32f4xx_hal::bb;
|
|
||||||
use stm32f4xx_hal::rcc::Clocks;
|
|
||||||
|
|
||||||
use embassy::interrupt::InterruptExt;
|
use embassy::interrupt::InterruptExt;
|
||||||
use embassy::time::{Clock, TICKS_PER_SECOND};
|
use embassy::time::{Clock, TICKS_PER_SECOND};
|
||||||
@ -259,7 +259,7 @@ macro_rules! impl_timer {
|
|||||||
($module:ident: ($TYPE:ident, $INT:ident, $apbenr:ident, $enrbit:expr, $apbrstr:ident, $rstrbit:expr, $ppre:ident, $pclk: ident), 3) => {
|
($module:ident: ($TYPE:ident, $INT:ident, $apbenr:ident, $enrbit:expr, $apbrstr:ident, $rstrbit:expr, $ppre:ident, $pclk: ident), 3) => {
|
||||||
mod $module {
|
mod $module {
|
||||||
use super::*;
|
use super::*;
|
||||||
use stm32f4xx_hal::pac::{$TYPE, RCC};
|
use crate::hal::pac::{$TYPE, RCC};
|
||||||
|
|
||||||
impl sealed::Sealed for $TYPE {}
|
impl sealed::Sealed for $TYPE {}
|
||||||
|
|
||||||
@ -376,7 +376,7 @@ macro_rules! impl_timer {
|
|||||||
($module:ident: ($TYPE:ident, $INT:ident, $apbenr:ident, $enrbit:expr, $apbrstr:ident, $rstrbit:expr, $ppre:ident, $pclk: ident), 1) => {
|
($module:ident: ($TYPE:ident, $INT:ident, $apbenr:ident, $enrbit:expr, $apbrstr:ident, $rstrbit:expr, $ppre:ident, $pclk: ident), 1) => {
|
||||||
mod $module {
|
mod $module {
|
||||||
use super::*;
|
use super::*;
|
||||||
use stm32f4xx_hal::pac::{$TYPE, RCC};
|
use crate::hal::pac::{$TYPE, RCC};
|
||||||
|
|
||||||
impl sealed::Sealed for $TYPE {}
|
impl sealed::Sealed for $TYPE {}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user