Преглед изворни кода

build fix for esp32 (#3)

* fix build for ESP32

* remove tabs
Ivan пре 5 година
родитељ
комит
afce4dea78
1 измењених фајлова са 4 додато и 0 уклоњено
  1. 4 0
      SparkFunLSM6DS3.cpp

+ 4 - 0
SparkFunLSM6DS3.cpp

@@ -75,7 +75,11 @@ status_t LSM6DS3Core::beginCore(void) {
             // Maximum SPI frequency is 10MHz, could divide by 2 here:
             SPI.setClockDivider(SPI_CLOCK_DIV4);
             // Data is read and written MSb first.
+#ifdef ESP32
+            SPI.setBitOrder(SPI_MSBFIRST);
+#else
             SPI.setBitOrder(MSBFIRST);
+#endif
             // Data is captured on rising edge of clock (CPHA = 0)
             // Base value of the clock is HIGH (CPOL = 1)