SPORT ISR and Main loop

Hi,

I have the following code implemented in main;

int main(int argc, char *argv[])
{
 	adi_initComponents();
	
	initPLL();
	initExternalMemory();
	SRU(HIGH, DAI_PBEN15_I);

	adi_int_InstallHandler(ADI_CID_TMZHI, //iid - high priority core timer
					               timer_isr,    // handler
								   (void *)&timer_isr_count1, //handler parameter
					                true           //do enable
);


	adi_int_InstallHandler(ADI_CID_P3I, //Programmable Interrupt 3 - SPORT1
						               sport1_isr,    // handler
									   (void *)&sport1_isr_count, //handler parameter
						                true           //do enable
);

	InitSPORT0();
	InitSPORT1();

	timer_set (449994,449994);  // set tperiod and tcount of the timer 1mS interrupt with 449.994600 MHz CC
	timer_on () ;  // start timer
	//SRU(HIGH, DAI_PB15_I);

	for (rx_count = 0; rx_count < 2000; rx_count++)
	{
	
	//////ISR gets a new reading from the SPORT/////
	
	adcCode1 = adcCode1 & 0x00FFFFFF;

	if (adcCode1 & 0x800000){
			outputCodeChan1[rx_count] = adcCode1 |= 0xFF000000L;
	}	else{outputCodeChan1[rx_count] = adcCode1;}

	if (rx_count != 0)  //not the first reading
	{
		temp4 += 1;

		if ((outputCodeChan1[rx_count] & 0x80000000) != (outputCodeChan1[rx_count-1] & 0x80000000))
		{
			temp3 += 1;
			outputCodeChan[temp3] = outputCodeChan1[rx_count] >> 14; //creates a deadband around zero
			if ((outputCodeChan[temp3] > 0) || ((outputCodeChan[temp3] == 0) & (outputCodeChan[temp3-1] < 0)))
			//if (outputCodeChan[rx_count] > outputCodeChan[rx_count-1]) //current reading greater than zero
			{
				temp1 += 1;
				count1 = timer_isr_count1; // save the count on the timer
			}
			else if ((outputCodeChan[temp3] < 0) || ((outputCodeChan[temp3] == 0) & (outputCodeChan[temp3-1] > 0)))
			//else if ((outputCodeChan[rx_count] < outputCodeChan[rx_count-1])) // current reading less than zero
			{
				temp2 += 1;
				count2 = timer_isr_count1; // save the count on the timer
			}
			count[temp3] = abs(count2 - count1); // difference between saved timer counts
		}
	}

	
	}
	timer_off () ;  // stop timer
	return 0;
}

The SPORT ISR

static void sport1_isr(uint32_t iid, void* handlerArg)
{
	volatile int *sport1_counter = (int *) handlerArg;
	*sport1_counter += 1;

	//adcCode0 = *pRXSP0A;
	//adcCode1 = *pRXSP0B;
	adcCode1 = *pRXSP0B;
	//adcCode2 = *pRXSP1A & 0x00FFFFFF;
	//adcCode3 = *pRXSP1B & 0x00FFFFFF;
    SRU(HIGH, DAI_PB15_I);
    for (i1 = 0; i1 < 20; i1++){NOP();}
    SRU(LOW, DAI_PB15_I);
}

Why doesn't the loop wait at Line 32 in main for the SPORT ISR to return the reading from the converter? How do I return a reading from the ISR to the main program?

Thanks

Dan