Skip to content
This repository was archived by the owner on Feb 25, 2021. It is now read-only.

Commit fd65ff8

Browse files
author
Johannes Formann
committed
Init I2C after reading configuration to enable using other pins
1 parent 56333e5 commit fd65ff8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ void setup( void ) {
137137
Serial.begin( 115200 );
138138
Serial.println( "Setup()" );
139139

140-
Wire.begin( ( int )steerConfig.gpioSDA, ( int )steerConfig.gpioSCL, steerConfig.i2cBusSpeed );
141-
142140
pinMode( 13, OUTPUT );
143141
digitalWrite( 13, LOW );
144142

@@ -158,6 +156,9 @@ void setup( void ) {
158156
writeEeprom();
159157
}
160158

159+
// Init I2C
160+
Wire.begin( ( int )steerConfig.gpioSDA, ( int )steerConfig.gpioSCL, steerConfig.i2cBusSpeed );
161+
161162
#if defined(ESP32)
162163
WiFi.setHostname( steerConfig.hostname );
163164
#else
@@ -1025,4 +1026,3 @@ void loop( void ) {
10251026
dnsServer.processNextRequest();
10261027
vTaskDelay( 100 );
10271028
}
1028-

0 commit comments

Comments
 (0)