Reshuffle gatewayTransportInit() (#496)

This commit is contained in:
Olivier
2016-07-01 00:08:53 +02:00
committed by GitHub
parent 91af9b1730
commit 0a26d857aa
+14 -14
View File
@@ -81,20 +81,6 @@ void _begin() {
signerInit(); signerInit();
#if defined(MY_GATEWAY_FEATURE)
#if defined(MY_INCLUSION_BUTTON_FEATURE)
inclusionInit();
#endif
// initialize the transport driver
if (!gatewayTransportInit()) {
setIndication(INDICATION_ERR_INIT_GWTRANSPORT);
debug(PSTR("Transport driver init fail\n"));
// Nothing more we can do
_infiniteLoop();
}
#endif
// Read latest received controller configuration from EEPROM // Read latest received controller configuration from EEPROM
hwReadConfigBlock((void*)&_cc, (void*)EEPROM_CONTROLLER_CONFIG_ADDRESS, sizeof(ControllerConfig)); hwReadConfigBlock((void*)&_cc, (void*)EEPROM_CONTROLLER_CONFIG_ADDRESS, sizeof(ControllerConfig));
// isMetric is bool, hence empty EEPROM (=0xFF) evaluates to true // isMetric is bool, hence empty EEPROM (=0xFF) evaluates to true
@@ -145,6 +131,20 @@ void _begin() {
} }
#endif #endif
#if defined(MY_GATEWAY_FEATURE)
#if defined(MY_INCLUSION_BUTTON_FEATURE)
inclusionInit();
#endif
// initialize the transport driver
if (!gatewayTransportInit()) {
setIndication(INDICATION_ERR_INIT_GWTRANSPORT);
debug(PSTR("Transport driver init fail\n"));
// Nothing more we can do
_infiniteLoop();
}
#endif
// Call sketch setup // Call sketch setup
if (setup) if (setup)
setup(); setup();