diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-10-06 08:07:31 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-10-06 08:07:31 +0000 |
commit | b4109229a4012206cdbc6d6d8241ff0b183021ac (patch) | |
tree | 275e9d9ef1a6d604314a9cee0d6a86884bb86bf4 | |
parent | 5e8465a52d46f12239fa467749b3813d41f31d03 (diff) | |
parent | ea87d6a682bf937be8815c60ef2008549f20680b (diff) | |
download | device_google_contexthub-b4109229a4012206cdbc6d6d8241ff0b183021ac.tar.gz device_google_contexthub-b4109229a4012206cdbc6d6d8241ff0b183021ac.tar.bz2 device_google_contexthub-b4109229a4012206cdbc6d6d8241ff0b183021ac.zip |
Snap for 4380820 from ea87d6a682bf937be8815c60ef2008549f20680b to pi-release
Change-Id: Ic8b750f6dc873af43fb5a813843ca7e05b9be276
-rw-r--r-- | firmware/os/drivers/st_mag40/st_mag40.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/firmware/os/drivers/st_mag40/st_mag40.c b/firmware/os/drivers/st_mag40/st_mag40.c index bdc874aa..1b09fd50 100644 --- a/firmware/os/drivers/st_mag40/st_mag40.c +++ b/firmware/os/drivers/st_mag40/st_mag40.c @@ -674,8 +674,6 @@ static bool st_mag40_int1_isr(struct ChainedIsr *isr) if (!extiIsPendingGpio(mTask.Int1)) return false; - mTask.timestampInt = rtcGetTime(); - /* Start sampling for a value */ if (!osEnqueuePrivateEvt(EVT_SENSOR_INTERRUPT, NULL, NULL, mTask.tid)) ERROR_PRINT("st_mag40_int1_isr: osEnqueuePrivateEvt() failed\n"); @@ -701,6 +699,8 @@ static void parseRawData(uint8_t *raw) float xi, yi, zi; #endif + mTask.timestampInt = sensorGetTime(); + /* Discard samples generated during sensor turn-on time */ if (mTask.samplesToDiscard > 0) { mTask.samplesToDiscard--; @@ -1024,6 +1024,9 @@ static bool startTask(uint32_t task_id) static void endTask(void) { INFO_PRINT("ended\n"); +#if defined(ST_MAG40_CAL_ENABLED) + magCalDestroy(&mTask.moc); +#endif /* ST_MAG40_CAL_ENABLED */ slabAllocatorDestroy(mTask.magDataSlab); disableInterrupt(mTask.Int1, &mTask.Isr1); } |