1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #10535 from bergzand/pr/kw2xrf/undedup_channel

kw2xrf: Don't use netdev_ieee802154_t for channel
This commit is contained in:
Sebastian Meiling 2018-12-03 21:00:27 +01:00 committed by GitHub
commit f492bbd142
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -135,8 +135,6 @@ int kw2xrf_set_channel(kw2xrf_t *dev, uint8_t channel)
kw2xrf_write_dreg(dev, MKW2XDM_PLL_FRAC0_LSB, (uint8_t)pll_frac_lt[tmp]);
kw2xrf_write_dreg(dev, MKW2XDM_PLL_FRAC0_MSB, (uint8_t)(pll_frac_lt[tmp] >> 8));
dev->netdev.chan = channel;
if (old_seq) {
kw2xrf_set_sequence(dev, old_seq);
}

View File

@ -318,6 +318,13 @@ int _get(netdev_t *netdev, netopt_t opt, void *value, size_t len)
!!(dev->netdev.flags & KW2XRF_OPT_AUTOCCA);
return sizeof(netopt_enable_t);
case NETOPT_CHANNEL:
if (len < sizeof(uint16_t)) {
return -EOVERFLOW;
}
*((uint16_t *)value) = kw2xrf_get_channel(dev);
return sizeof(uint16_t);
case NETOPT_TX_POWER:
if (len < sizeof(int16_t)) {
return -EOVERFLOW;
@ -420,8 +427,7 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *value, size_t len)
res = -EINVAL;
break;
}
dev->netdev.chan = chan;
/* don't set res to set netdev_ieee802154_t::chan */
res = sizeof(uint16_t);
}
break;