Răsfoiți Sursa

Revert "timer and displayAlarm added"

This reverts commit 6f5af0812837ec9e44afb568b3aac43d4ff7c3d4.
Aareschluchtje 9 ani în urmă
părinte
comite
cb2f59344c
3 a modificat fișierele cu 18 adăugiri și 60 ștergeri
  1. 13 46
      display.c
  2. 2 2
      display.h
  3. 3 12
      main.c

+ 13 - 46
display.c

@@ -42,18 +42,6 @@ static void LcdWriteByte(u_char, u_char);
 static void LcdWriteNibble(u_char, u_char);
 static void LcdWaitBusy(void);
 
-int timer(u_char Mode){
-    time_t Start;
-    if(Mode == start)
-    {
-            time_t diff = time(0) - Start;
-            return diff;
-    }
-    else if(Mode == stop)
-    {
-        Start = time(0);
-    }
-}
 /*!
  * \addtogroup Display
  */
@@ -64,17 +52,16 @@ int timer(u_char Mode){
 /*                         start of code                                   */
 /*-------------------------------------------------------------------------*/
 
-/* ����������������������������������������������������������������������� */
+/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
 /*!
  * \brief control backlight
  */
-/* ����������������������������������������������������������������������� */
+/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
 void LcdBackLight(u_char Mode)
 {
     if (Mode==LCD_BACKLIGHT_ON)
     {
         sbi(LCD_BL_PORT, LCD_BL_BIT);   // Turn on backlight
-
     }
 
     if (Mode==LCD_BACKLIGHT_OFF)
@@ -83,42 +70,22 @@ void LcdBackLight(u_char Mode)
     }
 }
 
-/* ����������������������������������������������������������������������� */
-
-/*
- * Lcdbacklight knipperen
- */
-
-void LcdBacklightKnipperen(u_char Mode)
-{
-    time_t start;
-    time_t stop;
-    if (Mode==LCD_BACKLIGHT_ON)
-    {
-        sbi(LCD_BL_PORT, LCD_BL_BIT);   // Turn on backlight
-        timer(start);
-    }
-    if (Mode==LCD_BACKLIGHT_OFF)
-    {
-        cbi(LCD_BL_PORT, LCD_BL_BIT);   // Turn off backlight
-        timer(stop);
-    }
-}
-/*
+/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
+/*!
  * \brief Write a single character on the LCD
  *
  * Writes a single character on the LCD on the current cursor position
  *
  * \param LcdChar character to write
  */
-/* ����������������������������������������������������������������������� */
+/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
 void LcdChar(char MyChar)
 {
     LcdWriteByte(WRITE_DATA, MyChar);
 }
 
 
-/* ����������������������������������������������������������������������� */
+/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
 /*!
  * \brief Low-level initialisation function of the LCD-controller
  *
@@ -127,7 +94,7 @@ void LcdChar(char MyChar)
  *           1 line dislay, 10 dots high characters
  *
  */
-/* ����������������������������������������������������������������������� */
+/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
  void LcdLowLevelInit()
 {
     u_char i;
@@ -160,7 +127,7 @@ void LcdChar(char MyChar)
 }
 
 
-/* ����������������������������������������������������������������������� */
+/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
 /*!
  * \brief Low-level routine to write a byte to LCD-controller
  *
@@ -172,7 +139,7 @@ void LcdChar(char MyChar)
  * \param LcdByte byte to write
  *
  */
-/* ����������������������������������������������������������������������� */
+/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
 static void LcdWriteByte(u_char CtrlState, u_char LcdByte)
 {
     LcdWaitBusy();                      // see if the controller is ready to receive next byte
@@ -181,7 +148,7 @@ static void LcdWriteByte(u_char CtrlState, u_char LcdByte)
 
 }
 
-/* ����������������������������������������������������������������������� */
+/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
 /*!
  * \brief Low-level routine to write a nibble to LCD-controller
  *
@@ -193,7 +160,7 @@ static void LcdWriteByte(u_char CtrlState, u_char LcdByte)
  * \param LcdNibble nibble to write (upper 4 bits in this byte
  *
  */
-/* ����������������������������������������������������������������������� */
+/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
 static void LcdWriteNibble(u_char CtrlState, u_char LcdNibble)
 {
     outp((inp(LCD_DATA_DDR) & 0x0F) | 0xF0, LCD_DATA_DDR);  // set data-port to output again
@@ -219,7 +186,7 @@ static void LcdWriteNibble(u_char CtrlState, u_char LcdNibble)
     outp((inp(LCD_DATA_PORT) & 0x0F) | 0xF0, LCD_DATA_PORT);  // enable pull-ups in data-port
 }
 
-/* ����������������������������������������������������������������������� */
+/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
 /*!
  * \brief Low-level routine to see if the controller is ready to receive
  *
@@ -227,7 +194,7 @@ static void LcdWriteNibble(u_char CtrlState, u_char LcdNibble)
  * has become '0'. If a '0' is detected on bit 7 the function returns.
  *
  */
-/* ����������������������������������������������������������������������� */
+/* ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
 static void LcdWaitBusy()
 {
     u_char Busy = 1;

+ 2 - 2
display.h

@@ -56,9 +56,9 @@ extern void LcdLowLevelInit(void);
 extern void ClearLcd(void);
 extern void LcdArrayLineOne(char*, int);
 extern void LcdArrayLineTwo(char*, int);
-extern void LcdBacklightKnipperen(u_char);
+
 #endif /* _Display_H */
-/*  ����  End Of File  �������� �������������������������������������������� */
+/*  ÍÍÍÍ  End Of File  ÍÍÍÍÍÍÍÍ ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ */
 
 
 

+ 3 - 12
main.c

@@ -210,8 +210,8 @@ void displayTime(){
 }
 
 int timer(time_t start){
-    time_t diff = time(0) - start;
-    return diff;
+	time_t diff = time(0) - start;
+	return diff;
 }
 
 int checkOffPressed(){
@@ -223,14 +223,6 @@ int checkOffPressed(){
 	}
 }
 
-void displayAlarm()
-{
-    long flags;
-    X12RtcGetAlarm(0,&gmt.tm,flags);
-    char str[12];
-    sprintf(str, "    %02d:%02d:%02d", gmt.tm_hour, gmt.tm_min, gmt.tm_sec);
-}
-
 /* ����������������������������������������������������������������������� */
 /*!
  * \brief Main entry of the SIR firmware
@@ -329,8 +321,7 @@ int main(void)
 		}
 		displayTime();
 		displayDate();
-        X12RtcSetAlarm(0,get);
-        LcdBacklightKnipperen();
+		
         WatchDogRestart();
     }