Rev 2826 Rev 2827
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 2826 2013-03-10 15:27:21Z kaklik $" 3 #define ID "$Id: main.c 2827 2013-03-10 15:45:11Z kaklik $"
4 #include "main.h" 4 #include "main.h"
5 #include <string.h> 5 #include <string.h>
6   6  
7 #CASE // Case sensitive compiler 7 #CASE // Case sensitive compiler
8   8  
Line 46... Line 46...
46 char REV[50]=ID; // Buffer for concatenate of a version string 46 char REV[50]=ID; // Buffer for concatenate of a version string
47   47  
48 if (REV[strlen(REV)-1]=='$') REV[strlen(REV)-1]=0; 48 if (REV[strlen(REV)-1]=='$') REV[strlen(REV)-1]=0;
49 printf("\r\n\r\n# AWS01A %s (C) 2013 www.mlab.cz \r\n",VER); // Welcome message 49 printf("\r\n\r\n# AWS01A %s (C) 2013 www.mlab.cz \r\n",VER); // Welcome message
50 printf("#%s\r\n",&REV[4]); 50 printf("#%s\r\n",&REV[4]);
51 // printf("#\r\n"); -  
52 // printf("# commands: h, c, o, l, x, i, r, a, s, u\r\n"); -  
53 // printf("# h_eat, c_old, o_pen, l_ock, x_open, "); -  
54 // printf("i_nfo, r_epeat, a_uto, s_single, u_pdate\r\n"); -  
55 // printf("#\r\n"); -  
56 printf("# ver seq temp[K] hum_temp[K] hum[%%] "); 51 printf("# ver seq temp[K] hum_temp[K] hum[%%] ");
57 printf("bar_temp[K] pressure[hPa] check\r\n\r\n"); 52 printf("bar_temp[K] pressure[hPa] check\r\n\r\n");
58   53  
59 //---WDT -  
60 restart_wdt(); 54 restart_wdt(); //---WDT
61 } 55 }
62   56  
63 void main() 57 void main()
64 { 58 {
65 unsigned int16 seq=0; 59 unsigned int16 seq=0;
Line 82... Line 76...
82 welcome(); 76 welcome();
83   77  
84 sht_init(); 78 sht_init();
85 MPL_init(); // get correction coefficients from the sensor 79 MPL_init(); // get correction coefficients from the sensor
86   80  
87 // enable_interrupts(INT_TIMER1); // interrupts used for anemometer readings 81 enable_interrupts(INT_TIMER1); // interrupts used for anemometer readings
88 // enable_interrupts(INT_TIMER0); 82 enable_interrupts(INT_TIMER0);
89 // enable_interrupts(GLOBAL); 83 enable_interrupts(GLOBAL);
90   84  
91 while (TRUE) 85 while (TRUE)
92 { 86 {
93 char output[8]; // Output buffer 87 char output[8]; // Output buffer
94 int8 j; // String pointer 88 int8 j; // String pointer