Skip to content

Commit a947f48

Browse files
committed
Merge commit '233ec783c1b902af25f1376d6fcdc9f4b0bccf53' into nanostack_v15_1_0
* commit '233ec783c1b902af25f1376d6fcdc9f4b0bccf53': Squashed 'connectivity/drivers/802.15.4_RF/atmel-rf-driver/' changes from 834c5357c6..ccba775217
2 parents 0dfb79e + 233ec78 commit a947f48

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

connectivity/drivers/802.15.4_RF/atmel-rf-driver/CMakeLists.txt

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1-
# Copyright (c) 2020 ARM Limited. All rights reserved.
2-
# SPDX-License-Identifier: Apache-2.0
1+
#################################################################################
2+
## Copyright 2020-2021 Pelion.
3+
##
4+
## SPDX-License-Identifier: Apache-2.0
5+
##
6+
## Licensed under the Apache License, Version 2.0 (the "License");
7+
## you may not use this file except in compliance with the License.
8+
## You may obtain a copy of the License at
9+
##
10+
## http://www.apache.org/licenses/LICENSE-2.0
11+
##
12+
## Unless required by applicable law or agreed to in writing, software
13+
## distributed under the License is distributed on an "AS IS" BASIS,
14+
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
## See the License for the specific language governing permissions and
16+
## limitations under the License.
17+
#################################################################################
318

419
target_include_directories(mbed-802.15.4-rf
520
INTERFACE

connectivity/drivers/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAT86RF215.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -703,19 +703,20 @@ static void rf_handle_rx_done(void)
703703
rf_state = RF_IDLE;
704704
}
705705
if (rf_read_bbc_register(BBC_PC, rf_module) & FCSOK) {
706-
if (!rf_read_rx_buffer(cur_rx_packet_len, rf_module)) {
706+
uint16_t rx_packet_len = rf_read_rx_frame_length(rf_module);
707+
if (!rf_read_rx_buffer(rx_packet_len, rf_module)) {
707708
uint8_t version = ((rx_buffer[1] & VERSION_FIELD_MASK) >> SHIFT_VERSION_FIELD);
708709
if (((rx_buffer[0] & MAC_FRAME_TYPE_MASK) == MAC_TYPE_ACK) && (version < MAC_FRAME_VERSION_2)) {
709710
rf_handle_ack(rx_buffer[2], rx_buffer[0] & MAC_DATA_PENDING);
710711
} else {
711712
int8_t rssi = (int8_t) rf_read_rf_register(RF_EDV, rf_module);
712713
// Cut CRC bytes
713714
if (mac_mode == IEEE_802_15_4_2011) {
714-
cur_rx_packet_len -= 2;
715+
rx_packet_len -= 2;
715716
} else {
716-
cur_rx_packet_len -= 4;
717+
rx_packet_len -= 4;
717718
}
718-
device_driver.phy_rx_cb(rx_buffer, cur_rx_packet_len, 0xf0, rssi, rf_radio_driver_id);
719+
device_driver.phy_rx_cb(rx_buffer, rx_packet_len, 0xf0, rssi, rf_radio_driver_id);
719720
// If auto ack used, must wait until RF returns to RF_TXPREP state
720721
if ((version != MAC_FRAME_VERSION_2) && (rx_buffer[0] & FC_AR)) {
721722
wait_us(100);

0 commit comments

Comments
 (0)