Comments (6)
There is a check on BOTH UART and I2C begin disabled during compile to cause an error message, but indeed only in that situation it could happen. The compiler s pre-processor is in error in it should handle the #if defined rules correctly and include and exclude the right code as a result. But there is always a work-around :-)
regards
Paul
from sps30.
I have added return(0xff);
after line 763 in sps30.cpp, which fixes the compiler error. I'm not sure if this is the most appropriate error code to use?
from sps30.
HI Dave
I have just tried this on Arduino IDE and commenting out #define INCLUDE_UART 1 does not cause an error. I looked that the code. Actually, this must be a compiler error. The I2C code is returning an error if not successful (unless you disabled I2C also ..) and the compiler should notice that. I know of others that use the SPS30 code , but never heard about this problem. What you could try instead of satisfying the compiler with a fake return, is to comment out the last lines in the subroutine that are handling the UART. Just to see what happens
from sps30.
Hi Paul
Yes, commenting out the lines that handle the UART also works.
I think the complier error may result from a change in version 2.2.0 of the Particle device os (see particle-iot/device-os#2323).
My C++ skills are not sufficient to determine whether this is a genuine issue with your code, or in the Particle implementation.
from sps30.
I'm guessing that the error results from the fact that no value is returned under the theoretically possible condition that UART is disabled and if (_Sensor_Comms == I2C_COMMS)
is FALSE at line 735. I accept that this condition can't arise in practise if we're using i2c comms, but the compiler doesn't know that.
Happy to be corrected if I've misunderstood.
from sps30.
closed
from sps30.
Related Issues (20)
- Example 6 SPS30 HOT 1
- SPS_DEBUGSERIAL_SODAQ Error HOT 2
- Please support NANO 33 IOT board. HOT 1
- Setting up serialport2 TX and RX HOT 5
- I2C Wake-up does not work HOT 1
- ByteToFloat HOT 2
- Hard reset? HOT 13
- CRC error when reading version info HOT 4
- Further check possible when reading values; avoids bad data HOT 1
- Replacement Connector Found! HOT 5
- PM1.0 measure over i2c sometimes give 0 HOT 4
- i2c speed recommendation HOT 2
- SPS not running Uart HOT 34
- Example5_sps30_bme280_BasicReadings HOT 1
- Error reading sps30. HOT 4
- Example scd30 sps30 basic reading not compiling HOT 2
- ERR_OK and ERR_TIMEOUT overwrite framework definitions HOT 6
- 'ERR_DATALENGTH' 'ERR_OK' not declared HOT 8
- Support for ESP32C3 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sps30.