From be4f8c64bb18dadb5c84fcda0d543d872b320ee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Sun, 13 Oct 2013 19:39:31 +0200 Subject: [PATCH] add basic tachometer reader --- src/main.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 57 insertions(+), 7 deletions(-) diff --git a/src/main.c b/src/main.c index 25b1f6f..f33dc7e 100644 --- a/src/main.c +++ b/src/main.c @@ -11,9 +11,14 @@ /* global variables */ volatile uint8_t pwr_ok; +volatile uint8_t fan; +volatile uint16_t tachometer = 0; +volatile uint8_t timer2_ovf = 0; + +const uint16_t TIMER2_PRESCALE[8] = {0,1,8,32,64,128,256,1024}; /* PWR_OK interrupt */ -ISR(PCINT0_vect) { /* PCINT1 is actually triggering PCI0 Interrupt Vector */ +ISR(PCINT0_vect) { /* PCI0 Interrupt Vector for PCINT[7:0] */ if (pwr_ok!=(PINB&(1<