Skip to content

Commit 0f7d5fb

Browse files
authored
Merge pull request #358 from brentru/register-components-first
Initialize component classes first and rebuild with Adafruit MQTT v2.5.0
2 parents e2a8c65 + f356e59 commit 0f7d5fb

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-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.53
2+
version=1.0.0-beta.54
33
author=Adafruit
44
maintainer=Adafruit <[email protected]>
55
sentence=Arduino client for Adafruit.io WipperSnapper

src/Wippersnapper.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1874,6 +1874,22 @@ void Wippersnapper::connect() {
18741874
_status = WS_IDLE;
18751875
WS._boardStatus = WS_BOARD_DEF_IDLE;
18761876

1877+
// Initialize components and buses
1878+
WS_DEBUG_PRINTLN("Initializing component instances...");
1879+
#ifdef ARDUINO_ARCH_ESP32
1880+
WS_DEBUG_PRINT("LEDC: ");
1881+
WS._ledc = new ws_ledc();
1882+
WS_DEBUG_PRINTLN("OK!");
1883+
#endif
1884+
1885+
WS_DEBUG_PRINT("SERVO: ");
1886+
WS._servoComponent = new ws_servo();
1887+
WS_DEBUG_PRINTLN("OK!");
1888+
1889+
WS_DEBUG_PRINT("DS18x20: ");
1890+
WS._ds18x20Component = new ws_ds18x20();
1891+
WS_DEBUG_PRINTLN("OK!");
1892+
18771893
if (!validateAppCreds())
18781894
haltError("Unable to validate application credentials.");
18791895

@@ -1915,22 +1931,6 @@ void Wippersnapper::connect() {
19151931
publishPinConfigComplete();
19161932
WS_DEBUG_PRINTLN("Hardware configured successfully!");
19171933

1918-
// Register components
1919-
WS_DEBUG_PRINTLN("Initializing component instances...");
1920-
#ifdef ARDUINO_ARCH_ESP32
1921-
WS_DEBUG_PRINT("LEDC: ");
1922-
WS._ledc = new ws_ledc();
1923-
WS_DEBUG_PRINTLN("OK!");
1924-
#endif
1925-
1926-
WS_DEBUG_PRINT("SERVO: ");
1927-
WS._servoComponent = new ws_servo();
1928-
WS_DEBUG_PRINTLN("OK!");
1929-
1930-
WS_DEBUG_PRINT("DS18x20: ");
1931-
WS._ds18x20Component = new ws_ds18x20();
1932-
WS_DEBUG_PRINTLN("OK!");
1933-
19341934
// goto application
19351935
statusLEDFade(GREEN, 3);
19361936
WS_DEBUG_PRINTLN(

src/Wippersnapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
#endif
6868

6969
#define WS_VERSION \
70-
"1.0.0-beta.53" ///< WipperSnapper app. version (semver-formatted)
70+
"1.0.0-beta.54" ///< WipperSnapper app. version (semver-formatted)
7171

7272
// Reserved Adafruit IO MQTT topics
7373
#define TOPIC_IO_THROTTLE "/throttle" ///< Adafruit IO Throttle MQTT Topic

0 commit comments

Comments
 (0)