mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-13 10:43:01 +08:00
chg: i2c.. swapped
This commit is contained in:
parent
bda57d3818
commit
c6eb251bfb
1 changed files with 1 additions and 3 deletions
|
@ -311,13 +311,11 @@ bool I2C_WriteByte(uint8_t data, uint8_t device_cmd, uint8_t device_address) {
|
||||||
// len = uint8 (max buffer to write 256bytes)
|
// len = uint8 (max buffer to write 256bytes)
|
||||||
bool I2C_BufferWrite(uint8_t *data, uint8_t len, uint8_t device_cmd, uint8_t device_address) {
|
bool I2C_BufferWrite(uint8_t *data, uint8_t len, uint8_t device_cmd, uint8_t device_address) {
|
||||||
bool bBreak = true;
|
bool bBreak = true;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (!I2C_Start())
|
if (!I2C_Start())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
I2C_SendByte(device_address & 0xFE);
|
I2C_SendByte(device_address & 0xFE);
|
||||||
|
|
||||||
if (!I2C_WaitAck())
|
if (!I2C_WaitAck())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -529,7 +527,7 @@ bool GetATR(smart_card_atr_t *card_ptr) {
|
||||||
|
|
||||||
// Send ATR
|
// Send ATR
|
||||||
// start [C0 01] stop
|
// start [C0 01] stop
|
||||||
I2C_WriteCmd(I2C_DEVICE_CMD_GENERATE_ATR, I2C_DEVICE_ADDRESS_MAIN);
|
I2C_WriteByte(0x00, I2C_DEVICE_CMD_GENERATE_ATR, I2C_DEVICE_ADDRESS_MAIN);
|
||||||
|
|
||||||
// variable delay here.
|
// variable delay here.
|
||||||
if (!WaitSCL_L_300ms()) {
|
if (!WaitSCL_L_300ms()) {
|
||||||
|
|
Loading…
Reference in a new issue