Merge commit '233ec783c1b902af25f1376d6fcdc9f4b0bccf53' into nanostack_v15_1_0

* commit '233ec783c1b902af25f1376d6fcdc9f4b0bccf53':
  Squashed 'connectivity/drivers/802.15.4_RF/atmel-rf-driver/' changes from 834c5357c6..ccba775217
pull/15187/head
Arto Kinnunen 2021-12-08 13:47:18 +02:00
commit a947f4845c
2 changed files with 22 additions and 6 deletions

View File

@ -1,5 +1,20 @@
# Copyright (c) 2020 ARM Limited. All rights reserved. #################################################################################
# SPDX-License-Identifier: Apache-2.0 ## Copyright 2020-2021 Pelion.
##
## SPDX-License-Identifier: Apache-2.0
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
#################################################################################
target_include_directories(mbed-802.15.4-rf target_include_directories(mbed-802.15.4-rf
INTERFACE INTERFACE

View File

@ -703,7 +703,8 @@ static void rf_handle_rx_done(void)
rf_state = RF_IDLE; rf_state = RF_IDLE;
} }
if (rf_read_bbc_register(BBC_PC, rf_module) & FCSOK) { if (rf_read_bbc_register(BBC_PC, rf_module) & FCSOK) {
if (!rf_read_rx_buffer(cur_rx_packet_len, rf_module)) { uint16_t rx_packet_len = rf_read_rx_frame_length(rf_module);
if (!rf_read_rx_buffer(rx_packet_len, rf_module)) {
uint8_t version = ((rx_buffer[1] & VERSION_FIELD_MASK) >> SHIFT_VERSION_FIELD); uint8_t version = ((rx_buffer[1] & VERSION_FIELD_MASK) >> SHIFT_VERSION_FIELD);
if (((rx_buffer[0] & MAC_FRAME_TYPE_MASK) == MAC_TYPE_ACK) && (version < MAC_FRAME_VERSION_2)) { if (((rx_buffer[0] & MAC_FRAME_TYPE_MASK) == MAC_TYPE_ACK) && (version < MAC_FRAME_VERSION_2)) {
rf_handle_ack(rx_buffer[2], rx_buffer[0] & MAC_DATA_PENDING); rf_handle_ack(rx_buffer[2], rx_buffer[0] & MAC_DATA_PENDING);
@ -711,11 +712,11 @@ static void rf_handle_rx_done(void)
int8_t rssi = (int8_t) rf_read_rf_register(RF_EDV, rf_module); int8_t rssi = (int8_t) rf_read_rf_register(RF_EDV, rf_module);
// Cut CRC bytes // Cut CRC bytes
if (mac_mode == IEEE_802_15_4_2011) { if (mac_mode == IEEE_802_15_4_2011) {
cur_rx_packet_len -= 2; rx_packet_len -= 2;
} else { } else {
cur_rx_packet_len -= 4; rx_packet_len -= 4;
} }
device_driver.phy_rx_cb(rx_buffer, cur_rx_packet_len, 0xf0, rssi, rf_radio_driver_id); device_driver.phy_rx_cb(rx_buffer, rx_packet_len, 0xf0, rssi, rf_radio_driver_id);
// If auto ack used, must wait until RF returns to RF_TXPREP state // If auto ack used, must wait until RF returns to RF_TXPREP state
if ((version != MAC_FRAME_VERSION_2) && (rx_buffer[0] & FC_AR)) { if ((version != MAC_FRAME_VERSION_2) && (rx_buffer[0] & FC_AR)) {
wait_us(100); wait_us(100);