Skip to content

Commit 0a26d85

Browse files
authored
Reshuffle gatewayTransportInit() (#496)
1 parent 91af9b1 commit 0a26d85

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

libraries/MySensors/core/MySensorsCore.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,6 @@ void _begin() {
8181

8282
signerInit();
8383

84-
#if defined(MY_GATEWAY_FEATURE)
85-
#if defined(MY_INCLUSION_BUTTON_FEATURE)
86-
inclusionInit();
87-
#endif
88-
89-
// initialize the transport driver
90-
if (!gatewayTransportInit()) {
91-
setIndication(INDICATION_ERR_INIT_GWTRANSPORT);
92-
debug(PSTR("Transport driver init fail\n"));
93-
// Nothing more we can do
94-
_infiniteLoop();
95-
}
96-
97-
#endif
9884
// Read latest received controller configuration from EEPROM
9985
hwReadConfigBlock((void*)&_cc, (void*)EEPROM_CONTROLLER_CONFIG_ADDRESS, sizeof(ControllerConfig));
10086
// isMetric is bool, hence empty EEPROM (=0xFF) evaluates to true
@@ -144,7 +130,21 @@ void _begin() {
144130
hwWriteConfig(EEPROM_NODE_LOCK_COUNTER, MY_NODE_LOCK_COUNTER_MAX);
145131
}
146132
#endif
133+
134+
#if defined(MY_GATEWAY_FEATURE)
135+
#if defined(MY_INCLUSION_BUTTON_FEATURE)
136+
inclusionInit();
137+
#endif
147138

139+
// initialize the transport driver
140+
if (!gatewayTransportInit()) {
141+
setIndication(INDICATION_ERR_INIT_GWTRANSPORT);
142+
debug(PSTR("Transport driver init fail\n"));
143+
// Nothing more we can do
144+
_infiniteLoop();
145+
}
146+
#endif
147+
148148
// Call sketch setup
149149
if (setup)
150150
setup();

0 commit comments

Comments
 (0)