Merge pull request #15217 from LukaB/fix-STM32WL-radio-driver

Fix STM32 radio driver when bandwidth is 0
pull/15223/head
Martin Kojtal 2022-02-07 12:03:58 +01:00 committed by GitHub
commit 835b2741b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -868,6 +868,10 @@ uint8_t STM32WL_LoRaRadio::get_fsk_bw_reg_val(uint32_t bandwidth)
{
uint8_t i;
if (bandwidth == 0) {
return 0x1F;
}
for (i = 0; i < (sizeof(fsk_bandwidths) / sizeof(fsk_bw_t)) - 1; i++) {
if ((bandwidth >= fsk_bandwidths[i].bandwidth)
&& (bandwidth < fsk_bandwidths[i + 1].bandwidth)) {