- /* wait until photo is on */
- while (READ_PHOTO() != 1);
- time1 = TCNT0;
- LED1_ON();
-
- /* wait until photo is off, if it takes too long time,
- * return. */
- while (READ_PHOTO() != 0) {
- diff = TCNT0 - time1;
- if (diff > MAX_PHOTO_TIME)
- return -1;
- }