Merge pull request #10185 from artokin/mcr20a_interruptin_flag_fix

Nanostack 802.15.4 RF drivers update
pull/9904/head
Cruz Monrreal 2019-03-27 00:23:20 -05:00 committed by GitHub
commit d81f3653c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View File

@ -17,7 +17,7 @@
#ifndef NANOSTACK_PHY_MCR20A_H_ #ifndef NANOSTACK_PHY_MCR20A_H_
#define NANOSTACK_PHY_MCR20A_H_ #define NANOSTACK_PHY_MCR20A_H_
#if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI && defined(MBED_CONF_RTOS_PRESENT) #if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI && DEVICE_INTERRUPTIN && defined(MBED_CONF_RTOS_PRESENT)
#include "inttypes.h" #include "inttypes.h"
#include "NanostackRfPhy.h" #include "NanostackRfPhy.h"
#include "DigitalIn.h" #include "DigitalIn.h"

View File

@ -42,7 +42,7 @@
#include "MCR20Reg.h" #include "MCR20Reg.h"
#include "XcvrSpi.h" #include "XcvrSpi.h"
#if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI #if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI && DEVICE_INTERRUPTIN && defined(MBED_CONF_RTOS_PRESENT)
#include "platform/mbed_critical.h" #include "platform/mbed_critical.h"

View File

@ -13,10 +13,10 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include "NanostackRfPhyMcr20a.h"
#if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI && DEVICE_INTERRUPTIN && defined(MBED_CONF_RTOS_PRESENT) #if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI && DEVICE_INTERRUPTIN && defined(MBED_CONF_RTOS_PRESENT)
#include "NanostackRfPhyMcr20a.h"
#include "ns_types.h" #include "ns_types.h"
#include "platform/arm_hal_interrupt.h" #include "platform/arm_hal_interrupt.h"
#include "nanostack/platform/arm_hal_phy.h" #include "nanostack/platform/arm_hal_phy.h"

View File

@ -931,8 +931,6 @@ static void rf_sync_detected_handler(void)
rf_state = RF_RX_STARTED; rf_state = RF_RX_STARTED;
TEST_RX_STARTED TEST_RX_STARTED
rf_disable_interrupt(SYNC_WORD); rf_disable_interrupt(SYNC_WORD);
rf_enable_interrupt(RX_FIFO_ALMOST_FULL);
rf_enable_interrupt(RX_DATA_READY);
rf_backup_timer_start(MAX_PACKET_SENDING_TIME); rf_backup_timer_start(MAX_PACKET_SENDING_TIME);
} }
@ -955,13 +953,15 @@ static void rf_receive(uint8_t rx_channel)
rf_rx_channel = rf_new_channel = rx_channel; rf_rx_channel = rf_new_channel = rx_channel;
} }
rf_send_command(S2LP_CMD_RX); rf_send_command(S2LP_CMD_RX);
rf_poll_state_change(S2LP_STATE_RX);
rf_enable_interrupt(SYNC_WORD); rf_enable_interrupt(SYNC_WORD);
rf_enable_interrupt(RX_FIFO_ALMOST_FULL);
rf_enable_interrupt(RX_DATA_READY);
rf_enable_interrupt(RX_FIFO_UNF_OVF); rf_enable_interrupt(RX_FIFO_UNF_OVF);
rx_data_length = 0; rx_data_length = 0;
if (rf_state != RF_CSMA_STARTED) { if (rf_state != RF_CSMA_STARTED) {
rf_state = RF_IDLE; rf_state = RF_IDLE;
} }
rf_poll_state_change(S2LP_STATE_RX);
rf_unlock(); rf_unlock();
} }