@@ -20,9 +20,7 @@ EslovHandler::~EslovHandler()
20
20
21
21
bool EslovHandler::begin (bool passthrough)
22
22
{
23
- pinMode (_eslovIntPin, OUTPUT);
24
- digitalWrite (_eslovIntPin, LOW);
25
-
23
+ pinMode (_eslovIntPin, INPUT);
26
24
Wire.begin ();
27
25
Wire.setClock (400000 );
28
26
if (passthrough) {
@@ -40,16 +38,12 @@ void EslovHandler::update()
40
38
if (_rxBuffer[0 ] == HOST_DFU_EXTERNAL_OPCODE || _rxBuffer[0 ] == HOST_DFU_INTERNAL_OPCODE) {
41
39
if (_rxIndex == sizeof (DFUPacket) + 1 ) {
42
40
43
- toggleEslovIntPin ();
44
-
45
41
if (!_dfuLedOn) {
46
42
pinMode (LED_BUILTIN, OUTPUT);
47
43
digitalWrite (LED_BUILTIN, HIGH);
48
44
flushWire ();
49
45
}
50
46
51
- pinMode (_eslovIntPin, INPUT);
52
-
53
47
// Wait for Nicla to set _eslovIntPin HIGH, meaning that is ready to receive
54
48
while (!digitalRead (_eslovIntPin)) {
55
49
if (_debug) _debug->println (" Waiting for Eslov Int pin to be released" );
@@ -123,7 +117,6 @@ void EslovHandler::update()
123
117
} else if (_rxBuffer[0 ] == HOST_CONFIG_SENSOR_OPCODE) {
124
118
if (_rxIndex == sizeof (SensorConfigurationPacket) + 1 ) {
125
119
126
- toggleEslovIntPin ();
127
120
SensorConfigurationPacket* config = (SensorConfigurationPacket*)&_rxBuffer[1 ];
128
121
if (_debug) {
129
122
_debug->print (" received config: " );
@@ -276,28 +269,6 @@ bool EslovHandler::requestSensorLongData(SensorLongDataPacket &sData)
276
269
return true ;
277
270
}
278
271
279
- void EslovHandler::toggleEslovIntPin ()
280
- {
281
- if (!_intPinAsserted) {
282
- // Indicates eslov presence
283
- pinMode (_eslovIntPin, OUTPUT);
284
- digitalWrite (_eslovIntPin, LOW);
285
- _intPinAsserted = true ;
286
- if (_debug) {
287
- _debug->println (" Eslov int LOW" );
288
- }
289
- // Use 1 sec delay to let Nicla see the LOW pin and enable Eslov
290
- delay (500 );
291
-
292
- digitalWrite (_eslovIntPin, HIGH);
293
- _intPinCleared = true ;
294
- if (_debug) {
295
- _debug->println (" Eslov int pin cleared" );
296
- }
297
- delay (500 );
298
- }
299
- }
300
-
301
272
void EslovHandler::niclaAsShield ()
302
273
{
303
274
_eslovIntPin = I2C_INT_PIN;
0 commit comments