Rev 1280 Rev 1281
Line 1... Line 1...
1 /**** IR Mrakomer 4 ****/ 1 /**** IR Mrakomer 4 ****/
2 #define VERSION "4.0" 2 #define VERSION "4.0"
3 #define ID "$Id: irmrak4.c 1280 2009-01-07 12:23:26Z kakl $" 3 #define ID "$Id: irmrak4.c 1281 2009-01-07 12:31:20Z kakl $"
4 #include "irmrak4.h" 4 #include "irmrak4.h"
5   5  
6 #define MAXHEAT 20 // Number of cycles for heating 6 #define MAXHEAT 20 // Number of cycles for heating
7 #define MAXOPEN 20 // Number of cycles for dome open 7 #define MAXOPEN 20 // Number of cycles for dome open
8 #define MEASURE_DELAY 10000 // Delay to a next measurement 8 #define MEASURE_DELAY 10000 // Delay to a next measurement
Line 43... Line 43...
43 #include "smb.c" 43 #include "smb.c"
44   44  
45   45  
46 // Read sensor RAM 46 // Read sensor RAM
47 // Returns temperature in °K 47 // Returns temperature in °K
48 int16 ReadTemp(int8 addr, int8 select) 48 int16 ReadTemp(int8 addr, int8 select)
49 { 49 {
50 unsigned char arr[6]; // Buffer for the sent bytes 50 unsigned char arr[6]; // Buffer for the sent bytes
51 int8 crc; // Readed CRC 51 int8 crc; // Readed CRC
52 int16 temp; // Readed temperature 52 int16 temp; // Readed temperature
53   53  
Line 133... Line 133...
133 } 133 }
134 else 134 else
135 { 135 {
136 output_low(HEATING); 136 output_low(HEATING);
137 } 137 }
138 138  
139 if (open>0) open--; 139 if (open>0) open--;
140   140  
141 safety_counter=0; 141 safety_counter=0;
142 //---WDT 142 //---WDT
143 restart_wdt(); 143 restart_wdt();
Line 188... Line 188...
188 j=0; 188 j=0;
189 while(output[j]!=0) 189 while(output[j]!=0)
190 { 190 {
191 delay(SEND_DELAY); 191 delay(SEND_DELAY);
192 putc(output[j++]); 192 putc(output[j++]);
193 output_toggle(DOME); -  
194 } 193 }
195 } 194 }
196   195  
197 delay(MEASURE_DELAY); // Delay to a next measurement 196 delay(MEASURE_DELAY); // Delay to a next measurement
198 //---WDT 197 //---WDT