void baro_periodic(void) { // Baro is slave of the MPU, only start reading it after MPU is configured if (imu_apogee.mpu.config.initialized) { if (startup_cnt > 0 && apogee_baro.data_available) { // Run some loops to get correct readings from the adc --startup_cnt; apogee_baro.data_available = false; #ifdef BARO_LED LED_TOGGLE(BARO_LED); if (startup_cnt == 0) { LED_ON(BARO_LED); } #endif } // Read the sensor RunOnceEvery(MPL_PRESCALER, mpl3115_periodic(&apogee_baro)); } }
void baro_mpl3115_read_periodic(void) { mpl3115_periodic(&baro_mpl); }