SPI_SendByte(PollAddress >> 8);
SPI_SendByte(PollAddress & 0xFF);
}
- while ((SPI_TransferByte(0x00) == PollValue) && TimeoutMSRemaining);
+ while ((SPI_TransferByte(0x00) == PollValue) && TimeoutTicksRemaining);
- if (!(TimeoutMSRemaining))
+ if (!(TimeoutTicksRemaining))
ProgrammingStatus = STATUS_CMD_TOUT;
break;
break;
}
- if (ProgrammingStatus == STATUS_CMD_OK)
- TimeoutMSRemaining = COMMAND_TIMEOUT_MS;
-
return ProgrammingStatus;
}
SPI_SendByte(0x00);
SPI_SendByte(0x00);
}
- while ((SPI_ReceiveByte() & 0x01) && TimeoutMSRemaining);
+ while ((SPI_ReceiveByte() & 0x01) && TimeoutTicksRemaining);
- if (TimeoutMSRemaining)
- {
- TimeoutMSRemaining = COMMAND_TIMEOUT_MS;
- return STATUS_CMD_OK;
- }
- else
- {
- return STATUS_RDY_BSY_TOUT;
- }
+ return TimeoutTicksRemaining ? STATUS_CMD_OK : STATUS_RDY_BSY_TOUT;
}
/** Sends a low-level LOAD EXTENDED ADDRESS command to the target, for addressing of memory beyond the