]> jspc29.x-matter.uni-frankfurt.de Git - avr.git/commitdiff
Pt100: introduce compile time macro flag WITH_LCD
authorPhilipp Klaus <klaus@physik.uni-frankfurt.de>
Fri, 2 Jun 2017 11:32:32 +0000 (13:32 +0200)
committerPhilipp Klaus <klaus@physik.uni-frankfurt.de>
Fri, 2 Jun 2017 11:32:32 +0000 (13:32 +0200)
pt100/main.c
pt100/main.h

index 75d614a7291342e8369cb513b8d6d889e52bdc39..7fa89f711a7d1faf5d9994f11715e180b3d3da39 100644 (file)
@@ -1,8 +1,11 @@
 /* main.c */
 
 #include "main.h"
+
+#if WITH_LCD == 1
 #include "lcdlib/lcd-color-graphic.h"
 #include "lcdlib/font.h"
+#endif
 
 volatile uint16_t control_reg;
 volatile uint16_t time;
@@ -16,13 +19,16 @@ int32_t  temperature[17][9];
 uint8_t  invalid[8];
 uint8_t  make_update_lcd;
 
+#if WITH_LCD == 1
 color_t col_background;
 color_t col_font;
 color_t col_title;
 color_t col_neg;
+#endif
 
 struct calib_t calib_settings;
 
+#if WITH_LCD == 1
 /******************
  * Init USART for LCD
  *****************/
@@ -33,6 +39,7 @@ void init_spi_lcd(void) {
   UBRR1H = 0; //full speed
   UDR1 = LCD_NOP;
 }
+#endif
 
 /******************
  * Read calibration from eeprom
@@ -49,6 +56,7 @@ void read_calib() {
   time = 0;
   }
 
+#if WITH_LCD == 1
 /******************
  * Some stuff on the LCD
  *****************/
@@ -101,7 +109,7 @@ void lcd_update(void) {
   LED2_OFF();
     
   }
-  
+ #endif 
   
 /******************
  * Init all functions
@@ -151,14 +159,16 @@ void init(void) {
   OCR1A  = 31250;
   
 
+#if WITH_LCD == 1
   LED1_ON();
   lcd_init();
   LED1_OFF();
   LED2_ON();
   lcd_command_1(LCD_MIRROR, LCD_BGR | LCD_FLIP_XY);
   lcd_command(LCD_ON);    
-
   LED2_OFF(); 
+#endif
+
   read_calib();
   sei();
   }
@@ -189,12 +199,15 @@ ISR(TIMER1_COMPA_vect) {
 int main(void) {
   _delay_ms(100); 
   init();
+#if WITH_LCD == 1  
   lcd_design();
+#endif
   while(1) {
     while(next_step==0);
     next_step = 0;
     if (measurement_active) {do_measurement_step();}
-    
+  
+#if WITH_LCD == 1  
     if(make_update_lcd) {
       if(calib_settings.uselcd)
         lcd_update();
@@ -202,6 +215,7 @@ int main(void) {
       }
     if(key_was_pressed(1<<KEY_1)) {}
     if(key_was_pressed(1<<KEY_2)) {}
+#endif
 
     };
   return 0;
index db0b10c74da87bc8a7b9a11ce1165c97890ad13f..1bc62978c35b6539f869193bd40d523e2da42be2 100644 (file)
@@ -8,6 +8,8 @@
 
 #define FIRMWARE_VERSION 0x0001
 
+#define WITH_LCD 1
+
 #define UDORD1 2
 #define UCPHA1 1