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

semtech-loramac: avoid explicit cast to netdev

This commit is contained in:
Jose Alamos 2021-06-22 11:36:23 +02:00
parent 6f487485b5
commit 084bcf3ea6
No known key found for this signature in database
GPG Key ID: F483EB800EF89DD9

View File

@ -569,16 +569,18 @@ static void _semtech_loramac_event_cb(netdev_t *dev, netdev_event_t event)
case NETDEV_EVENT_FHSS_CHANGE_CHANNEL:
DEBUG("[semtech-loramac] FHSS channel change\n");
if(semtech_loramac_radio_events.FhssChangeChannel) {
semtech_loramac_radio_events.FhssChangeChannel((
(sx127x_t *)dev)->_internal.last_channel);
sx127x_t *sx127x = container_of(dev, sx127x_t, netdev);
semtech_loramac_radio_events.FhssChangeChannel(
sx127x->_internal.last_channel);
}
break;
case NETDEV_EVENT_CAD_DONE:
DEBUG("[semtech-loramac] test: CAD done\n");
sx127x_t *sx127x = container_of(dev, sx127x_t, netdev);
if(semtech_loramac_radio_events.CadDone) {
semtech_loramac_radio_events.CadDone((
(sx127x_t *)dev)->_internal.is_last_cad_success);
semtech_loramac_radio_events.CadDone(
sx127x->_internal.is_last_cad_success);
}
break;
#endif