lib/sw_services/xilisf/examples/xilisf_intel_rdwr_polled_example.c
int IsfWaitForFlashNotBusy(void)
{
	int Status = XST_FAILURE;
	u8 StatusReg;

	while(1) {

		/*
		 * Get the Status Register.
		 */
		Status = XIsf_GetStatus(&Isf, ReadBuffer);
		if(Status != XST_SUCCESS) {
			return XST_FAILURE;
		}

		/*
		 * Check if the flash is ready to accept the next command.
		 */
		StatusReg = ReadBuffer[BYTE2];
		if((StatusReg & XISF_SR_IS_READY_MASK) == 0) {

			/*
			 * If there were errors return XST_FAILURE.
			 */
			if (StatusReg & (XISF_SR_PROG_FAIL_MASK |
						XISF_SR_ERASE_FAIL_MASK)) {
				return XST_FAILURE;
			}
			break;
		}
	}

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
*
* This function waits till the Intel Serial Flash is ready to accept next
* command.
*
* @param	None
*
* @return	XST_SUCCESS if successful else XST_FAILURE.
*
* @note		This function reads the Status Register of the Serial Flash and
*		waits till the WIP bit of the Status Register becomes 0.
*
******************************************************************************/
This function waits till the Intel Serial Flash is ready to accept next
command.
This function waits till the Intel Serial Flash is ready to accept next command .
int IsfWaitForFlashNotBusy(void)
{
	int Status = XST_FAILURE;
	u8 StatusReg;
	while(1) {
		Status = XIsf_GetStatus(&Isf, ReadBuffer);
		if(Status != XST_SUCCESS) {
			return XST_FAILURE;
		}
		StatusReg = ReadBuffer[BYTE2];
		if((StatusReg & XISF_SR_IS_READY_MASK) == 0) {
			if (StatusReg & (XISF_SR_PROG_FAIL_MASK |
						XISF_SR_ERASE_FAIL_MASK)) {
				return XST_FAILURE;
			}
			break;
		}
	}
	return XST_SUCCESS;
}
int IsfWaitForFlashNotBusy ( void ) { int Status = XST_FAILURE ; u8 StatusReg ; while ( 1 ) { Status = XIsf_GetStatus ( & Isf , ReadBuffer ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } StatusReg = ReadBuffer [ BYTE2 ] ; if ( ( StatusReg & XISF_SR_IS_READY_MASK ) == 0 ) { if ( StatusReg & ( XISF_SR_PROG_FAIL_MASK | XISF_SR_ERASE_FAIL_MASK ) ) { return XST_FAILURE ; } break ; } } return XST_SUCCESS ; }
This function waits till the Intel Serial Flash is ready to accept next
command.
This function waits till the Intel Serial Flash is ready to accept next command .
/*
		 * Get the Status Register.
		 */ /*
		 * Check if the flash is ready to accept the next command.
		 */ /*
			 * If there were errors return XST_FAILURE.
			 */