Skip to content

Commit ad1b645

Browse files
authored
Don't register waker if the DMA is done (#3045)
* Don't register waker if the DMA is done * Update embassy-executor in HIL tests
1 parent fbca764 commit ad1b645

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

esp-hal/src/dma/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2938,7 +2938,6 @@ pub(crate) mod asynch {
29382938
self: core::pin::Pin<&mut Self>,
29392939
cx: &mut core::task::Context<'_>,
29402940
) -> Poll<Self::Output> {
2941-
self.tx.waker().register(cx.waker());
29422941
if self.tx.is_done() {
29432942
self.tx.clear_interrupts();
29442943
Poll::Ready(Ok(()))
@@ -2950,6 +2949,7 @@ pub(crate) mod asynch {
29502949
self.tx.clear_interrupts();
29512950
Poll::Ready(Err(DmaError::DescriptorError))
29522951
} else {
2952+
self.tx.waker().register(cx.waker());
29532953
self.tx
29542954
.listen_out(DmaTxInterrupt::TotalEof | DmaTxInterrupt::DescriptorError);
29552955
Poll::Pending
@@ -2994,7 +2994,6 @@ pub(crate) mod asynch {
29942994
self: core::pin::Pin<&mut Self>,
29952995
cx: &mut core::task::Context<'_>,
29962996
) -> Poll<Self::Output> {
2997-
self.rx.waker().register(cx.waker());
29982997
if self.rx.is_done() {
29992998
self.rx.clear_interrupts();
30002999
Poll::Ready(Ok(()))
@@ -3006,6 +3005,7 @@ pub(crate) mod asynch {
30063005
self.rx.clear_interrupts();
30073006
Poll::Ready(Err(DmaError::DescriptorError))
30083007
} else {
3008+
self.rx.waker().register(cx.waker());
30093009
self.rx.listen_in(
30103010
DmaRxInterrupt::SuccessfulEof
30113011
| DmaRxInterrupt::DescriptorError
@@ -3060,7 +3060,6 @@ pub(crate) mod asynch {
30603060
self: core::pin::Pin<&mut Self>,
30613061
cx: &mut core::task::Context<'_>,
30623062
) -> Poll<Self::Output> {
3063-
self.tx.waker().register(cx.waker());
30643063
if self
30653064
.tx
30663065
.pending_out_interrupts()
@@ -3076,6 +3075,7 @@ pub(crate) mod asynch {
30763075
self.tx.clear_interrupts();
30773076
Poll::Ready(Err(DmaError::DescriptorError))
30783077
} else {
3078+
self.tx.waker().register(cx.waker());
30793079
self.tx
30803080
.listen_out(DmaTxInterrupt::Done | DmaTxInterrupt::DescriptorError);
30813081
Poll::Pending
@@ -3124,7 +3124,6 @@ pub(crate) mod asynch {
31243124
self: core::pin::Pin<&mut Self>,
31253125
cx: &mut core::task::Context<'_>,
31263126
) -> Poll<Self::Output> {
3127-
self.rx.waker().register(cx.waker());
31283127
if self
31293128
.rx
31303129
.pending_in_interrupts()
@@ -3140,6 +3139,7 @@ pub(crate) mod asynch {
31403139
self.rx.clear_interrupts();
31413140
Poll::Ready(Err(DmaError::DescriptorError))
31423141
} else {
3142+
self.rx.waker().register(cx.waker());
31433143
self.rx.listen_in(
31443144
DmaRxInterrupt::Done
31453145
| DmaRxInterrupt::DescriptorError

esp-hal/src/lcd_cam/lcd/i8080.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -502,14 +502,14 @@ impl<BUF: DmaTxBuffer> I8080Transfer<'_, BUF, crate::Async> {
502502
type Output = ();
503503

504504
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
505-
LCD_DONE_WAKER.register(cx.waker());
506505
if Instance::is_lcd_done_set() {
507506
// Interrupt bit will be cleared in Self::wait.
508507
// This allows `wait_for_done` to be called more than once.
509508
//
510509
// Instance::clear_lcd_done();
511510
Poll::Ready(())
512511
} else {
512+
LCD_DONE_WAKER.register(cx.waker());
513513
Instance::listen_lcd_done();
514514
Poll::Pending
515515
}

hil-test/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ cfg-if = "1.0.0"
201201
critical-section = "1.1.3"
202202
defmt = "0.3.8"
203203
defmt-rtt = { version = "0.4.1", optional = true }
204-
embassy-executor = "0.6.0"
204+
embassy-executor = "0.7.0"
205205
embassy-futures = "0.1.1"
206206
embassy-sync = "0.6.0"
207207
embassy-time = "0.4.0"

0 commit comments

Comments
 (0)