Low Level Controller
i = 0;
/* wait for the expected state
while ((inp(pt->pt_r_cixr) & CIR_MASK) != NewState)
if (i++ > 20000)
*/
*/
{
/* break if timeout
failed = TRUE;
break;
}
/* output the release command
*/
outp (pt->pt_r_cixr, (BYTE)(CIXR_TBC | ReleaseCommand));
if (pt->pt_ModulMode == PT_MM_TE)
{
/* TE mode ?
*/
*/
*/
*/
*/
*/
/* Wait for DIU or AIU because
/* it can cause problems for the
/* enable clock routine if the
/* clocks disappear mid routine
/* due to an earlier reset
for (i = 0; i < 20000; i++)
{
pt->pt_CI_rec = inp (pt->pt_r_cixr) & CIR_MASK;
if ((pt->pt_CI_rec == CI_DIU) || (pt->pt_CI_rec == CI_AI))
break;
}
if ((pt->pt_state & PT_IOM2) && (pt->pt_CI_rec == CI_AI))
outp (pt->pt_r_cixr, CIXR_TBC | CI_AR | 0x03);
}
if (Loop)
outp (pt->pt_r_spcr, r_spcr);
/* restore original value of SPCR
/* enable interrupts again
*/
*/
outp (pt->pt_r_mask, 0x00);
LEAVENOINT (state);
if (failed)
{
if (pt->pt_Lay1id == SBC_LAY1)
pt->pt_Lay1id = UNK_LAY1;
return (FALSE);
}
else
return (TRUE);
}
Semiconductor Group
316