@@ -110,7 +110,7 @@ boolean ATECCX08A::wakeUp()
110
110
void ATECCX08A::idleMode ()
111
111
{
112
112
_i2cPort->beginTransmission (_i2caddr); // set up to write to address
113
- _i2cPort->write_byte (WORD_ADDRESS_VALUE_IDLE); // enter idle command (aka word address - the first part of every communication to the IC)
113
+ _i2cPort->write (WORD_ADDRESS_VALUE_IDLE); // enter idle command (aka word address - the first part of every communication to the IC)
114
114
_i2cPort->endTransmission (); // actually send it
115
115
}
116
116
@@ -488,9 +488,9 @@ boolean ATECCX08A::receiveResponseData(uint8_t length, boolean debug)
488
488
489
489
requestAttempts++;
490
490
491
- while (_i2cPort->available2 ()) // slave may send less than requested
491
+ while (_i2cPort->available ()) // slave may send less than requested
492
492
{
493
- uint8_t value = _i2cPort->read2 ();
493
+ uint8_t value = _i2cPort->read ();
494
494
495
495
/* Make sure not to read beyond buffer size */
496
496
if (countGlobal < sizeof (inputBuffer))
@@ -503,7 +503,7 @@ boolean ATECCX08A::receiveResponseData(uint8_t length, boolean debug)
503
503
if (requestAttempts == ATRCC508A_MAX_RETRIES)
504
504
break ; // this probably means that the device is not responding.
505
505
}
506
- # if 0
506
+
507
507
if (debug)
508
508
{
509
509
_debugSerial->print (" inputBuffer: " );
@@ -514,7 +514,6 @@ boolean ATECCX08A::receiveResponseData(uint8_t length, boolean debug)
514
514
}
515
515
_debugSerial->println ();
516
516
}
517
- #endif
518
517
519
518
return true ;
520
519
}
@@ -791,16 +790,6 @@ boolean ATECCX08A::read_output(uint8_t zone, uint16_t address, uint8_t length, u
791
790
/* Copy data to output */
792
791
if (output)
793
792
{
794
- #if 0
795
- uprintf("inputBuffer: ");
796
- for (i = 0; i < RESPONSE_COUNT_SIZE + length + CRC_SIZE; ++i)
797
- {
798
- if (inputBuffer[i] >> 4 == 0)
799
- uprintf("0");
800
- uprintf("%x ", inputBuffer[i]);
801
- }
802
- uprintf("\r\n");
803
- #endif
804
793
memcpy (output, inputBuffer + RESPONSE_READ_INDEX, length);
805
794
}
806
795
@@ -856,8 +845,6 @@ boolean ATECCX08A::write(uint8_t zone, uint16_t address, uint8_t *data, uint8_t
856
845
// If we hear a "0x00", that means it had a successful write
857
846
if (inputBuffer[RESPONSE_SIGNAL_INDEX] != ATRCC508A_SUCCESSFUL_WRITE)
858
847
{
859
- uprintf (" Write error code: %x\r\n " , inputBuffer[RESPONSE_SIGNAL_INDEX]);
860
-
861
848
goto error;
862
849
}
863
850
@@ -1185,7 +1172,7 @@ boolean ATECCX08A::sendCommand(uint8_t command_opcode, uint8_t param1, uint16_t
1185
1172
wakeUp ();
1186
1173
1187
1174
_i2cPort->beginTransmission (_i2caddr);
1188
- _i2cPort->write2 (total_transmission, total_transmission_length);
1175
+ _i2cPort->write (total_transmission, total_transmission_length);
1189
1176
_i2cPort->endTransmission ();
1190
1177
1191
1178
err = true ;
0 commit comments