From b36fb352b6e0276cc849fe9cfe98629f9d4d608d Mon Sep 17 00:00:00 2001 From: Oskar Senft Date: Fri, 26 Jul 2024 10:48:57 -0400 Subject: [PATCH] Reference LiquidCrystal library only if driver is enabled --- LiquidCrystal_Parallel.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/LiquidCrystal_Parallel.h b/LiquidCrystal_Parallel.h index afba6c2..3b00da8 100644 --- a/LiquidCrystal_Parallel.h +++ b/LiquidCrystal_Parallel.h @@ -21,9 +21,26 @@ #define LiquidCrystal_Parallel_h #include -#include #include "Display.h" +#ifdef PARALLEL_LCD_DRIVER +// Only use the Arduino library if the driver is actually enabled. +#include +#else +// If the driver is not enabled, use a dummy version instead. +class LiquidCrystal +{ +public: + LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable, + uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7) {}; + void begin(uint16_t cols, uint16_t rows) {}; + void noCursor() {}; + void setCursor(uint16_t col, uint16_t row) {}; + void clear() {}; + size_t write(uint8_t val) { return 0; }; +}; +#endif + // Support for an LCD based on the Hitachi HD44780 (or a compatible) chipset // as supported by Arduino's LiquidCrystal library. class LiquidCrystal_Parallel : public DisplayDevice