aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2023-08-15 22:47:03 +0200
committerDario Nieuwenhuis <[email protected]>2023-08-15 22:47:58 +0200
commit46f671ae420f27b527edf03756d1da76d86216c7 (patch)
treeff54766c748424a9640aa12244f26735ace02eb2
parent96e0ace89e48cffd073749cc3b08835a0a7d6cc9 (diff)
rp: fix async spi read sometimes hanging.
-rw-r--r--embassy-rp/src/dma.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/embassy-rp/src/dma.rs b/embassy-rp/src/dma.rs
index c8f741804..45ca21a75 100644
--- a/embassy-rp/src/dma.rs
+++ b/embassy-rp/src/dma.rs
@@ -76,7 +76,8 @@ pub unsafe fn write<'a, C: Channel, W: Word>(
76 ) 76 )
77} 77}
78 78
79static DUMMY: u32 = 0; 79// static mut so that this is allocated in RAM.
80static mut DUMMY: u32 = 0;
80 81
81pub unsafe fn write_repeated<'a, C: Channel, W: Word>( 82pub unsafe fn write_repeated<'a, C: Channel, W: Word>(
82 ch: impl Peripheral<P = C> + 'a, 83 ch: impl Peripheral<P = C> + 'a,
@@ -86,7 +87,7 @@ pub unsafe fn write_repeated<'a, C: Channel, W: Word>(
86) -> Transfer<'a, C> { 87) -> Transfer<'a, C> {
87 copy_inner( 88 copy_inner(
88 ch, 89 ch,
89 &DUMMY as *const u32, 90 &mut DUMMY as *const u32,
90 to as *mut u32, 91 to as *mut u32,
91 len, 92 len,
92 W::size(), 93 W::size(),