aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkbleeke <[email protected]>2023-03-30 12:04:18 +0200
committerkbleeke <[email protected]>2023-03-30 12:04:18 +0200
commitb2d63d851df68effce2c4ef7276139380a496c88 (patch)
tree3994a282807a4d3b80dbf2bab6e9d047e05edeef
parent869b337715c7c784865e6b1a0c26557c4204d35d (diff)
set INTERRUPT_WITH_STATUS flag in attempt to prevent hangs
-rw-r--r--src/bus.rs2
-rw-r--r--src/consts.rs3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/bus.rs b/src/bus.rs
index 65caea8ec..add346b2f 100644
--- a/src/bus.rs
+++ b/src/bus.rs
@@ -74,7 +74,7 @@ where
74 // 32-bit word length, little endian (which is the default endianess). 74 // 32-bit word length, little endian (which is the default endianess).
75 self.write32_swapped( 75 self.write32_swapped(
76 REG_BUS_CTRL, 76 REG_BUS_CTRL,
77 WORD_LENGTH_32 | HIGH_SPEED | INTERRUPT_HIGH | WAKE_UP | STATUS_ENABLE, 77 WORD_LENGTH_32 | HIGH_SPEED | INTERRUPT_HIGH | WAKE_UP | STATUS_ENABLE | INTERRUPT_WITH_STATUS,
78 ) 78 )
79 .await; 79 .await;
80 80
diff --git a/src/consts.rs b/src/consts.rs
index 6ed7feb92..fee2d01ab 100644
--- a/src/consts.rs
+++ b/src/consts.rs
@@ -16,7 +16,8 @@ pub(crate) const WORD_LENGTH_32: u32 = 0x1;
16pub(crate) const HIGH_SPEED: u32 = 0x10; 16pub(crate) const HIGH_SPEED: u32 = 0x10;
17pub(crate) const INTERRUPT_HIGH: u32 = 1 << 5; 17pub(crate) const INTERRUPT_HIGH: u32 = 1 << 5;
18pub(crate) const WAKE_UP: u32 = 1 << 7; 18pub(crate) const WAKE_UP: u32 = 1 << 7;
19pub(crate) const STATUS_ENABLE: u32 = 0x10000; 19pub(crate) const STATUS_ENABLE: u32 = 1 << 16;
20pub(crate) const INTERRUPT_WITH_STATUS: u32 = 1 << 17;
20 21
21// SPI_STATUS_REGISTER bits 22// SPI_STATUS_REGISTER bits
22pub(crate) const STATUS_DATA_NOT_AVAILABLE: u32 = 0x00000001; 23pub(crate) const STATUS_DATA_NOT_AVAILABLE: u32 = 0x00000001;