git-svn-id: http://moon:8086/svn/projects/HendiControl@21 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
2019-02-20 20:01:04 +00:00
parent 21dacf4be6
commit a794460fdc
14 changed files with 446 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
/*
* timer.c
*
* Created: 20.02.2019 20:56:18
* Author: jens
*/
#include <avr/io.h>
#include "timer.h"
void timer_init(uint16_t TIMER_RELOAD)
{
TCNT1 = TIMER_RELOAD;
TCCR1A = 0x00;
TCCR1B = (1<<CS10) | (1<<CS12); // Timer mode with 1024 prescaler
TIMSK1 = (1 << TOIE1) ; // Enable timer1 overflow interrupt(TOIE1)
}