Lines Matching refs:mTask
187 static struct lps22hbTask mTask;
193 ev = *evPtr = slabAllocatorAlloc(mTask.baroSlab);
209 slabAllocatorFree(mTask.baroSlab, ptr);
218 for (i = 0; i < ARRAY_SIZE(mTask.transfers); i++) {
219 if (!mTask.transfers[i].inUse) {
220 mTask.transfers[i].inUse = true;
221 mTask.transfers[i].state = state;
222 return &mTask.transfers[i];
243 osEnqueuePrivateEvt(EVT_COMM_DONE, cookie, NULL, mTask.tid);
306 osEnqueuePrivateEvt(EVT_SENSOR_BARO_TIMER, data, NULL, mTask.tid);
311 osEnqueuePrivateEvt(EVT_SENSOR_TEMP_TIMER, data, NULL, mTask.tid);
353 bool oldMode = mTask.baroOn || mTask.tempOn;
354 bool newMode = on || mTask.tempOn;
359 if (!on && mTask.baroTimerHandle) {
360 timTimerCancel(mTask.baroTimerHandle);
361 mTask.baroTimerHandle = 0;
362 mTask.baroReading = false;
367 ret = mTask.comm_tx(LPS22HB_ODR_REG_ADDR, LPS22HB_ODR_10_HZ, 0, state);
369 ret = mTask.comm_tx(LPS22HB_ODR_REG_ADDR, LPS22HB_ODR_ONE_SHOT, 0, state);
371 sensorSignalInternalEvt(mTask.sensors[BARO].handle,
379 mTask.baroReading = false;
380 mTask.baroOn = on;
386 return sensorSignalInternalEvt(mTask.sensors[BARO].handle, SENSOR_INTERNAL_EVT_FW_STATE_CHG, 1, 0);
393 if (mTask.baroTimerHandle)
394 timTimerCancel(mTask.baroTimerHandle);
396 mTask.baroTimerHandle = timTimerSet(sensorTimerLookupCommon(lps22hbRates,
399 return sensorSignalInternalEvt(mTask.sensors[BARO].handle,
412 if (mTask.baroOn) {
418 mTask.comm_tx(LPS22HB_RPDS_L, 0, 0, SENSOR_BARO_START_CAL);
438 mTask.offset_H = (offset >> 8) & 0xff;
439 mTask.offset_L = (offset & 0xff);
441 ret = mTask.comm_tx(LPS22HB_RPDS_L, mTask.offset_L, 0, SENSOR_BARO_SET_OFFSET);
450 bool oldMode = mTask.baroOn || mTask.tempOn;
451 bool newMode = on || mTask.baroOn;
456 if (!on && mTask.tempTimerHandle) {
457 timTimerCancel(mTask.tempTimerHandle);
458 mTask.tempTimerHandle = 0;
459 mTask.tempReading = false;
464 ret = mTask.comm_tx(LPS22HB_ODR_REG_ADDR, LPS22HB_ODR_10_HZ, 0, state);
466 ret = mTask.comm_tx(LPS22HB_ODR_REG_ADDR, LPS22HB_ODR_ONE_SHOT, 0, state);
468 sensorSignalInternalEvt(mTask.sensors[TEMP].handle,
476 mTask.tempReading = false;
477 mTask.tempOn = on;
483 return sensorSignalInternalEvt(mTask.sensors[TEMP].handle, SENSOR_INTERNAL_EVT_FW_STATE_CHG, 1, 0);
488 if (mTask.tempTimerHandle)
489 timTimerCancel(mTask.tempTimerHandle);
492 mTask.tempTimerHandle = timTimerSet(sensorTimerLookupCommon(lps22hbRates,
495 return sensorSignalInternalEvt(mTask.sensors[TEMP].handle,
531 if (!mTask.comm_rx(LPS22HB_WAI_REG_ADDR, 1, 1, SENSOR_VERIFY_ID)) {
547 sensorRegisterInitComplete(mTask.sensors[i].handle);
550 //osEnqueuePrivateEvt(EVT_TEST, NULL, NULL, mTask.tid);
554 sensorSignalInternalEvt(mTask.sensors[BARO].handle,
559 sensorSignalInternalEvt(mTask.sensors[BARO].handle,
564 sensorSignalInternalEvt(mTask.sensors[TEMP].handle,
569 sensorSignalInternalEvt(mTask.sensors[TEMP].handle,
574 mTask
578 mTask.comm_rx(LPS22HB_PRESS_OUTXL_REG_ADDR, 3, 1, SENSOR_BARO_CAL_DONE);
591 mTask.comm_tx(LPS22HB_RPDS_H, mTask.offset_H, 0, SENSOR_BARO_CFG_DONE);
598 if (mTask.baroOn && mTask.baroWantRead) {
601 mTask.baroWantRead = false;
607 mTask.baroReading = false;
615 if (mTask.tempOn && mTask.tempWantRead) {
616 mTask.tempWantRead = false;
621 mTask.tempReading = false;
642 osEventUnsubscribe(mTask.tid, EVT_APP_START);
644 mTask.comm_tx(LPS22HB_SOFT_RESET_REG_ADDR,
656 mTask.baroWantRead = true;
659 if (!mTask.baroReading && !mTask.tempReading) {
660 mTask.baroReading = true;
662 mTask.comm_rx(LPS22HB_PRESS_OUTXL_REG_ADDR, 5, 1, SENSOR_READ_SAMPLES);
670 mTask.tempWantRead = true;
673 if (!mTask.baroReading && !mTask.tempReading) {
674 mTask.tempReading = true;
676 mTask.comm_rx(LPS22HB_PRESS_OUTXL_REG_ADDR, 5, 1, SENSOR_READ_SAMPLES);
701 mTask.tid = task_id;
705 mTask.baroOn = mTask.tempOn = false;
706 mTask.baroReading = mTask.tempReading = false;
708 mTask.offset_H = 0;
709 mTask.offset_L = 0;
713 mTask.baroSlab = slabAllocatorNew(slabSize, 4, LPS22HB_MAX_BARO_EVENTS);
714 if (!mTask.baroSlab) {
722 mTask.comm_tx = i2c_write;
723 mTask.comm_rx = i2c_read;
726 mTask.sensors[i].handle =
730 osEventSubscribe(mTask.tid, EVT_APP_START);
738 slabAllocatorDestroy(mTask.baroSlab);