Merge branch 'thelsing-master' into memory_rework

This commit is contained in:
Bernhard Filzmaier 2019-10-10 11:33:05 +02:00
commit aa8110f4fb
2 changed files with 56 additions and 36 deletions

View File

@ -1,4 +1,5 @@
// used version: BSEC_1.4.7.3_Generic_Release_20190410
// 2 changes needed for version: BSEC_1.4.7.4_Generic_Release see below
#include <bsec.h>
#include <knx.h>
#ifdef ARDUINO_ARCH_ESP8266
@ -111,7 +112,7 @@ void setup(void)
iaqSensor.updateSubscription(sensorList, sizeof(sensorList)/sizeof(bsec_virtual_sensor_t), BSEC_SAMPLE_RATE_LP);
checkIaqSensorStatus();
String output = "Timestamp [ms], raw temperature [°C], pressure [hPa], raw relative humidity [%], gas [Ohm], IAQ, IAQ accuracy, temperature [°C], relative humidity [%], CO2";
String output = "Timestamp [ms], raw temperature [°C], temperature[°C], pressure [hPa], raw relative humidity [%], humidity [%], gas [Ohm], IAQ, IAQ accuracy, CO2, CO2 Accuracy, breathVocEquivalent, breathVocAccuracy, compGasValue, compGas Accuracy, gasPercentage, gasPercentage Accuracy, staticIAQ, staticIAQ Accuracy, runInStatus, stabStatus";
Serial.println(output);
}
@ -135,7 +136,7 @@ void loop(void)
output += ", " + String(iaqSensor.rawHumidity);
output += ", " + String(iaqSensor.humidity);
output += ", " + String(iaqSensor.gasResistance);
output += ", " + String(iaqSensor.iaq);
output += ", " + String(iaqSensor.iaq); //.iaqEstimate for BSEC_1.4.7.4
output += ", " + String(iaqSensor.iaqAccuracy);
output += ", " + String(iaqSensor.co2Equivalent);
output += ", " + String(iaqSensor.co2Accuracy);
@ -143,8 +144,8 @@ void loop(void)
output += ", " + String(iaqSensor.breathVocAccuracy);
output += ", " + String(iaqSensor.compGasValue);
output += ", " + String(iaqSensor.compGasAccuracy);
output += ", " + String(iaqSensor.gasPercentageAcccuracy);
output += ", " + String(iaqSensor.gasPercentage);
output += ", " + String(iaqSensor.gasPercentageAcccuracy);
output += ", " + String(iaqSensor.staticIaq);
output += ", " + String(iaqSensor.staticIaqAccuracy);
output += ", " + String(iaqSensor.runInStatus);
@ -162,7 +163,7 @@ void loop(void)
goPressure.value(iaqSensor.pressure);
goRawHumidity.value(iaqSensor.rawHumidity);
goGasResistance.value(iaqSensor.gasResistance);
goIaqEstimate.value(iaqSensor.iaq);
goIaqEstimate.value(iaqSensor.iaq); //.iaqEstimate for BSEC_1.4.7.4
goIaqAccurace.value(iaqSensor.iaqAccuracy);
goTemperature.value(iaqSensor.temperature);
goHumidity.value(iaqSensor.humidity);

View File

@ -110,6 +110,24 @@ template <class P, class B> class KnxFacade : private SaveRestore
_ledPin = value;
}
/**
* returns RISING if interrupt is created in a rising signal, FALLING otherwise
*/
uint32_t buttonPinInterruptOn()
{
return _buttonPinInterruptOn;
}
/**
* Sets if the programming button creates a RISING or a FALLING signal.
*
* Set to RISING for GPIO--BUTTON--VDD or to FALLING for GPIO--BUTTON--GND
*/
void buttonPinInterruptOn(uint32_t value)
{
_buttonPinInterruptOn = value;
}
uint32_t buttonPin()
{
return _buttonPin;
@ -192,7 +210,7 @@ template <class P, class B> class KnxFacade : private SaveRestore
pinMode(_buttonPin, INPUT_PULLUP);
attachInterrupt(_buttonPin, buttonUp, RISING);
attachInterrupt(_buttonPin, buttonUp, _buttonPinInterruptOn);
enabled(true);
}
@ -252,8 +270,9 @@ template <class P, class B> class KnxFacade : private SaveRestore
P* _platformPtr = 0;
B* _bauPtr = 0;
B& _bau;
uint32_t _ledPinActiveOn = LOW;
uint32_t _ledPinActiveOn = LOW;
uint32_t _ledPin = LED_BUILTIN;
uint32_t _buttonPinInterruptOn = RISING;
uint32_t _buttonPin = 0;
saveRestoreCallback _saveCallback = 0;
saveRestoreCallback _restoreCallback = 0;