Skip to content

Commit 04eea67

Browse files
authored
Merge pull request #3 from sparkfun/ESP32_v2.0.4_Fixes
Esp32 v2.0.4 fixes
2 parents 8b80d2f + c220f96 commit 04eea67

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

src/sfe_bus.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ bool SfeSPI::init(uint8_t cs, bool bInit)
251251
{
252252

253253
//If the transaction settings are not provided by the user they are built here.
254-
SPISettings spiSettings = SPISettings(3000000, LSBFIRST, SPI_MODE3);
254+
SPISettings spiSettings = SPISettings(3000000, MSBFIRST, SPI_MODE3);
255255

256256
//In addition of the port is not provided by the user, it defaults to SPI here.
257257
return init(SPI, spiSettings, cs, bInit);
@@ -346,7 +346,7 @@ int SfeSPI::readRegisterRegion(uint8_t addr, uint8_t reg, uint8_t *data, uint16_
346346
_spiPort->beginTransaction(_sfeSPISettings);
347347
// Signal communication start
348348
digitalWrite(_cs, LOW);
349-
// A leading zero must be added to transfer with register to indicate a "read"
349+
// A leading "1" must be added to transfer with register to indicate a "read"
350350
reg = (reg | SPI_READ);
351351
_spiPort->transfer(reg);
352352

src/sfe_ism330dhcx.cpp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,7 @@ uint8_t QwDevISM330DHCX::getBlockDataUpdate()
664664
uint8_t tempVal;
665665
int32_t retVal = ism330dhcx_block_data_update_get(&sfe_dev, &tempVal);
666666

667+
(void)retVal;
667668
return tempVal;
668669
}
669670

@@ -1346,14 +1347,7 @@ bool QwDevISM330DHCX::getExternalSensorNack(uint8_t sensor)
13461347

13471348
bool QwDevISM330DHCX::readMMCMagnetometer(uint8_t* magData, uint8_t len)
13481349
{
1349-
int32_t retVal;
1350-
1351-
readPeripheralSensor(magData, len);
1352-
1353-
if( retVal != 0 )
1354-
return false;
1355-
1356-
return true;
1350+
return(readPeripheralSensor(magData, len));
13571351
}
13581352

13591353

@@ -1399,10 +1393,9 @@ bool QwDevISM330DHCX::setHubWriteMode(uint8_t config)
13991393
bool QwDevISM330DHCX::setHubPassThrough(bool enable)
14001394
{
14011395

1402-
int32_t retVal;
1403-
ism330dhcx_sh_pass_through_set(&sfe_dev, (uint8_t)enable);
1396+
int32_t retVal = ism330dhcx_sh_pass_through_set(&sfe_dev, (uint8_t)enable);
14041397

1405-
if( retVal != 0 );
1398+
if( retVal != 0 )
14061399
return false;
14071400

14081401
return true;

0 commit comments

Comments
 (0)