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 2828 2013-03-10 15:49:54Z kaklik $" |
3 |
#define ID "$Id: main.c 2829 2013-03-10 16:41:20Z 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 69... |
Line 69... |
69 |
setup_oscillator(OSC_8MHZ); |
69 |
setup_oscillator(OSC_8MHZ); |
70 |
setup_wdt(WDT_1152MS|WDT_DIV_16); |
70 |
setup_wdt(WDT_1152MS|WDT_DIV_16); |
71 |
setup_spi(SPI_MASTER | SPI_MODE_0 | SPI_CLK_DIV_64); |
71 |
setup_spi(SPI_MASTER | SPI_MODE_0 | SPI_CLK_DIV_64); |
72 |
output_high(CSN_SPI); |
72 |
output_high(CSN_SPI); |
73 |
|
73 |
|
74 |
|
- |
|
75 |
delay_ms(100); |
74 |
delay_ms(100); |
76 |
|
75 |
|
77 |
welcome(); |
76 |
welcome(); // welocome print and device indentification |
78 |
|
77 |
|
79 |
sht_init(); |
78 |
sht_init(); |
80 |
MPL_init(); // get correction coefficients from the sensor |
79 |
MPL_init(); // get correction coefficients from the sensor |
81 |
|
80 |
|
82 |
enable_interrupts(INT_TIMER1); // interrupts used for anemometer readings |
81 |
enable_interrupts(INT_TIMER1); // interrupts used for anemometer readings |