Cordio: put parentheses to correct order of precedence in ternary expressions

Also remove extraneous parentheses in comparison.
pull/13041/head
Hugues Kamba 2020-05-29 19:11:25 +01:00
parent c7759fe505
commit 4d939ccdbe
3 changed files with 3 additions and 3 deletions

View File

@ -452,7 +452,7 @@ static inline void lctrMstComputeAuxOffset(lctrAuxPtr_t *pAuxPtr, uint32_t *pOff
{
uint32_t offsetUsec = pAuxPtr->auxOffset * ((pAuxPtr->offsetUnits == LCTR_OFFS_UNITS_30_USEC) ? 30 : 300);
uint32_t caPpm = BbGetClockAccuracy() + ((pAuxPtr->ca == LCTR_CLK_ACC_0_50_PPM) ? 50 : 500);
uint32_t wwUsec = lctrCalcWindowWideningUsec((offsetUsec + (pAuxPtr->offsetUnits == LCTR_OFFS_UNITS_30_USEC) ? 30 : 300), caPpm);
uint32_t wwUsec = lctrCalcWindowWideningUsec(offsetUsec + ((pAuxPtr->offsetUnits == LCTR_OFFS_UNITS_30_USEC) ? 30 : 300), caPpm);
*pOffsetUsec = offsetUsec - wwUsec;
*pSyncDelayUsec = (wwUsec << 1) + ((pAuxPtr->offsetUnits == LCTR_OFFS_UNITS_30_USEC) ? 30 : 300); /* rounding compensation */

View File

@ -452,7 +452,7 @@ void lctrSlvConnEndOp(BbOpDesc_t *pOp)
(WsfQueueEmpty(&pCtx->txArqQ)) &&
(pCtx->state != LCTR_CONN_STATE_TERMINATING)))
{
if ((pCtx->llcpActiveProc == LCTR_PROC_INVALID))
if (pCtx->llcpActiveProc == LCTR_PROC_INVALID)
{
numSkipCe = pCtx->maxLatency;
}

View File

@ -1285,7 +1285,7 @@ void lctrMstPerScanOpCommit(lctrExtScanCtx_t *pExtScanCtx, lctrAuxPtr_t *pAuxPtr
pPerScanCtx->lastAnchorPoint = startTs + BB_US_TO_BB_TICKS(offsetUsec);
pPerScanCtx->lastActiveEvent = pPerScanCtx->eventCounter;
uint32_t caPpm = lctrCalcTotalAccuracy(pSyncInfo->sca);
uint32_t wwUsec = lctrCalcWindowWideningUsec((offsetUsec + (pSyncInfo->offsetUnits == LCTR_OFFS_UNITS_30_USEC) ? 30 : 300), caPpm);
uint32_t wwUsec = lctrCalcWindowWideningUsec(offsetUsec + ((pSyncInfo->offsetUnits == LCTR_OFFS_UNITS_30_USEC) ? 30 : 300), caPpm);
syncOffsetUsec = offsetUsec - wwUsec;
pPerScanCtx->rxSyncDelayUsec = pBle->op.mstPerScan.rxSyncDelayUsec = (wwUsec << 1) + ((pSyncInfo->offsetUnits == LCTR_OFFS_UNITS_30_USEC) ? 30 : 300); /* rounding compensation */
int16_t dueOffsetUsec = (offsetUsec - wwUsec) - BB_TICKS_TO_US(BB_US_TO_BB_TICKS(offsetUsec) - BB_US_TO_BB_TICKS(wwUsec));