Skip to content

Commit 640d195

Browse files
Fixing function calls to original ones
1 parent 2544540 commit 640d195

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

src/SparkFun_ATECCX08a_Arduino_Library.cpp

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ boolean ATECCX08A::wakeUp()
110110
void ATECCX08A::idleMode()
111111
{
112112
_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)
114114
_i2cPort->endTransmission(); // actually send it
115115
}
116116

@@ -488,9 +488,9 @@ boolean ATECCX08A::receiveResponseData(uint8_t length, boolean debug)
488488

489489
requestAttempts++;
490490

491-
while (_i2cPort->available2()) // slave may send less than requested
491+
while (_i2cPort->available()) // slave may send less than requested
492492
{
493-
uint8_t value = _i2cPort->read2();
493+
uint8_t value = _i2cPort->read();
494494

495495
/* Make sure not to read beyond buffer size */
496496
if (countGlobal < sizeof(inputBuffer))
@@ -503,7 +503,7 @@ boolean ATECCX08A::receiveResponseData(uint8_t length, boolean debug)
503503
if (requestAttempts == ATRCC508A_MAX_RETRIES)
504504
break; // this probably means that the device is not responding.
505505
}
506-
#if 0
506+
507507
if (debug)
508508
{
509509
_debugSerial->print("inputBuffer: ");
@@ -514,7 +514,6 @@ boolean ATECCX08A::receiveResponseData(uint8_t length, boolean debug)
514514
}
515515
_debugSerial->println();
516516
}
517-
#endif
518517

519518
return true;
520519
}
@@ -791,16 +790,6 @@ boolean ATECCX08A::read_output(uint8_t zone, uint16_t address, uint8_t length, u
791790
/* Copy data to output */
792791
if (output)
793792
{
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
804793
memcpy(output, inputBuffer + RESPONSE_READ_INDEX, length);
805794
}
806795

@@ -856,8 +845,6 @@ boolean ATECCX08A::write(uint8_t zone, uint16_t address, uint8_t *data, uint8_t
856845
// If we hear a "0x00", that means it had a successful write
857846
if (inputBuffer[RESPONSE_SIGNAL_INDEX] != ATRCC508A_SUCCESSFUL_WRITE)
858847
{
859-
uprintf("Write error code: %x\r\n", inputBuffer[RESPONSE_SIGNAL_INDEX]);
860-
861848
goto error;
862849
}
863850

@@ -1185,7 +1172,7 @@ boolean ATECCX08A::sendCommand(uint8_t command_opcode, uint8_t param1, uint16_t
11851172
wakeUp();
11861173

11871174
_i2cPort->beginTransmission(_i2caddr);
1188-
_i2cPort->write2(total_transmission, total_transmission_length);
1175+
_i2cPort->write(total_transmission, total_transmission_length);
11891176
_i2cPort->endTransmission();
11901177

11911178
err = true;

src/SparkFun_ATECCX08a_Arduino_Library.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#define CONFIG_ZONE_SIZE 128
4242
#define SERIAL_NUMBER_SIZE 10
4343

44+
#define RANDOM_BYTES_BLOCK_SIZE 32
4445
#define SHA256_SIZE 32
4546
#define PUBLIC_KEY_SIZE 64
4647
#define SIGNATURE_SIZE 64

0 commit comments

Comments
 (0)