/********************************************************************* * @fn SensorTagMov_init * * @brief Initialization function for the SensorTag movement sub-application * * @param none * * @return none */ void SensorTagMov_init(void) { // Add service Movement_addService(); // Register callbacks with profile Movement_registerAppCBs(&sensorCallbacks); // Initialize the module state variables mpuConfig = ST_CFG_SENSOR_DISABLE; sensorPeriod = SENSOR_DEFAULT_PERIOD; sensorReadScheduled = false; appState = APP_STATE_OFF; nMotions = 0; if (SensorMpu9250_init()) { SensorTagMov_reset(); SensorMpu9250_registerCallback(SensorTagMov_processInterrupt); } // Initialize characteristics initCharacteristicValue(SENSOR_PERI, SENSOR_DEFAULT_PERIOD / SENSOR_PERIOD_RESOLUTION, sizeof(uint8_t)); // Create continuous clock for internal periodic events. Util_constructClock(&periodicClock, SensorTagMov_clockHandler, 1000, sensorPeriod, false, 0); }
/********************************************************************* * @fn SensorTag_resetAllSensors * * @brief Reset all sensors, typically when a connection is intentionally * terminated. * * @param none * * @return none */ static void SensorTag_resetAllSensors(void) { SensorTagTmp_reset(); SensorTagHum_reset(); SensorTagBar_reset(); SensorTagMov_reset(); SensorTagOpt_reset(); SensorTagIO_reset(); }
/********************************************************************* * @fn SensorTag_resetAllSensors * * @brief Reset all sensors, typically when a connection is intentionally * terminated. * * @param none * * @return none */ static void SensorTag_resetAllSensors(void) { // SensorTagTmp_reset(); //SensorTagHum_reset(); //SensorTagBar_reset(); smartLaserTagBLE_reset(); SensorTagMov_reset(); SensorTagOpt_reset(); SensorTagIO_reset(); }