if (!flag) //but is sampled only once
{
  while(1) ;
}