Skip to content

Commit 1b9b634

Browse files
committed
bump ver
1 parent 49cf9cc commit 1b9b634

File tree

4 files changed

+23
-18
lines changed

4 files changed

+23
-18
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Adafruit WipperSnapper
2-
version=1.0.0-beta.111
2+
version=1.0.0-beta.112
33
author=Adafruit
44
maintainer=Adafruit <[email protected]>
55
sentence=Arduino application for Adafruit.io WipperSnapper

src/Wippersnapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
#endif
152152

153153
#define WS_VERSION \
154-
"1.0.0-beta.110" ///< WipperSnapper app. version (semver-formatted)
154+
"1.0.0-beta.112" ///< WipperSnapper app. version (semver-formatted)
155155

156156
// Reserved Adafruit IO MQTT topics
157157
#define TOPIC_IO_THROTTLE "/throttle" ///< Adafruit IO Throttle MQTT Topic

src/components/display/controller.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
/*!
1818
@brief Constructs a new DisplayController object
1919
*/
20-
DisplayController::DisplayController() {
21-
// TODO
22-
}
20+
DisplayController::DisplayController() {}
2321

2422
/*!
2523
@brief Destructor
@@ -68,7 +66,7 @@ bool DisplayController::Handle_Display_AddOrReplace(
6866

6967
_hw_instances.push_back(display); // Store the display instance
7068
WS_DEBUG_PRINTLN("[display] Display added or replaced successfully!");
71-
return true; // Placeholder
69+
return true;
7270
}
7371

7472
/*!
@@ -109,7 +107,7 @@ bool DisplayController::Handle_Display_Write(
109107
}
110108
}
111109

112-
// Early-out if display not found
110+
// Early-out if driver instance not found
113111
if (!display) {
114112
WS_DEBUG_PRINTLN("[display] Failed to write, driver not found!");
115113
return false;

src/components/display/hardware.cpp

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,15 @@ bool DisplayHardware::beginEPD(
119119
// Validate mode is a correct EPD mode
120120
if (config->mode == wippersnapper_display_v1_EPDMode_EPD_MODE_UNSPECIFIED) {
121121
WS_DEBUG_PRINTLN("[display] Unsupported EPD mode!");
122-
return false; // Unsupported mode
122+
return false;
123123
}
124124

125-
// TODO: If we already have a display driver assigned to this hardware
126-
// instance, clean it up!
125+
// If we already have a display driver assigned to this hardware instance,
126+
// clean it up!
127+
if (_drvDisp) {
128+
delete _drvDisp;
129+
_drvDisp = nullptr;
130+
}
127131

128132
// Parse all SPI bus pins
129133
// Check length
@@ -154,16 +158,21 @@ bool DisplayHardware::beginEPD(
154158
busy = (int16_t)atoi(spi_config->pin_busy + 1);
155159
}
156160

157-
// TODO: Configure SPI bus selection (UNUSED AS OF RIGHT NOW)
161+
// Configure SPI bus
162+
if (spi_config->bus != 0) {
163+
WS_DEBUG_PRINTLN(
164+
"[display] ERROR: Non-default SPI buses are currently not supported!");
165+
return false;
166+
}
158167

159-
// For "magtag" component name, attempt to autodetect the driver
168+
// For "magtag" component name, attempt to autodetect the driver type
160169
if (strncmp(_name, "magtag", 6) == 0) {
161170
if (detect_ssd1680(cs, dc, rst)) {
162171
// Detected SSD1680, use EAAMFGN driver
163172
strncpy(_name, "thinkink-gs4-eaamfgn", sizeof(_name) - 1);
164173
_name[sizeof(_name) - 1] = '\0';
165174
} else {
166-
// Did not detect SSD1680, use T5 driver
175+
// Did not detect SSD1680, use IL0373 driver
167176
strncpy(_name, "thinkink-gs4-t5", sizeof(_name) - 1);
168177
_name[sizeof(_name) - 1] = '\0';
169178
}
@@ -205,11 +214,9 @@ const char *DisplayHardware::getName() { return _name; }
205214
The message to display.
206215
*/
207216
void DisplayHardware::writeMessage(const char *message) {
208-
if (_drvDisp) {
209-
_drvDisp->writeMessage(message);
210-
} else {
211-
WS_DEBUG_PRINTLN("[display] No display driver initialized!");
212-
}
217+
if (!_drvDisp)
218+
return;
219+
_drvDisp->writeMessage(message);
213220
}
214221

215222
/*!

0 commit comments

Comments
 (0)