Line 1... |
Line 1... |
1 |
/**** IR Mrakomer 4 ****/ |
1 |
/**** IR Mrakomer 4 ****/ |
2 |
#define VERSION "4.1" |
2 |
#define VERSION "4.1" |
3 |
#define ID "$Id: irmrak4.c 1705 2010-12-05 19:24:34Z kakl $" |
3 |
#define ID "$Id: irmrak4.c 1706 2010-12-05 19:36:36Z kakl $" |
4 |
|
4 |
|
5 |
#include "irmrak4.h" |
5 |
#include "irmrak4.h" |
6 |
|
6 |
|
7 |
#bit CREN = 0x18.4 // USART registers |
7 |
#bit CREN = 0x18.4 // USART registers |
8 |
#bit SPEN = 0x18.7 |
8 |
#bit SPEN = 0x18.7 |
Line 49... |
Line 49... |
49 |
char REV[50]=ID; // Buffer for concatenate of a version string |
49 |
char REV[50]=ID; // Buffer for concatenate of a version string |
50 |
|
50 |
|
51 |
if (REV[strlen(REV)-1]=='$') REV[strlen(REV)-1]=0; |
51 |
if (REV[strlen(REV)-1]=='$') REV[strlen(REV)-1]=0; |
52 |
printf("\r\n\r\n# Mrakomer %s (C) 2007 UST\n\r",VER); // Welcome message |
52 |
printf("\r\n\r\n# Mrakomer %s (C) 2007 UST\n\r",VER); // Welcome message |
53 |
printf("#%s\r\n",&REV[4]); |
53 |
printf("#%s\r\n",&REV[4]); |
54 |
printf("#\r\n"); |
54 |
// printf("#\r\n"); |
55 |
printf("# commands:\r\n"); |
55 |
printf("# commands: h, c, o, l, x, i, r, a, s, u\r\n"); |
56 |
printf("# h_eat, c_old, o_pen, l_ock, x_open, "); |
56 |
// printf("# h_eat, c_old, o_pen, l_ock, x_open, "); |
57 |
printf("i_nfo, r_epeat, a_uto, s_single, u_pdate\r\n"); |
57 |
// printf("i_nfo, r_epeat, a_uto, s_single, u_pdate\r\n"); |
58 |
printf("#\r\n"); |
58 |
// printf("#\r\n"); |
59 |
printf("# <ver> <sequence> <inside[1/100 C]> <sky[1/100 C]> <sky[1/100 C]> "); |
59 |
printf("# ver sequence inside[1/100 C] sky[1/100 C] sky[1/100 C] "); |
60 |
printf("<ambient[1/100 C]> <heating[s]> <dome[s]> <check>\r\n\r\n"); |
60 |
printf("ambient[1/100 C] heating[s] dome[s] check\r\n\r\n"); |
61 |
|
61 |
|
62 |
//---WDT |
62 |
//---WDT |
63 |
restart_wdt(); |
63 |
restart_wdt(); |
64 |
} |
64 |
} |
65 |
|
65 |
|
Line 243... |
Line 243... |
243 |
|
243 |
|
244 |
case 'u': |
244 |
case 'u': |
245 |
reset_cpu(); // Update firmware |
245 |
reset_cpu(); // Update firmware |
246 |
} |
246 |
} |
247 |
} |
247 |
} |
248 |
// while(kbhit()) getc(); // Flush USART buffer |
- |
|
249 |
CREN=0; CREN=1; // Reinitialise USART |
248 |
CREN=0; CREN=1; // Reinitialise USART |
250 |
|
249 |
|
251 |
seq++; // Increment the number of measurement |
250 |
seq++; // Increment the number of measurement |
252 |
|
251 |
|
253 |
tempa=ReadTemp(SA, RAM_Tamb); // Read temperatures from sensor |
252 |
tempa=ReadTemp(SA, RAM_Tamb); // Read temperatures from sensor |