Skip to content

Commit 50b158a

Browse files
authored
Add guard for the I2C use case
Signed-off-by: Carlo Parata <carlo.parata@st.com>
1 parent c05cb61 commit 50b158a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/rfal_rfst25r3916.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ ReturnCode RfalRfST25R3916Class::rfalInitialize(void)
7171
{
7272
ReturnCode err;
7373

74-
pinMode(cs_pin, OUTPUT);
75-
digitalWrite(cs_pin, HIGH);
74+
if (i2c_enabled == false) {
75+
pinMode(cs_pin, OUTPUT);
76+
digitalWrite(cs_pin, HIGH);
77+
}
7678

7779
pinMode(int_pin, INPUT);
7880
Callback<void()>::func = std::bind(&RfalRfST25R3916Class::st25r3916Isr, this);

0 commit comments

Comments
 (0)