]> jspc29.x-matter.uni-frankfurt.de Git - avr.git/commitdiff
Revert "Pt100: introduce compile time macro flag WITH_LCD"
authorPhilipp Klaus <klaus@physik.uni-frankfurt.de>
Fri, 2 Jun 2017 14:51:42 +0000 (16:51 +0200)
committerPhilipp Klaus <klaus@physik.uni-frankfurt.de>
Fri, 2 Jun 2017 14:51:42 +0000 (16:51 +0200)
This reverts commit b6d9822.
The display update can be disabled by writing 0x0 to the EEPROM register 0xb.

pt100/main.c
pt100/main.h

index aa795c12eb6feca3e6969d87f431c9da87c2aa92..0c979fd6dba5dc7a98cee780836bd0e74ab67da7 100644 (file)
@@ -1,11 +1,8 @@
 /* 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;
@@ -19,16 +16,13 @@ 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
  *****************/
@@ -39,7 +33,6 @@ void init_spi_lcd(void) {
   UBRR1H = 0; //full speed
   UDR1 = LCD_NOP;
 }
-#endif
 
 /******************
  * Read calibration from eeprom
@@ -56,7 +49,6 @@ void read_calib() {
   time = 0;
   }
 
-#if WITH_LCD == 1
 /******************
  * Some stuff on the LCD
  *****************/
@@ -109,7 +101,7 @@ void lcd_update(void) {
   LED2_OFF();
     
   }
- #endif 
+  
   
 /******************
  * Init all functions
@@ -159,16 +151,14 @@ 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
 
+  LED2_OFF(); 
   read_calib();
   sei();
   }
@@ -201,15 +191,12 @@ 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();
@@ -217,7 +204,6 @@ int main(void) {
       }
     if(key_was_pressed(1<<KEY_1)) {}
     if(key_was_pressed(1<<KEY_2)) {}
-#endif
 
     };
   return 0;
index 1bc62978c35b6539f869193bd40d523e2da42be2..db0b10c74da87bc8a7b9a11ce1165c97890ad13f 100644 (file)
@@ -8,8 +8,6 @@
 
 #define FIRMWARE_VERSION 0x0001
 
-#define WITH_LCD 1
-
 #define UDORD1 2
 #define UCPHA1 1