From 99c48bb8bd9b7ddc13fc541dadd9439137c04f6a Mon Sep 17 00:00:00 2001 From: Kirill Mikhailov Date: Mon, 24 Jul 2023 16:08:20 +0200 Subject: [PATCH] Code cleaning, getting rid of useless generic argument Typo fix --- esp-hal-common/src/usb_serial_jtag.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/esp-hal-common/src/usb_serial_jtag.rs b/esp-hal-common/src/usb_serial_jtag.rs index 94f32595947..15f90db8765 100644 --- a/esp-hal-common/src/usb_serial_jtag.rs +++ b/esp-hal-common/src/usb_serial_jtag.rs @@ -202,12 +202,12 @@ pub trait Instance { } fn txfifo_empty(&self) -> bool { - !self + self .register_block() .jfifo_st .read() .out_fifo_empty() - .bit_is_set() + .bit_is_clear() } } @@ -280,12 +280,12 @@ mod asynch { // Single static instance of the waker static WAKER: AtomicWaker = AtomicWaker::new(); - pub(crate) struct UsbSerialJtagFuture<'d, T> { - instance: &'d T, + pub(crate) struct UsbSerialJtagFuture<'d> { + instance: &'d crate::peripherals::USB_DEVICE, } - impl<'d, T: Instance> UsbSerialJtagFuture<'d, T> { - pub fn new(instance: &'d T) -> Self { + impl<'d> UsbSerialJtagFuture<'d> { + pub fn new(instance: &'d crate::peripherals::USB_DEVICE) -> Self { // Set the interrupt enable bit for the USB_SERIAL_JTAG_SERIAL_IN_EMPTY_INT // interrupt instance @@ -306,7 +306,7 @@ mod asynch { } } - impl<'d, T: Instance> core::future::Future for UsbSerialJtagFuture<'d, T> { + impl<'d> core::future::Future for UsbSerialJtagFuture<'d> { type Output = (); fn poll( @@ -365,7 +365,7 @@ mod asynch { WAKER.wake(); } - #[cfg(esp32s3)] // TODO doesn't work now, issue is created + #[cfg(esp32s3)] #[interrupt] fn USB_DEVICE() { let usb_serial_jtag = unsafe { &*crate::peripherals::USB_DEVICE::ptr() };