1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-22 15:46:14 +01:00

Reference LiquidCrystal library only if driver is enabled

This commit is contained in:
Oskar Senft 2024-07-26 10:48:57 -04:00 committed by Oskar Senft
parent cc759e3d55
commit b36fb352b6

View File

@ -21,9 +21,26 @@
#define LiquidCrystal_Parallel_h
#include <Arduino.h>
#include <LiquidCrystal.h>
#include "Display.h"
#ifdef PARALLEL_LCD_DRIVER
// Only use the Arduino library if the driver is actually enabled.
#include <LiquidCrystal.h>
#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