[En-Nut-Discussion] Platform independent HD44780 driver (remove old ones)

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Tue Sep 16 12:44:28 CEST 2014


>>>>> "Thiago" == Thiago A Corrêa <thiago.correa at gmail.com> writes:

    Thiago> Ok, I've uploaded it. It isn't fancy at all, HD44780 is fairly
    Thiago> simple.  It might need some tweaking. Let me know if anyone has
    Thiago> problems with it.

There are problems with missing defines on many configurations!

What about appended patch as safeguard? It make compile all default
configurations again. As there is no code in the app directory using this
driver, I think this works for now.

Bye
-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
diff --git a/nut/dev/hd44780.c b/nut/dev/hd44780.c
index 90f6a27..9c460a6 100644
--- a/nut/dev/hd44780.c
+++ b/nut/dev/hd44780.c
@@ -62,6 +62,11 @@
 #define LCD_COLS    16
 #endif
 
+#if defined(LCD_EN_PIO_ID) && defined(LCD_RS_PIO_ID) &&  defined(LCD_RW_PIO_ID)
+#define HD447800_ENABLE
+#endif
+
+#if defined(HD447800_ENABLE)
 #if !defined(LCD_IF_8BIT) && !defined(LCD_IF_4BIT)
 #define LCD_IF_4BIT
 #endif
@@ -349,6 +354,7 @@ TERMDCB dcb_term = {
     0,                          /*!< \brief Cursor column. */
     0                           /*!< \brief Display shadow memory. */
 };
+#endif
 
 /*!
  * \brief LCD device information structure.
@@ -360,7 +366,11 @@ NUTDEVICE devLcd = {
     0,                          /*!< Base address. */
     0,                          /*!< First interrupt number. */
     0,                          /*!< Interface control block. */
+#if defined(HD447800_ENABLE)
     &dcb_term,                  /*!< Driver control block. */
+#else
+    NULL,                       /*!< Driver control block. */
+#endif
     TermInit,                   /*!< Driver initialization routine. */
     TermIOCtl,                  /*!< Driver specific control function. */
     0,


More information about the En-Nut-Discussion mailing list