/* Handle received frame interrupt. 
This function handles transceiver interrupts for received frames and uploads the frames from the trx.  */
static void handle_received_frame_irq(void)
/* Handle received frame interrupt. 
This function handles transceiver interrupts for received frames and uploads the frames from the trx.  */
static void handle_received_frame_irq(void)
{
	uint8_t phy_frame_len;
	uint8_t *rx_frame_ptr = at86rfx_rx_buffer;
	if (CRC16_NOT_VALID == pal_trx_bit_read(SR_RX_CRC_VALID)) {
		return;
	}
	pal_trx_frame_read(&phy_frame_len, LENGTH_FIELD_LEN);
	if (phy_frame_len > PHY_MAX_LENGTH) {
		return;
	}
	pal_trx_frame_read(rx_frame_ptr, LENGTH_FIELD_LEN + phy_frame_len);
	at86rfx_frame_rx = true;
	set_trx_state(CMD_RX_ON);
}