@@ -14,7 +14,6 @@ Arduino_BHY2::Arduino_BHY2() :
14
14
_debug(NULL ),
15
15
_pingTime(0 ),
16
16
_timeout(120000 ),
17
- _timeoutExpired(false ),
18
17
_eslovActive(false ),
19
18
_startTime(0 ),
20
19
_eslovIntPin(PIN_ESLOV_INT),
@@ -37,25 +36,18 @@ void Arduino_BHY2::pingI2C() {
37
36
}
38
37
39
38
void Arduino_BHY2::checkEslovInt () {
40
- if (millis () - _startTime < _timeout) {
41
- // Timeout didn't expire yet
42
- if (!digitalRead (_eslovIntPin)) {
43
- // Wait for MKR to clear Eslov Int pin
44
- while (!digitalRead (_eslovIntPin)) {}
45
- if (_debug) _debug->println (" MKR released Eslov Int pin" );
46
-
47
- // Change mode for Eslov Int pin
48
- // Eslov Int Pin will be used to synchronize Dfu via Eslov
49
- pinMode (_eslovIntPin, OUTPUT);
50
-
51
- eslovHandler.begin ();
52
- // Eslov has been activated
53
- _eslovActive = true ;
54
- }
55
- } else {
56
- // Timeout expired
57
- _timeoutExpired = true ;
58
- nicla::disableLDO ();
39
+ if (!digitalRead (_eslovIntPin)) {
40
+ // Wait for MKR to clear Eslov Int pin
41
+ while (!digitalRead (_eslovIntPin)) {}
42
+ if (_debug) _debug->println (" MKR released Eslov Int pin" );
43
+
44
+ // Change mode for Eslov Int pin
45
+ // Eslov Int Pin will be used to synchronize Dfu via Eslov
46
+ pinMode (_eslovIntPin, OUTPUT);
47
+
48
+ eslovHandler.begin ();
49
+ // Eslov has been activated
50
+ _eslovActive = true ;
59
51
}
60
52
}
61
53
@@ -122,7 +114,7 @@ void Arduino_BHY2::update()
122
114
pingI2C ();
123
115
124
116
if (_niclaConfig & NICLA_I2C) {
125
- if (!_timeoutExpired && ! _eslovActive) {
117
+ if (!_eslovActive) {
126
118
checkEslovInt ();
127
119
}
128
120
}
0 commit comments