Line 1... |
Line 1... |
1 |
/**** Automatic weather station 01A ****/ |
1 |
/**** Automatic weather station 01A ****/ |
2 |
#define VERSION "0.1" |
2 |
#define VERSION "0.1" |
3 |
#define ID "$Id: main.c 3083 2013-06-18 10:50:31Z kaklik $" |
3 |
#define ID "$Id: main.c 3086 2013-06-22 16:48:02Z kaklik $" |
4 |
#include "main.h" |
4 |
#include "main.h" |
5 |
#include ".\common\dbloader.h" |
5 |
#include ".\common\dbloader.h" |
6 |
#include <string.h> |
6 |
#include <string.h> |
7 |
|
7 |
|
8 |
#CASE // Case sensitive compiler |
8 |
#CASE // Case sensitive compiler |
Line 31... |
Line 31... |
31 |
|
31 |
|
32 |
#int_TIMER1 |
32 |
#int_TIMER1 |
33 |
void TIMER1_isr(void) |
33 |
void TIMER1_isr(void) |
34 |
{ |
34 |
{ |
35 |
// wind speed calculation 32.768 kHz crystal on timer1 oscilator expected. |
35 |
// wind speed calculation 32.768 kHz crystal on timer1 oscilator expected. |
36 |
anemo = ((timer0_overflow_count * 0xFF) + get_timer0())/(32768.0/0xFFFF); // pulses per second calculation |
36 |
anemo = ((timer0_overflow_count * 0xFF) + get_timer0())/(0xFFFF/32768.0); // pulses per second calculation |
37 |
anemo = anemo / 10.5; // frequency divided by anemomether constant. |
37 |
anemo = anemo / 10.5; // frequency divided by anemomether constant. |
38 |
|
38 |
|
39 |
timer0_overflow_count=0; |
39 |
timer0_overflow_count=0; |
40 |
set_timer0(0); |
40 |
set_timer0(0); |
41 |
set_timer1(0); |
41 |
set_timer1(0); |