/** Waits until the target has completed the last operation, by continuously polling the device's * BUSY flag until it is cleared, or until the command timeout period has expired. * * \return V2 Protocol status \ref STATUS_CMD_OK if the no timeout occurred, \ref STATUS_RDY_BSY_TOUT otherwise */ uint8_t ISPTarget_WaitWhileTargetBusy(void) { do { ISPTarget_SendByte(0xF0); ISPTarget_SendByte(0x00); ISPTarget_SendByte(0x00); } while ((ISPTarget_ReceiveByte() & 0x01) && TimeoutTicksRemaining); return (TimeoutTicksRemaining > 0) ? STATUS_CMD_OK : STATUS_RDY_BSY_TOUT; }
/** Waits until the target has completed the last operation, by continuously polling the device's * BUSY flag until it is cleared, or until the command timeout period has expired. * * \return V2 Protocol status \ref STATUS_CMD_OK if the no timeout occurred, \ref STATUS_RDY_BSY_TOUT otherwise */ uint8_t ISPTarget_WaitWhileTargetBusy(void) { do { ISPTarget_SendByte(0xF0); ISPTarget_SendByte(0x00); ISPTarget_SendByte(0x00); } while ((ISPTarget_ReceiveByte() & 0x01) && !(TimeoutExpired)); return (TimeoutExpired) ? STATUS_RDY_BSY_TOUT : STATUS_CMD_OK; }