int rxtx_callback(hackrf_transfer* transfer) { if (rxtxmode) { return tx_callback(transfer); } else { return rx_callback(transfer); } }
__interrupt void port2_isr(void) // CHANGE { uint8_t length = CC2500_BUFFER_LENGTH; // Check to see if this interrupt was caused by the GDO0 pin from the CC2500 if ( GDO0_PxIFG & GDO0_PIN ) { if( receive_packet(p_rx_buffer,&length) ) { // Successful packet receive, now send data to callback function if( rx_callback( p_rx_buffer, length ) ) { // If rx_callback returns nonzero, wakeup the processor __bic_SR_register_on_exit(LPM1_bits); } // Clear the buffer memset( p_rx_buffer, 0x00, sizeof(p_rx_buffer) ); } else { // A failed receive can occur due to bad CRC or (if address checking is // enabled) an address mismatch //uart_write("CRC NOK\r\n", 9); } } GDO0_PxIFG &= ~GDO0_PIN; // Clear interrupt flag // Only needed if radio is configured to return to IDLE after transmission // Check register MCSM1.TXOFF_MODE // cc_strobe(TI_CCxxx0_SRX); // enter receive mode again }