- adc is event based

- changed timer frequency
- prepared for SW timer
- added PowerSwitch_in


git-svn-id: http://moon:8086/svn/projects/HendiControl@30 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
2019-02-28 19:18:40 +00:00
parent a22ffe8384
commit 8a8bb762e0
7 changed files with 133 additions and 82 deletions
+2 -2
View File
@@ -8,13 +8,13 @@
#include <avr/io.h>
#include "timer.h"
void timer_init(uint16_t TIMER_RELOAD)
void timer_init(uint16_t TIMER_RELOAD, TimerClockSel clockSel)
{
TCNT1 = TIMER_RELOAD;
TCCR1A = 0x00;
TCCR1B = (1<<CS10) | (1<<CS12); // Timer mode with 1024 prescaler
TCCR1B = (TCCR1B & TimerClockSel_mask) | clockSel;
TIMSK1 = (1 << TOIE1) ; // Enable timer1 overflow interrupt(TOIE1)
}