Stub out more of the TPI programming protocol routines in the AVRISP project.
This commit is contained in:
parent
be71f934a4
commit
bd5e8f07b7
11 changed files with 174 additions and 31 deletions
|
@ -312,8 +312,26 @@ void TPITarget_SendBreak(void)
|
|||
*/
|
||||
bool TPITarget_WaitWhileNVMBusBusy(void)
|
||||
{
|
||||
// TODO
|
||||
TCNT0 = 0;
|
||||
TIFR0 = (1 << OCF1A);
|
||||
|
||||
uint8_t TimeoutMS = TPI_NVM_TIMEOUT_MS;
|
||||
|
||||
/* Poll the STATUS register to check to see if NVM access has been enabled */
|
||||
while (TimeoutMS)
|
||||
{
|
||||
/* Send the LDCS command to read the TPI STATUS register to see the NVM bus is active */
|
||||
TPITarget_SendByte(TPI_CMD_SLDCS | TPI_STATUS_REG);
|
||||
if (TPITarget_ReceiveByte() & TPI_STATUS_NVM)
|
||||
return true;
|
||||
|
||||
if (TIFR0 & (1 << OCF1A))
|
||||
{
|
||||
TIFR0 = (1 << OCF1A);
|
||||
TimeoutMS--;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue