Skip to content

Commit 7bcb65e

Browse files
committed
Issue #928 - Fixed GFSK bandwidth handling. Moved << 1 inside the parenthesis.
1 parent bc71207 commit 7bcb65e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/radio/lr1110/radio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ void RadioSetRxConfig( RadioModems_t modem, uint32_t bandwidth, uint32_t datarat
626626
LR1110.modulation_params.modulation.gfsk.bitrate = datarate;
627627
LR1110.modulation_params.modulation.gfsk.pulse_shape = LR1110_RADIO_PULSESHAPE_GAUSSIANBT1;
628628
LR1110.modulation_params.modulation.gfsk.bandwidth =
629-
( lr1110_radio_gfsk_rx_bw_t ) RadioGetFskBandwidthRegValue( bandwidth ) << 1; // LR1110 badwidth is double sided
629+
( lr1110_radio_gfsk_rx_bw_t ) RadioGetFskBandwidthRegValue( bandwidth << 1 ); // LR1110 badwidth is double sided
630630

631631
LR1110.packet_params.packet_type = LR1110_RADIO_PACKET_GFSK;
632632
LR1110.packet_params.packet.gfsk.preamble_length_tx_in_bit = ( preambleLen << 3 ); // convert byte into bit
@@ -723,7 +723,7 @@ void RadioSetTxConfig( RadioModems_t modem, int8_t power, uint32_t fdev, uint32_
723723

724724
LR1110.modulation_params.modulation.gfsk.pulse_shape = LR1110_RADIO_PULSESHAPE_GAUSSIANBT1;
725725
LR1110.modulation_params.modulation.gfsk.bandwidth =
726-
( lr1110_radio_gfsk_rx_bw_t ) RadioGetFskBandwidthRegValue( bandwidth ) << 1; // LR1110 badwidth is double sided
726+
( lr1110_radio_gfsk_rx_bw_t ) RadioGetFskBandwidthRegValue( bandwidth << 1 ); // LR1110 badwidth is double sided
727727
LR1110.modulation_params.modulation.gfsk.fdev = fdev;
728728

729729
LR1110.packet_params.packet_type = LR1110_RADIO_PACKET_GFSK;

src/radio/sx126x/radio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ void RadioSetRxConfig( RadioModems_t modem, uint32_t bandwidth,
655655

656656
SX126x.ModulationParams.Params.Gfsk.BitRate = datarate;
657657
SX126x.ModulationParams.Params.Gfsk.ModulationShaping = MOD_SHAPING_G_BT_1;
658-
SX126x.ModulationParams.Params.Gfsk.Bandwidth = RadioGetFskBandwidthRegValue( bandwidth ) << 1; // SX126x badwidth is double sided
658+
SX126x.ModulationParams.Params.Gfsk.Bandwidth = RadioGetFskBandwidthRegValue( bandwidth << 1 ); // SX126x badwidth is double sided
659659

660660
SX126x.PacketParams.PacketType = PACKET_TYPE_GFSK;
661661
SX126x.PacketParams.Params.Gfsk.PreambleLength = ( preambleLen << 3 ); // convert byte into bit
@@ -766,7 +766,7 @@ void RadioSetTxConfig( RadioModems_t modem, int8_t power, uint32_t fdev,
766766
SX126x.ModulationParams.Params.Gfsk.BitRate = datarate;
767767

768768
SX126x.ModulationParams.Params.Gfsk.ModulationShaping = MOD_SHAPING_G_BT_1;
769-
SX126x.ModulationParams.Params.Gfsk.Bandwidth = RadioGetFskBandwidthRegValue( bandwidth ) << 1; // SX126x badwidth is double sided
769+
SX126x.ModulationParams.Params.Gfsk.Bandwidth = RadioGetFskBandwidthRegValue( bandwidth << 1 ); // SX126x badwidth is double sided
770770
SX126x.ModulationParams.Params.Gfsk.Fdev = fdev;
771771

772772
SX126x.PacketParams.PacketType = PACKET_TYPE_GFSK;

0 commit comments

Comments
 (0)