Skip to content

Commit 94290fd

Browse files
author
Daniel Jäckle
committed
Added verification for the power parameter in order to check that it is greater or equal to 0.
When using a firmware compiled for KR920 region for instance the power could be smaller than 0 which is not allowed for the NAMote72 platform as an external PA is used.
1 parent 0f02342 commit 94290fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/boards/NAMote72/sx1272-board.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ void SX1272SetRfTxPower( int8_t power )
135135
else
136136
{
137137
paConfig = ( paConfig & RF_PACONFIG_PASELECT_MASK ) | RF_PACONFIG_PASELECT_PABOOST;
138-
paConfig = ( paConfig & RFLR_PACONFIG_OUTPUTPOWER_MASK ) | PaBTable[power];
138+
paConfig = ( paConfig & RFLR_PACONFIG_OUTPUTPOWER_MASK ) | PaBTable[MAX( power, 0 )];
139139
}
140140
Radio.Write( REG_PACONFIG, paConfig );
141141
Radio.Write( REG_PADAC, paDac );

0 commit comments

Comments
 (0)