diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2017-04-17 22:30:15 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-04-17 22:30:16 +0000 |
commit | 846143aa4e4985110bdb174ce2d786e7d74d28a5 (patch) | |
tree | 3034925c48a76f9136911bc8f1aedb3ac554aa9d | |
parent | 46e3a29d5b1e843f64caf58c6f302cfb8f8a0747 (diff) | |
parent | b7a837f3d0848922f553ade310c3558053bd18c9 (diff) | |
download | contexthub-846143aa4e4985110bdb174ce2d786e7d74d28a5.tar.gz |
Merge "hostIntf: don't have onEvtAppToSensorHalData generate an interrupt" into oc-dev
-rw-r--r-- | firmware/os/core/hostIntf.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/firmware/os/core/hostIntf.c b/firmware/os/core/hostIntf.c index 265ba635..084e508c 100644 --- a/firmware/os/core/hostIntf.c +++ b/firmware/os/core/hostIntf.c @@ -1083,7 +1083,7 @@ static void copyTripleSamplesRaw(struct ActiveSensor *sensor, const struct Tripl } } -static void hostIntfAddBlock(struct HostIntfDataBuffer *data, bool discardable) +static void hostIntfAddBlock(struct HostIntfDataBuffer *data, bool discardable, bool interrupt) { if (!simpleQueueEnqueue(mOutputQ, data, sizeof(uint32_t) + data->length, discardable)) return; @@ -1092,7 +1092,7 @@ static void hostIntfAddBlock(struct HostIntfDataBuffer *data, bool discardable) mWakeupBlocks++; else if (data->interrupt == NANOHUB_INT_NONWAKEUP) mNonWakeupBlocks++; - nanohubPrefetchTx(data->interrupt, mWakeupBlocks, mNonWakeupBlocks); + nanohubPrefetchTx(interrupt ? data->interrupt : HOSTINTF_MAX_INTERRUPTS, mWakeupBlocks, mNonWakeupBlocks); } static void hostIntfNotifyReboot(uint32_t reason) @@ -1165,7 +1165,7 @@ static void onEvtAppStart(const void *evtData) data->dataType = HOSTINTF_DATA_TYPE_RESET_REASON; data->interrupt = NANOHUB_INT_WAKEUP; memcpy(data->buffer, &reason, sizeof(reason)); - hostIntfAddBlock(data, false); + hostIntfAddBlock(data, false, true); hostIntfNotifyReboot(reason); } } @@ -1182,7 +1182,7 @@ static void onEvtAppToHost(const void *evtData) data->dataType = HOSTINTF_DATA_TYPE_APP_TO_HOST; data->interrupt = NANOHUB_INT_WAKEUP; memcpy(data->buffer, evtData, data->length); - hostIntfAddBlock(data, false); + hostIntfAddBlock(data, false, true); } } @@ -1200,7 +1200,7 @@ static void onEvtDebugLog(const void *evtData) struct HostIntfDataBuffer *data = (struct HostIntfDataBuffer *)evtData; if (data->sensType == SENS_TYPE_INVALID && data->dataType == HOSTINTF_DATA_TYPE_LOG) - hostIntfAddBlock(data, true); + hostIntfAddBlock(data, true, true); } #endif @@ -1362,7 +1362,7 @@ static void onEvtAppToSensorHalData(const void *evtData) if (data->sensType == SENS_TYPE_INVALID && data->dataType == HOSTINTF_DATA_TYPE_APP_TO_SENSOR_HAL) { struct AppToSensorHalDataBuffer *buffer = (struct AppToSensorHalDataBuffer *)data; - hostIntfAddBlock(data, (buffer->payload.type & EVENT_TYPE_BIT_DISCARDABLE) != 0); + hostIntfAddBlock(data, (buffer->payload.type & EVENT_TYPE_BIT_DISCARDABLE) != 0, false); } } |