for (timeout = nnn; timeout !=0; timeout--)
{
   if (pin)
   {
     break;
   }
}
if (!pin)
{
  error();
}