/[H9]/trunk/Embedded/main.c
ViewVC logotype

Diff of /trunk/Embedded/main.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 164 by hedin, Wed Dec 5 15:39:55 2007 UTC revision 165 by hedin, Wed Dec 5 16:00:03 2007 UTC
# Line 23  bit global_recieve_done = 0, global_inte Line 23  bit global_recieve_done = 0, global_inte
23  unsigned int global_serial_byte_counter = 0, global_sms_counter = 1, global_time_counter = 0;  unsigned int global_serial_byte_counter = 0, global_sms_counter = 1, global_time_counter = 0;
24  unsigned int global_emergency_counter = 600, global_time_interval = 3600;  unsigned int global_emergency_counter = 600, global_time_interval = 3600;
25  unsigned char global_temp = 0;  unsigned char global_temp = 0;
26  unsigned char global_temp_old = 0;  
27    unsigned char global_temp_update_display = 0;
28    
29  unsigned char global_message_buffer1[BUFFER];  unsigned char global_message_buffer1[BUFFER];
30  unsigned char global_message_buffer2[BUFFER];  unsigned char global_message_buffer2[BUFFER];
# Line 242  void serial_recieved(void) Line 243  void serial_recieved(void)
243    
244          if ( global_serial_byte_counter < BUFFER) //Prevent buffer overrun          if ( global_serial_byte_counter < BUFFER) //Prevent buffer overrun
245                  global_serial_recieve_buffer[ global_serial_byte_counter++ ] = data_byte;       // fills the data_byte into our buffer.                  global_serial_recieve_buffer[ global_serial_byte_counter++ ] = data_byte;       // fills the data_byte into our buffer.
246            
247                    
248                    
249          if (data_byte == '\r')  // when we meet a '\r', the transmission is done, and we fill the constxt of          if (data_byte == '\r')  // when we meet a '\r', the transmission is done, and we fill the constxt of
# Line 277  void timer1_interrupt(void) Line 278  void timer1_interrupt(void)
278    
279  void update_lcd(void)  void update_lcd(void)
280  {  {
281          //lcd_clear();          if(global_temp_update_display != global_time_counter)
282          lcd_goto(0x00);          {
283                    lcd_clear();
284                    lcd_goto(0x00);
285                    
286          sprintf(global_lcd_buf, "Temp: %3d", global_temp);                  sprintf(global_lcd_buf, "Temp: %3d", global_temp);
287          lcd_puts(global_lcd_buf);                  lcd_puts(global_lcd_buf);
288                    global_temp_update_display = global_time_counter;
289            }
290    
291  }  }
292                    
# Line 495  void main() Line 500  void main()
500                          global_Pot_Hi = ADRESH;                          global_Pot_Hi = ADRESH;
501                          global_Pot_Lo = ADRESL;                          global_Pot_Lo = ADRESL;
502                          convertTemp();                          convertTemp();
503                          if (global_temp != global_temp_old)                          update_lcd();
                         {  
                                 update_lcd();  
                                 global_temp_old = global_temp;  
                         }  
504                          GODONE = 1;                          GODONE = 1;
505                  }                  }
506          // Handels the recieve sms'es.          // Handels the recieve sms'es.

Legend:
Removed from v.164  
changed lines
  Added in v.165

  ViewVC Help
Powered by ViewVC 1.1.20