From b2d63d851df68effce2c4ef7276139380a496c88 Mon Sep 17 00:00:00 2001 From: kbleeke Date: Thu, 30 Mar 2023 12:04:18 +0200 Subject: [PATCH] set INTERRUPT_WITH_STATUS flag in attempt to prevent hangs --- src/bus.rs | 2 +- src/consts.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bus.rs b/src/bus.rs index 65caea8e..add346b2 100644 --- a/src/bus.rs +++ b/src/bus.rs @@ -74,7 +74,7 @@ where // 32-bit word length, little endian (which is the default endianess). self.write32_swapped( REG_BUS_CTRL, - WORD_LENGTH_32 | HIGH_SPEED | INTERRUPT_HIGH | WAKE_UP | STATUS_ENABLE, + WORD_LENGTH_32 | HIGH_SPEED | INTERRUPT_HIGH | WAKE_UP | STATUS_ENABLE | INTERRUPT_WITH_STATUS, ) .await; diff --git a/src/consts.rs b/src/consts.rs index 6ed7feb9..fee2d01a 100644 --- a/src/consts.rs +++ b/src/consts.rs @@ -16,7 +16,8 @@ pub(crate) const WORD_LENGTH_32: u32 = 0x1; pub(crate) const HIGH_SPEED: u32 = 0x10; pub(crate) const INTERRUPT_HIGH: u32 = 1 << 5; pub(crate) const WAKE_UP: u32 = 1 << 7; -pub(crate) const STATUS_ENABLE: u32 = 0x10000; +pub(crate) const STATUS_ENABLE: u32 = 1 << 16; +pub(crate) const INTERRUPT_WITH_STATUS: u32 = 1 << 17; // SPI_STATUS_REGISTER bits pub(crate) const STATUS_DATA_NOT_AVAILABLE: u32 = 0x00000001;