diff --git a/epicardium/modules/bme680.c b/epicardium/modules/bme680.c index 8cda3a6e28d52a3dfa92aa33796ae91cb77f25d3..31d925bd2f8f2792115595e5b867134fc3a64eb2 100644 --- a/epicardium/modules/bme680.c +++ b/epicardium/modules/bme680.c @@ -104,6 +104,13 @@ err: int epic_bme680_deinit() { + /* This is an intentional NO OP to keep the BME680 always initialized. + * + * If it configured to foreced mode, there is no energy consumption + * penalty. + */ + +#if 0 if (!initialized) { return 0; } @@ -117,6 +124,7 @@ int epic_bme680_deinit() hwlock_release(HWLOCK_I2C); initialized = false; +#endif return 0; } diff --git a/epicardium/modules/hardware.c b/epicardium/modules/hardware.c index a05c65f38af808b714de9158a71536c77452d482..fb413958ee0e090251e423e3661426c6fe3dfa85 100644 --- a/epicardium/modules/hardware.c +++ b/epicardium/modules/hardware.c @@ -194,6 +194,11 @@ int hardware_early_init(void) max86150_shut_down(); + /* + * BME680 Sensor + */ + epic_bme680_init(); + /* Allow user space to trigger interrupts. * Used for BLE, not sure if needed. */ SCB->CCR |= SCB_CCR_USERSETMPEND_Msk; @@ -276,11 +281,6 @@ int hardware_reset(void) */ epic_bhi160_disable_all_sensors(); - /* - * BME680 Sensor - */ - epic_bme680_deinit(); - epic_max30001_disable_sensor(); epic_max86150_disable_sensor();