Skip to content

Commit 8da3507

Browse files
committed
unfortunately this code does not work with rp2040
until I find a way to make it compatible, it is disabled when compling for rp2040. Problem is that SPIClass and SPISettings are not defined, SPI seems to work somewhat differently in rp2040
1 parent 1fa5dd7 commit 8da3507

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/sensors/MagneticSensorSPI.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#ifndef TARGET_RP2040
2+
13
#include "MagneticSensorSPI.h"
24

35
/** Typical configuration for the 14bit AMS AS5147 magnetic sensor over SPI interface */
@@ -212,3 +214,6 @@ word MagneticSensorSPI::read(word angle_register){
212214
void MagneticSensorSPI::close(){
213215
spi->end();
214216
}
217+
218+
219+
#endif

src/sensors/MagneticSensorSPI.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef MAGNETICSENSORSPI_LIB_H
22
#define MAGNETICSENSORSPI_LIB_H
33

4+
#ifndef TARGET_RP2040
5+
46
#include "Arduino.h"
57
#include <SPI.h>
68
#include "../common/base_classes/Sensor.h"
@@ -91,3 +93,4 @@ class MagneticSensorSPI: public Sensor{
9193

9294

9395
#endif
96+
#endif

0 commit comments

Comments
 (0)