Skip to content

Commit a4d9e8e

Browse files
committed
Removing LVGL display/ in favor of components/display approach
1 parent 5efe8ce commit a4d9e8e

21 files changed

+7
-2353
lines changed

src/Wippersnapper.cpp

Lines changed: 0 additions & 195 deletions
Large diffs are not rendered by default.

src/Wippersnapper.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,6 @@
121121
#include <Esp.h>
122122
#endif
123123

124-
// Display
125-
#ifdef USE_DISPLAY
126-
#include "display/ws_display_driver.h"
127-
#include "display/ws_display_ui_helper.h"
128-
#endif
129-
130124
#include "components/display/controller.h"
131125
#include "components/ds18x20/ws_ds18x20.h"
132126
#include "components/pixels/ws_pixels.h"
@@ -234,10 +228,6 @@ class Wippersnapper_DigitalGPIO;
234228
class Wippersnapper_AnalogIO;
235229
class Wippersnapper_FS;
236230
class WipperSnapper_LittleFS;
237-
#ifdef USE_DISPLAY
238-
class ws_display_driver;
239-
class ws_display_ui_helper;
240-
#endif
241231
#ifdef ARDUINO_ARCH_ESP32
242232
class ws_ledc;
243233
#endif
@@ -361,11 +351,6 @@ class Wippersnapper {
361351
Wippersnapper_FS *_fileSystem; ///< Instance of Filesystem (native USB)
362352
WipperSnapper_LittleFS
363353
*_littleFS; ///< Instance of LittleFS Filesystem (non-native USB)
364-
#ifdef USE_DISPLAY
365-
ws_display_driver *_display = nullptr; ///< Instance of display driver class
366-
ws_display_ui_helper *_ui_helper =
367-
nullptr; ///< Instance of display UI helper class
368-
#endif
369354
ws_pixels *_ws_pixelsComponent; ///< ptr to instance of ws_pixels class
370355
ws_pwm *_pwmComponent; ///< Instance of pwm class
371356
ws_servo *_servoComponent; ///< Instance of servo class

src/Wippersnapper_Boards.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
#define BOARD_ID "funhouse" ///< Board ID
3939
#define USE_TINYUSB ///< Enable TinyUSB
4040
#define USE_STATUS_DOTSTAR ///< Enable DotStar
41-
#define USE_DISPLAY ///< Enable Display
4241
#define STATUS_DOTSTAR_PIN_DATA PIN_DOTSTAR_DATA ///< DotStar Data Pin
4342
#define STATUS_DOTSTAR_PIN_CLK PIN_DOTSTAR_CLOCK ///< DotStar Clock Pin
4443
#define STATUS_DOTSTAR_NUM 5 ///< Number of DotStar LEDs

src/components/analogIO/Wippersnapper_AnalogIO.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,6 @@ bool Wippersnapper_AnalogIO::encodePinEvent(
285285
pinValVolts);
286286
snprintf(buffer, 100, "[Pin] A%d read: %0.2f\n", pinName, pinValVolts);
287287
}
288-
// display analog pin read on terminal
289-
#ifdef USE_DISPLAY
290-
WS._ui_helper->add_text_to_terminal(buffer);
291-
#endif
292-
293288
// Encode signal message
294289
pb_ostream_t stream =
295290
pb_ostream_from_buffer(WS._buffer_outgoing, sizeof(WS._buffer_outgoing));

src/components/digitalIO/Wippersnapper_DigitalGPIO.cpp

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,6 @@ void Wippersnapper_DigitalGPIO::initDigitalPin(
7575
WS_DEBUG_PRINT("Configured digital output pin on D");
7676
WS_DEBUG_PRINTLN(pinName);
7777

78-
#ifdef USE_DISPLAY
79-
char buffer[100];
80-
snprintf(buffer, 100, "[Pin] Configured Digital Output on D%u\n", pinName);
81-
WS._ui_helper->add_text_to_terminal(buffer);
82-
#endif
83-
8478
// Initialize LOW
8579
#if defined(ARDUINO_ESP8266_ADAFRUIT_HUZZAH)
8680
// The Adafruit Feather ESP8266's built-in LED is reverse wired so setting
@@ -109,13 +103,6 @@ void Wippersnapper_DigitalGPIO::initDigitalPin(
109103
WS_DEBUG_PRINT("Interval (ms):");
110104
WS_DEBUG_PRINTLN(periodMs);
111105

112-
#ifdef USE_DISPLAY
113-
char buffer[100];
114-
snprintf(buffer, 100,
115-
"[Pin] Configured Digital Input on D%u, polling every %lu mS\n",
116-
pinName, periodMs);
117-
WS._ui_helper->add_text_to_terminal(buffer);
118-
#endif
119106
// get current time
120107
ulong curTime = millis() - 1;
121108

@@ -149,12 +136,6 @@ void Wippersnapper_DigitalGPIO::deinitDigitalPin(
149136
WS_DEBUG_PRINT("Deinitializing digital pin ");
150137
WS_DEBUG_PRINTLN(pinName);
151138

152-
#ifdef USE_DISPLAY
153-
char buffer[100];
154-
snprintf(buffer, 100, "[Pin] De-initialized D%u\n", pinName);
155-
WS._ui_helper->add_text_to_terminal(buffer);
156-
#endif
157-
158139
if (direction ==
159140
wippersnapper_pin_v1_ConfigurePinRequest_Direction_DIRECTION_INPUT) {
160141
// de-allocate the pin within digital_input_pins[]
@@ -209,12 +190,6 @@ void Wippersnapper_DigitalGPIO::digitalWriteSvc(uint8_t pinName, int pinValue) {
209190
WS_DEBUG_PRINT(" to ");
210191
WS_DEBUG_PRINTLN(pinValue);
211192

212-
#ifdef USE_DISPLAY
213-
char buffer[100];
214-
snprintf(buffer, 100, "[Pin] Writing %d to D%u\n", pinValue, pinName);
215-
WS._ui_helper->add_text_to_terminal(buffer);
216-
#endif
217-
218193
// Write to the GPIO pin
219194
#if defined(ARDUINO_ESP8266_ADAFRUIT_HUZZAH)
220195
// The Adafruit Feather ESP8266's built-in LED is reverse wired so setting the
@@ -249,13 +224,6 @@ void Wippersnapper_DigitalGPIO::processDigitalInputs() {
249224
// read the pin
250225
int pinVal = digitalReadSvc(_digital_input_pins[i].pinName);
251226

252-
#ifdef USE_DISPLAY
253-
char buffer[100];
254-
snprintf(buffer, 100, "[Pin] Read D%u: %d\n",
255-
_digital_input_pins[i].pinName, pinVal);
256-
WS._ui_helper->add_text_to_terminal(buffer);
257-
#endif
258-
259227
// Create new signal message
260228
wippersnapper_signal_v1_CreateSignalRequest _outgoingSignalMsg =
261229
wippersnapper_signal_v1_CreateSignalRequest_init_zero;
@@ -289,13 +257,6 @@ void Wippersnapper_DigitalGPIO::processDigitalInputs() {
289257
WS_DEBUG_PRINT("Executing state-based event on D");
290258
WS_DEBUG_PRINTLN(_digital_input_pins[i].pinName);
291259

292-
#ifdef USE_DISPLAY
293-
char buffer[100];
294-
snprintf(buffer, 100, "[Pin] Read D%u: %d\n",
295-
_digital_input_pins[i].pinName, pinVal);
296-
WS._ui_helper->add_text_to_terminal(buffer);
297-
#endif
298-
299260
// Create new signal message
300261
wippersnapper_signal_v1_CreateSignalRequest _outgoingSignalMsg =
301262
wippersnapper_signal_v1_CreateSignalRequest_init_zero;

src/components/display/drivers/dispDrvSt7789.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,19 @@ class dispDrvSt7789 : public dispDrvBase {
5757
*/
5858
bool begin() override {
5959

60-
// Special configuration for Feather TFTs
60+
// Special power control configuration for
61+
// boards with built-in TFTs
6162
#if defined(TFT_BACKLITE)
6263
// turn on backlite
6364
pinMode(TFT_BACKLITE, OUTPUT);
6465
digitalWrite(TFT_BACKLITE, HIGH);
6566

67+
#if defined(TFT_I2C_POWER)
6668
// turn on the TFT / I2C power supply
6769
pinMode(TFT_I2C_POWER, OUTPUT);
6870
digitalWrite(TFT_I2C_POWER, HIGH);
6971
delay(10);
72+
#endif // TFT_I2C_POWER
7073
#endif
7174

7275
_display = new Adafruit_ST7789(_pin_cs, _pin_dc, _pin_rst);

src/components/ds18x20/ws_ds18x20.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,6 @@ bool ws_ds18x20::addDS18x20(
9797
WS_DEBUG_PRINT(msgDs18x20InitReq->onewire_pin);
9898
WS_DEBUG_PRINTLN(" with DS18x20 attached!");
9999

100-
#ifdef USE_DISPLAY
101-
char buffer[100];
102-
snprintf(buffer, 100, "[DS18x] Attached DS18x20 sensor to pin %s\n",
103-
msgDs18x20InitReq->onewire_pin);
104-
WS._ui_helper->add_text_to_terminal(buffer);
105-
#endif
106-
107100
// Encode and publish response back to broker
108101
memset(WS._buffer_outgoing, 0, sizeof(WS._buffer_outgoing));
109102
pb_ostream_t ostream =
@@ -148,13 +141,6 @@ void ws_ds18x20::deleteDS18x20(
148141
idx); // erase vector and re-allocate
149142
}
150143
}
151-
152-
#ifdef USE_DISPLAY
153-
char buffer[100];
154-
snprintf(buffer, 100, "[DS18x] Deleted DS18x20 sensor on pin %s\n",
155-
msgDS18x20DeinitReq->onewire_pin);
156-
WS._ui_helper->add_text_to_terminal(buffer);
157-
#endif
158144
}
159145

160146
/*************************************************************/
@@ -194,11 +180,6 @@ void ws_ds18x20::update() {
194180
if (tempC == DEVICE_DISCONNECTED_C) {
195181
WS_DEBUG_PRINTLN("ERROR: Could not read temperature data, is the "
196182
"sensor disconnected?");
197-
#ifdef USE_DISPLAY
198-
WS._ui_helper->add_text_to_terminal(
199-
"[DS18x ERROR] Unable to read temperature, is the sensor "
200-
"disconnected?\n");
201-
#endif
202183
break;
203184
}
204185

@@ -301,10 +282,6 @@ void ws_ds18x20::update() {
301282
return;
302283
};
303284
WS_DEBUG_PRINTLN("PUBLISHED!");
304-
#ifdef USE_DISPLAY
305-
WS._ui_helper->add_text_to_terminal(buffer);
306-
#endif
307-
308285
(*iter)->sensorPeriodPrv = curTime; // set prv period
309286
}
310287
}

src/components/i2c/WipperSnapper_I2C.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,9 +1233,6 @@ void WipperSnapper_Component_I2C::displayDeviceEventMessage(
12331233
default:
12341234
break;
12351235
}
1236-
#ifdef USE_DISPLAY
1237-
WS._ui_helper->add_text_to_terminal(buffer);
1238-
#endif
12391236
}
12401237
}
12411238

src/components/pixels/ws_pixels.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,6 @@ bool ws_pixels::addStrand(
272272
WS_DEBUG_PRINT(pixelsCreateReqMsg->pixels_num);
273273
WS_DEBUG_PRINT(" on GPIO #");
274274
WS_DEBUG_PRINTLN(pixelsCreateReqMsg->pixels_pin_neopixel);
275-
276-
#ifdef USE_DISPLAY
277-
char buffer[100];
278-
snprintf(buffer, 100, "[Pixel] Added NeoPixel strand on Pin %s\n.",
279-
pixelsCreateReqMsg->pixels_pin_neopixel);
280-
WS._ui_helper->add_text_to_terminal(buffer);
281-
#endif
282-
283275
publishAddStrandResponse(true, pixelsCreateReqMsg->pixels_pin_neopixel);
284276
} else if (pixelsCreateReqMsg->pixels_type ==
285277
wippersnapper_pixels_v1_PixelsType_PIXELS_TYPE_DOTSTAR) {
@@ -314,14 +306,6 @@ bool ws_pixels::addStrand(
314306
WS_DEBUG_PRINT(strands[strandIdx].numPixels);
315307
WS_DEBUG_PRINT(" on Data GPIO #");
316308
WS_DEBUG_PRINTLN(strands[strandIdx].pinDotStarData);
317-
318-
#ifdef USE_DISPLAY
319-
char buffer[100];
320-
snprintf(buffer, 100, "[Pixel] Added NeoPixel strand on Pin %s\n.",
321-
pixelsCreateReqMsg->pixels_pin_neopixel);
322-
WS._ui_helper->add_text_to_terminal(buffer);
323-
#endif
324-
325309
publishAddStrandResponse(true, pixelsCreateReqMsg->pixels_pin_dotstar_data);
326310
} else {
327311
WS_DEBUG_PRINTLN("ERROR: Invalid strand type provided!");
@@ -380,13 +364,6 @@ void ws_pixels::deleteStrand(
380364

381365
WS_DEBUG_PRINT("Deleted strand on data pin ");
382366
WS_DEBUG_PRINTLN(pixelsDeleteMsg->pixels_pin_data);
383-
384-
#ifdef USE_DISPLAY
385-
char buffer[100];
386-
snprintf(buffer, 100, "[Pixel] Deleted strand on pin %s\n.",
387-
pixelsDeleteMsg->pixels_pin_data);
388-
WS._ui_helper->add_text_to_terminal(buffer);
389-
#endif
390367
}
391368

392369
/**************************************************************************/
@@ -439,14 +416,6 @@ void ws_pixels::fillStrand(
439416
WS_DEBUG_PRINT("Filling color: ");
440417
WS_DEBUG_PRINTLN(pixelsWriteMsg->pixels_color);
441418

442-
#ifdef USE_DISPLAY
443-
char buffer[100];
444-
snprintf(buffer, 100, "[Pixel] Filling strand on pin %s with color %u\n",
445-
pixelsWriteMsg->pixels_pin_data,
446-
(unsigned int)pixelsWriteMsg->pixels_color);
447-
WS._ui_helper->add_text_to_terminal(buffer);
448-
#endif
449-
450419
if (pixelsWriteMsg->pixels_type ==
451420
wippersnapper_pixels_v1_PixelsType_PIXELS_TYPE_NEOPIXEL) {
452421
strands[strandIdx].neoPixelPtr->fill(rgbColorGamma);

0 commit comments

Comments
 (0)