Skip to content

Commit 99c388c

Browse files
committed
applied coding conventions
1 parent 572c780 commit 99c388c

File tree

11 files changed

+24
-24
lines changed

11 files changed

+24
-24
lines changed

src/mac/region/RegionAS923.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -917,8 +917,8 @@ LoRaMacStatus_t RegionAS923NextChannel( NextChanParams_t* nextChanParams, uint8_
917917
NvmCtx.ChannelsMask[0] |= LC( 1 ) + LC( 2 );
918918
}
919919

920-
TimerTime_t elapsed = ( nextChanParams->LastAggrTx == 0 ) ? 0 : TimerGetElapsedTime( nextChanParams->LastAggrTx );
921-
if( nextChanParams->LastAggrTx == 0 || nextChanParams->AggrTimeOff <= elapsed )
920+
TimerTime_t elapsed = ( ( nextChanParams->LastAggrTx == 0 ) ) ? 0 : TimerGetElapsedTime( nextChanParams->LastAggrTx );
921+
if( ( nextChanParams->LastAggrTx == 0 ) || ( nextChanParams->AggrTimeOff <= elapsed ) )
922922
{
923923
// Reset Aggregated time off
924924
*aggregatedTimeOff = 0;

src/mac/region/RegionAU915.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -917,8 +917,8 @@ LoRaMacStatus_t RegionAU915NextChannel( NextChanParams_t* nextChanParams, uint8_
917917
}
918918
}
919919

920-
TimerTime_t elapsed = ( nextChanParams->LastAggrTx == 0 ) ? 0 : TimerGetElapsedTime( nextChanParams->LastAggrTx );
921-
if( nextChanParams->LastAggrTx == 0 || nextChanParams->AggrTimeOff <= elapsed )
920+
TimerTime_t elapsed = ( ( nextChanParams->LastAggrTx == 0 ) ) ? 0 : TimerGetElapsedTime( nextChanParams->LastAggrTx );
921+
if( ( nextChanParams->LastAggrTx == 0 ) || ( nextChanParams->AggrTimeOff <= elapsed ) )
922922
{
923923
// Reset Aggregated time off
924924
*aggregatedTimeOff = 0;

src/mac/region/RegionCN470.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,8 @@ LoRaMacStatus_t RegionCN470NextChannel( NextChanParams_t* nextChanParams, uint8_
734734
NvmCtx.ChannelsMask[5] = 0xFFFF;
735735
}
736736

737-
TimerTime_t elapsed = ( nextChanParams->LastAggrTx == 0 ) ? 0 : TimerGetElapsedTime( nextChanParams->LastAggrTx );
738-
if( nextChanParams->LastAggrTx == 0 || nextChanParams->AggrTimeOff <= elapsed )
737+
TimerTime_t elapsed = ( ( nextChanParams->LastAggrTx == 0 ) ) ? 0 : TimerGetElapsedTime( nextChanParams->LastAggrTx );
738+
if( ( nextChanParams->LastAggrTx == 0 ) || ( nextChanParams->AggrTimeOff <= elapsed ) )
739739
{
740740
// Reset Aggregated time off
741741
*aggregatedTimeOff = 0;

src/mac/region/RegionCN779.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -860,8 +860,8 @@ LoRaMacStatus_t RegionCN779NextChannel( NextChanParams_t* nextChanParams, uint8_
860860
NvmCtx.ChannelsMask[0] |= LC( 1 ) + LC( 2 ) + LC( 3 );
861861
}
862862

863-
TimerTime_t elapsed = ( nextChanParams->LastAggrTx == 0 ) ? 0 : TimerGetElapsedTime( nextChanParams->LastAggrTx );
864-
if( nextChanParams->LastAggrTx == 0 || nextChanParams->AggrTimeOff <= elapsed )
863+
TimerTime_t elapsed = ( ( nextChanParams->LastAggrTx == 0 ) ) ? 0 : TimerGetElapsedTime( nextChanParams->LastAggrTx );
864+
if( ( nextChanParams->LastAggrTx == 0 ) || ( nextChanParams->AggrTimeOff <= elapsed ) )
865865
{
866866
// Reset Aggregated time off
867867
*aggregatedTimeOff = 0;

src/mac/region/RegionCommon.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,10 @@ TimerTime_t RegionCommonUpdateBandTimeOff( bool joined, bool dutyCycle, Band_t*
169169
{
170170
if( joined == false )
171171
{
172-
TimerTime_t elapsed_join = ( bands[i].LastJoinTxDoneTime == 0 ) ? 0 : TimerGetElapsedTime( bands[i].LastJoinTxDoneTime );
173-
TimerTime_t elapsed_tx = ( bands[i].LastTxDoneTime == 0 ) ? 0 : TimerGetElapsedTime( bands[i].LastTxDoneTime );
174-
TimerTime_t txDoneTime = MAX( elapsed_join,
175-
( dutyCycle == true ) ? elapsed_tx : 0 );
172+
TimerTime_t elapsedJoin = ( bands[i].LastJoinTxDoneTime == 0 ) ? 0 : TimerGetElapsedTime( bands[i].LastJoinTxDoneTime );
173+
TimerTime_t elapsedTx = ( bands[i].LastTxDoneTime == 0 ) ? 0 : TimerGetElapsedTime( bands[i].LastTxDoneTime );
174+
TimerTime_t txDoneTime = MAX( elapsedJoin,
175+
( dutyCycle == true ) ? elapsedTx : 0 );
176176

177177
if( bands[i].TimeOff <= txDoneTime )
178178
{

src/mac/region/RegionEU433.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -860,8 +860,8 @@ LoRaMacStatus_t RegionEU433NextChannel( NextChanParams_t* nextChanParams, uint8_
860860
NvmCtx.ChannelsMask[0] |= LC( 1 ) + LC( 2 ) + LC( 3 );
861861
}
862862

863-
TimerTime_t elapsed = ( nextChanParams->LastAggrTx == 0 ) ? 0 : TimerGetElapsedTime( nextChanParams->LastAggrTx );
864-
if( nextChanParams->LastAggrTx == 0 || nextChanParams->AggrTimeOff <= elapsed )
863+
TimerTime_t elapsed = ( ( nextChanParams->LastAggrTx == 0 ) ) ? 0 : TimerGetElapsedTime( nextChanParams->LastAggrTx );
864+
if( ( nextChanParams->LastAggrTx == 0 ) || ( nextChanParams->AggrTimeOff <= elapsed ) )
865865
{
866866
// Reset Aggregated time off
867867
*aggregatedTimeOff = 0;

src/mac/region/RegionEU868.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -892,8 +892,8 @@ LoRaMacStatus_t RegionEU868NextChannel( NextChanParams_t* nextChanParams, uint8_
892892
NvmCtx.ChannelsMask[0] |= LC( 1 ) + LC( 2 ) + LC( 3 );
893893
}
894894

895-
TimerTime_t elapsed = ( nextChanParams->LastAggrTx == 0 ) ? 0 : TimerGetElapsedTime( nextChanParams->LastAggrTx );
896-
if( nextChanParams->LastAggrTx == 0 || nextChanParams->AggrTimeOff <= elapsed )
895+
TimerTime_t elapsed = ( ( nextChanParams->LastAggrTx == 0 ) ) ? 0 : TimerGetElapsedTime( nextChanParams->LastAggrTx );
896+
if( ( nextChanParams->LastAggrTx == 0 ) || ( nextChanParams->AggrTimeOff <= elapsed ) )
897897
{
898898
// Reset Aggregated time off
899899
*aggregatedTimeOff = 0;

src/mac/region/RegionIN865.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -885,8 +885,8 @@ LoRaMacStatus_t RegionIN865NextChannel( NextChanParams_t* nextChanParams, uint8_
885885
NvmCtx.ChannelsMask[0] |= LC( 1 ) + LC( 2 ) + LC( 3 );
886886
}
887887

888-
TimerTime_t elapsed = ( nextChanParams->LastAggrTx == 0 ) ? 0 : TimerGetElapsedTime( nextChanParams->LastAggrTx );
889-
if( nextChanParams->LastAggrTx == 0 || nextChanParams->AggrTimeOff <= elapsed )
888+
TimerTime_t elapsed = ( ( nextChanParams->LastAggrTx == 0 ) ) ? 0 : TimerGetElapsedTime( nextChanParams->LastAggrTx );
889+
if( ( nextChanParams->LastAggrTx == 0 ) || ( nextChanParams->AggrTimeOff <= elapsed ) )
890890
{
891891
// Reset Aggregated time off
892892
*aggregatedTimeOff = 0;

src/mac/region/RegionKR920.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,8 +854,8 @@ LoRaMacStatus_t RegionKR920NextChannel( NextChanParams_t* nextChanParams, uint8_
854854
NvmCtx.ChannelsMask[0] |= LC( 1 ) + LC( 2 ) + LC( 3 );
855855
}
856856

857-
TimerTime_t elapsed = ( nextChanParams->LastAggrTx == 0 ) ? 0 : TimerGetElapsedTime( nextChanParams->LastAggrTx );
858-
if( nextChanParams->LastAggrTx == 0 || nextChanParams->AggrTimeOff <= elapsed )
857+
TimerTime_t elapsed = ( ( nextChanParams->LastAggrTx == 0 ) ) ? 0 : TimerGetElapsedTime( nextChanParams->LastAggrTx );
858+
if( ( nextChanParams->LastAggrTx == 0 ) || ( nextChanParams->AggrTimeOff <= elapsed ) )
859859
{
860860
// Reset Aggregated time off
861861
*aggregatedTimeOff = 0;

src/mac/region/RegionRU864.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,8 +851,8 @@ LoRaMacStatus_t RegionRU864NextChannel( NextChanParams_t* nextChanParams, uint8_
851851
NvmCtx.ChannelsMask[0] |= LC( 1 ) + LC( 2 );
852852
}
853853

854-
TimerTime_t elapsed = ( nextChanParams->LastAggrTx == 0 ) ? 0 : TimerGetElapsedTime( nextChanParams->LastAggrTx );
855-
if( nextChanParams->LastAggrTx == 0 || nextChanParams->AggrTimeOff <= elapsed )
854+
TimerTime_t elapsed = ( ( nextChanParams->LastAggrTx == 0 ) ) ? 0 : TimerGetElapsedTime( nextChanParams->LastAggrTx );
855+
if( ( nextChanParams->LastAggrTx == 0 ) || ( nextChanParams->AggrTimeOff <= elapsed ) )
856856
{
857857
// Reset Aggregated time off
858858
*aggregatedTimeOff = 0;

0 commit comments

Comments
 (0)