Waiting For Command Completion - Motorola PPC/PMC-8260/DS1 Reference Manual

Table of Contents

Advertisement

Firmware

Waiting for Command Completion

PPC/PMC-8260/DS1
/* Wait for completion of current command
* Returns 0 on error, 1 on success
*/
int pmc8260_wait (
char *memBase
)
{
int seconds = 0;
printf ("waiting ");
while (1)
{
if (!strncmp (PBSYNC, ".OK.", 4))
{
printf ("OK\n");
return 1;
}
if (!strncmp (PBSYNC, "FAIL", 4))
{
printf ("FAILURE\n");
return 0;
}
if (strncmp (PBSYNC, "BUSY", 4))
{
if (seconds > 2)
{
printf ("command acknowledge timeout\n");
return 0;
}
}
printf (".");
sleep(1);
if (seconds++ > 40)
{
printf ("Still BUSY after 40 seconds ...\n");
return 0;
}
}
}
/* PCI window address */
Code Examples
4 - 35

Advertisement

Table of Contents
loading

Table of Contents