Atmega168p freezed after adding MG811_ReadPPM function in mg811.c. Could also be from _delay_us() or _delay_ms().