File tree Expand file tree Collapse file tree 1 file changed +15
-12
lines changed Expand file tree Collapse file tree 1 file changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -353,22 +353,25 @@ void SX126xSetStopRxTimerOnPreambleDetect( bool enable )
353353 SX126xWriteCommand ( RADIO_SET_STOPRXTIMERONPREAMBLE , ( uint8_t * )& enable , 1 );
354354}
355355
356- void SX126xSetLoRaSymbNumTimeout ( uint8_t SymbNum )
356+ void SX126xSetLoRaSymbNumTimeout ( uint8_t symbNum )
357357{
358- SX126xWriteCommand ( RADIO_SET_LORASYMBTIMEOUT , & SymbNum , 1 );
358+ SX126xWriteCommand ( RADIO_SET_LORASYMBTIMEOUT , & symbNum , 1 );
359359
360- uint8_t mant = SymbNum >> 1 ;
361- uint8_t exp = 0 ;
362- uint8_t reg = 0 ;
363-
364- while ( mant > 31 )
360+ if ( symbNum >= 64 )
365361 {
366- mant >>= 2 ;
367- exp ++ ;
368- }
362+ uint8_t mant = symbNum >> 1 ;
363+ uint8_t exp = 0 ;
364+ uint8_t reg = 0 ;
365+
366+ while ( mant > 31 )
367+ {
368+ mant >>= 2 ;
369+ exp ++ ;
370+ }
369371
370- reg = exp + ( mant << 3 );
371- SX126xWriteRegister ( REG_LR_SYNCH_TIMEOUT , reg );
372+ reg = exp + ( mant << 3 );
373+ SX126xWriteRegister ( REG_LR_SYNCH_TIMEOUT , reg );
374+ }
372375}
373376
374377void SX126xSetRegulatorMode ( RadioRegulatorMode_t mode )
You can’t perform that action at this time.
0 commit comments