Lines Matching refs:mTask
174 static struct hts221Task mTask;
178 float percentage = (float) ((mTask.y1_H - mTask.y0_H) * hum + \
179 ((mTask.x1_H * mTask.y0_H) - (mTask.x0_H * mTask.y1_H))) / \
180 (mTask.x1_H - mTask.x0_H);
193 for (i = 0; i < ARRAY_SIZE(mTask.transfers); i++) {
194 if (!mTask.transfers[i].inUse) {
195 mTask.transfers[i].inUse = true;
196 mTask.transfers[i].state = state;
197 return &mTask.transfers[i];
219 osEnqueuePrivateEvt(EVT_COMM_DONE, cookie, NULL, mTask.tid);
269 osEnqueuePrivateEvt(EVT_SENSOR_HUMIDITY_TIMER, data, NULL, mTask.tid);
305 bool oldMode = mTask.humidityOn;
312 if (!on && mTask.humidityTimerHandle) {
313 timTimerCancel(mTask.humidityTimerHandle);
314 mTask.humidityTimerHandle = 0;
315 mTask.humidityReading = false;
320 ret = mTask.comm_tx(HTS221_CTRL_REG1, HTS221_POWER_ON | HTS221_ODR_12_5_HZ, 0, state);
322 ret = mTask.comm_tx(HTS221_CTRL_REG1, HTS221_POWER_OFF, 0, state);
324 sensorSignalInternalEvt(mTask.sensors[HUMIDITY].handle,
332 mTask.humidityReading = false;
333 mTask.humidityOn = on;
339 return sensorSignalInternalEvt(mTask.sensors[HUMIDITY].handle, SENSOR_INTERNAL_EVT_FW_STATE_CHG, 1, 0);
346 if (mTask.humidityTimerHandle)
347 timTimerCancel(mTask.humidityTimerHandle);
349 mTask.humidityTimerHandle = timTimerSet(sensorTimerLookupCommon(hts221Rates,
352 return sensorSignalInternalEvt(mTask.sensors[HUMIDITY].handle,
378 mTask.y0_H = (int8_t) (calib->h0_x2 / 2);
379 mTask.y1_H = (int8_t) (calib->h1_x2 / 2);
380 mTask.x0_H = (int16_t) (calib->h0_t0_h << 8) |
382 mTask.x1_H = (int16_t) (calib->h1_t0_h << 8) |
384 DEBUG_PRINT("y0_H: %d - y1_H: %d\n", mTask.y0_H, mTask.y1_H);
385 DEBUG_PRINT("x0_H: %d - x1_H: %d\n", mTask.x0_H, mTask.x1_H);
399 if (!mTask.comm_rx(HTS221_WAI_REG_ADDR, 1, 1, SENSOR_VERIFY_ID)) {
414 sensorRegisterInitComplete(mTask.sensors[i].handle);
420 sensorRegisterInitComplete(mTask.sensors[i].handle);
424 sensorSignalInternalEvt(mTask.sensors[HUMIDITY].handle,
429 sensorSignalInternalEvt(mTask.sensors[HUMIDITY].handle,
434 if (mTask.humidityOn && mTask.humidityWantRead) {
435 mTask.humidityWantRead = false;
441 mTask.humidityReading = false;
461 osEventUnsubscribe(mTask.tid, EVT_APP_START);
463 mTask.comm_rx(HTS221_CALIB_DATA, sizeof(struct hts221_calib_data), 0, SENSOR_BOOT);
471 mTask.humidityWantRead = true;
474 if (!mTask.humidityReading) {
475 mTask.humidityReading = true;
477 mTask.comm_rx(HTS221_HUMIDITY_OUTL_REG_ADDR, 2, 1, SENSOR_READ_SAMPLES);
491 mTask.tid = task_id;
495 mTask.humidityOn = false;
496 mTask.humidityReading = false;
501 mTask.comm_tx = i2c_write;
502 mTask.comm_rx = i2c_read;
505 mTask.sensors[i].handle =
509 osEventSubscribe(mTask.tid, EVT_APP_START);