#include <avr/io.h>
#include <stdint.h>

void wacht1sec() {
	uint8_t count30=30, mark80=80;

	TCNT0=0;
	TCCR0&=~(1<<WGM01|1<<WGM00|1<<CS01);
	TCCR0|=1<<CS02|1<<CS00;

	do {
		while(TCNT0!=mark80);
		mark80+=80;
		--count30;
	}
	while (count30!=0);

	TCCR0&=~(1<<CS02|1<<CS01|1<<CS00);
}

int main() {
	void wacht1sec();	

	wacht1sec();

	while(1);
	return 0;
}
