mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
drivers/sx126x: fix argument validation in spreading factor
The lowest possible value is `LORA_SF5` and not `LORA_SF6`. This fixes the argument validation to allow setting `LORA_SF5` as spreading factor. Fixes https://github.com/RIOT-OS/RIOT/issues/17861
This commit is contained in:
parent
a28f6e5a41
commit
b9484852f1
@ -401,7 +401,7 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *val, size_t len)
|
|||||||
const uint8_t max_sf = sx126x_is_llcc68(dev)
|
const uint8_t max_sf = sx126x_is_llcc68(dev)
|
||||||
? llcc68_max_sf
|
? llcc68_max_sf
|
||||||
: sx126x_max_sf;
|
: sx126x_max_sf;
|
||||||
if ((sf < LORA_SF6) || (sf > max_sf)) {
|
if ((sf < LORA_SF5) || (sf > max_sf)) {
|
||||||
res = -EINVAL;
|
res = -EINVAL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user