Home | History | Annotate | Download | only in bosch_bmp280

Lines Matching refs:mTask

127 } mTask;
179 for (i = 0; i < ARRAY_SIZE(mTask.transfers); i++) {
180 if (!mTask.transfers[i].inUse) {
181 mTask.transfers[i].inUse = true;
182 mTask.transfers[i].state = state;
183 return &mTask.transfers[i];
219 *evPtr = slabAllocatorAlloc(mTask.evtSlab);
237 slabAllocatorFree(mTask.evtSlab, ptr);
250 osEnqueuePrivateEvt(EVT_SENSOR_I2C, cookie, NULL, mTask.id);
257 osEnqueuePrivateEvt(EVT_SENSOR_BARO_TIMER, cookie, NULL, mTask.id);
262 osEnqueuePrivateEvt(EVT_SENSOR_TEMP_TIMER, cookie, NULL, mTask.id);
292 bool oldMode = mTask.baroOn || mTask.tempOn;
293 bool newMode = on || mTask.tempOn;
295 if (!on && mTask.baroTimerHandle) {
296 timTimerCancel(mTask.baroTimerHandle);
297 mTask.baroTimerHandle = 0;
298 mTask.baroReading = false;
304 sensorSignalInternalEvt(mTask.baroHandle, SENSOR_INTERNAL_EVT_POWER_STATE_CHG, on, 0);
306 mTask.baroOn = on;
313 return sensorSignalInternalEvt(mTask.baroHandle, SENSOR_INTERNAL_EVT_FW_STATE_CHG, 1, 0);
318 if (mTask.baroTimerHandle)
319 timTimerCancel(mTask.baroTimerHandle);
320 mTask.baroTimerHandle = timTimerSet(sensorTimerLookupCommon(baroSupportedRates, rateTimerValsBaro, rate), 0, 50, baroTimerCallback, NULL, false);
321 return sensorSignalInternalEvt(mTask.baroHandle, SENSOR_INTERNAL_EVT_RATE_CHG, rate, latency);
331 if (mTask.baroOn || mTask.tempOn) {
337 if (mTask.baroTimerHandle)
338 timTimerCancel(mTask.baroTimerHandle);
339 mTask.baroTimerHandle = timTimerSet(100000000ull, 0, 50, baroTimerCallback, NULL, false);
341 mTask.offset = 0.0f;
342 mTask.baroOn = true;
343 mTask.baroCalibrating = true;
350 mTask.offset = *((float*)data) * 100.0f; // offset is given in hPa, but used as Pa in compensation
356 bool oldMode = mTask.baroOn || mTask.tempOn;
357 bool newMode = on || mTask.baroOn;
359 if (!on && mTask.tempTimerHandle) {
360 timTimerCancel(mTask.tempTimerHandle);
361 mTask.tempTimerHandle = 0;
362 mTask.tempReading = false;
368 sensorSignalInternalEvt(mTask.tempHandle, SENSOR_INTERNAL_EVT_POWER_STATE_CHG, on, 0);
370 mTask.tempOn = on;
377 sensorSignalInternalEvt(mTask.tempHandle, SENSOR_INTERNAL_EVT_FW_STATE_CHG, 1, 0);
383 if (mTask.tempTimerHandle)
384 timTimerCancel(mTask.tempTimerHandle);
385 mTask.tempTimerHandle = timTimerSet(sensorTimerLookupCommon(tempSupportedRates, rateTimerValsTemp, rate), 0, 50, tempTimerCallback, NULL, false);
386 sensorSignalInternalEvt(mTask.tempHandle, SENSOR_INTERNAL_EVT_RATE_CHG, rate, latency);
437 (((adc_T >> 3) - ((int32_t)mTask.comp.dig_T1 << 1))
438 * (int32_t)mTask.comp.dig_T2) >> 11;
440 int32_t tmp = (adc_T >> 4) - (int32_t)mTask.comp.dig_T1;
442 int32_t var2 = (((tmp * tmp) >> 12) * (int32_t)mTask.comp.dig_T3) >> 14;
457 v2 = fSqr * mTask.comp.dig_P6 + f * mTask.comp.dig_P5 * (float)(1ULL << 17) + mTask.comp.dig_P4 * (float)(1ULL << 35);
458 v1 = fSqr * mTask.comp.dig_P1 * mTask.comp.dig_P3 * (1.0f/(1ULL << 41)) + f * mTask.comp.dig_P1 * mTask.comp.dig_P2 * (1.0f/(1ULL << 21)) + mTask.comp.dig_P1 * (float)(1ULL << 14);
463 return pSqr * mTask.comp.dig_P9 * (1.0f/(1ULL << 59)) + p * (mTask.comp.dig_P8 * (1.0f/(1ULL << 19)) + 1) * (1.0f/(1ULL << 8)) + 16.0f * mTask.comp.dig_P7;
476 *pressure_Pa = pres * (1.0f / 256.0f) + mTask.offset;
509 ret = i2cMasterTxRx(I2C_BUS_ID, I2C_ADDR, newXfer->txrxBuf, 1, (uint8_t*)&mTask.comp, 24, i2cCallback, newXfer);
528 sensorSignalInternalEvt(mTask.baroHandle, SENSOR_INTERNAL_EVT_POWER_STATE_CHG, true, 0);
533 sensorSignalInternalEvt(mTask.tempHandle, SENSOR_INTERNAL_EVT_POWER_STATE_CHG, true, 0);
538 sensorSignalInternalEvt(mTask.baroHandle, SENSOR_INTERNAL_EVT_POWER_STATE_CHG, false, 0);
543 sensorSignalInternalEvt(mTask.tempHandle, SENSOR_INTERNAL_EVT_POWER_STATE_CHG, false, 0);
549 sensorRegisterInitComplete(mTask.baroHandle);
550 sensorRegisterInitComplete(mTask.tempHandle);
558 if (mTask.baroOn && mTask.baroReading) {
559 if (mTask.baroCalibrating) {
562 if (mTask.baroTimerHandle)
563 timTimerCancel(mTask.baroTimerHandle);
565 mTask.baroOn = false;
566 mTask.baroCalibrating = false;
578 if (mTask.tempOn && mTask.tempReading) {
583 mTask.baroReading = false;
584 mTask.tempReading = false;
604 osEventUnsubscribe(mTask.id, EVT_APP_START);
621 if (!mTask.baroReading && !mTask.tempReading) {
631 mTask.baroReading = true;
638 if (!mTask.baroReading && !mTask.tempReading) {
648 mTask.tempReading = true;
656 mTask.id = taskId;
657 mTask.offset = 0.0f;
660 mTask.baroHandle = sensorRegister(&sensorInfoBaro, &sensorOpsBaro, NULL, false);
661 mTask.tempHandle = sensorRegister(&sensorInfoTemp, &sensorOpsTemp, NULL, false);
663 mTask.evtSlab = slabAllocatorNew(sizeof(struct SingleAxisDataEvent) + sizeof(struct SingleAxisDataPoint), 4, MAX_BARO_EVENTS);
664 if (!mTask.evtSlab) {
676 slabAllocatorDestroy(mTask.evtSlab);