Skip to content
Snippets Groups Projects
Commit 9e807b8d authored by schneider's avatar schneider
Browse files

feat(bsec): add option to set a static temperature offset

parent ca0a9e0d
Branches
No related tags found
No related merge requests found
...@@ -60,4 +60,6 @@ Option name Type Description ...@@ -60,4 +60,6 @@ Option name Type Description
``bsec_enable`` Boolean Activate the Bosch :ref:`BSEC` binary blob to compute an Indoor Air Quality indication. ``bsec_enable`` Boolean Activate the Bosch :ref:`BSEC` binary blob to compute an Indoor Air Quality indication.
------------------ ---------- ----------- ------------------ ---------- -----------
``bsec_debug`` Boolean Turn on debug output of the BSEC system. Prints each meaurement on the console. ``bsec_debug`` Boolean Turn on debug output of the BSEC system. Prints each meaurement on the console.
------------------ ---------- -----------
``bsec_offset`` Integer Temperature offset in .1 K. Example: Set to `-14` if temperature reads 1.4 "C" to high.
================== ========== =========== ================== ========== ===========
...@@ -363,8 +363,6 @@ int bsec_activate(void) ...@@ -363,8 +363,6 @@ int bsec_activate(void)
float sample_rate = BSEC_SAMPLE_RATE_LP; float sample_rate = BSEC_SAMPLE_RATE_LP;
#endif #endif
float temperature_offset = 0.0;
bool bsec_enabled = bool bsec_enabled =
config_get_boolean_with_default("bsec_enabled", false); config_get_boolean_with_default("bsec_enabled", false);
if (!bsec_enabled) { if (!bsec_enabled) {
...@@ -372,10 +370,18 @@ int bsec_activate(void) ...@@ -372,10 +370,18 @@ int bsec_activate(void)
} }
debug = config_get_boolean_with_default("bsec_debug", false); debug = config_get_boolean_with_default("bsec_debug", false);
float temperature_offset =
config_get_integer_with_default("bsec_offset", 0) / 10.;
if (temperature_offset != 0.0) {
printf("BSEC Temp offset %d/10 K\n",
(int)(temperature_offset * 10));
}
/* Puts AT LEAST 2 * #BSEC_MAX_PROPERTY_BLOB_SIZE = 2 * 454 = 908 bytes onto the stack */ /* Puts AT LEAST 2 * #BSEC_MAX_PROPERTY_BLOB_SIZE = 2 * 454 = 908 bytes onto the stack */
ret = bsec_iot_init( ret = bsec_iot_init(
sample_rate, sample_rate,
temperature_offset, -temperature_offset,
i2c_write, i2c_write,
i2c_read, i2c_read,
delay, delay,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment