mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
chg: i2c clean up
This commit is contained in:
parent
2102b19d11
commit
684a692bb0
2 changed files with 3 additions and 18 deletions
|
@ -387,9 +387,10 @@ int CmdSmartSetClock(const char *Cmd){
|
||||||
PrintAndLogEx(WARNING, "smart card set clock failed");
|
PrintAndLogEx(WARNING, "smart card set clock failed");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (clock) {
|
switch (clock) {
|
||||||
case 0:
|
case 0:
|
||||||
PrintAndLogEx(SUCCESS, "Clock changed to 16mhz given 10800 baudrate");
|
PrintAndLogEx(SUCCESS, "Clock changed to 16mhz giving 10800 baudrate");
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
PrintAndLogEx(SUCCESS, "Clock changed to 8mhz giving 21600 baudrate");
|
PrintAndLogEx(SUCCESS, "Clock changed to 8mhz giving 21600 baudrate");
|
||||||
|
|
16
common/i2c.c
16
common/i2c.c
|
@ -607,11 +607,9 @@ void SmartCardRaw( uint64_t arg0, uint64_t arg1, uint8_t *data ) {
|
||||||
// arg1 = len 5
|
// arg1 = len 5
|
||||||
I2C_BufferWrite(data, arg1, I2C_DEVICE_CMD_SEND, I2C_DEVICE_ADDRESS_MAIN);
|
I2C_BufferWrite(data, arg1, I2C_DEVICE_CMD_SEND, I2C_DEVICE_ADDRESS_MAIN);
|
||||||
|
|
||||||
//wait for sim card to answer.
|
|
||||||
if ( !I2C_WaitForSim() )
|
if ( !I2C_WaitForSim() )
|
||||||
goto OUT;
|
goto OUT;
|
||||||
|
|
||||||
// read response
|
|
||||||
len = I2C_BufferRead(resp, ISO7618_MAX_FRAME, I2C_DEVICE_CMD_READ, I2C_DEVICE_ADDRESS_MAIN);
|
len = I2C_BufferRead(resp, ISO7618_MAX_FRAME, I2C_DEVICE_CMD_READ, I2C_DEVICE_ADDRESS_MAIN);
|
||||||
LogTrace(resp, len, 0, 0, NULL, false);
|
LogTrace(resp, len, 0, 0, NULL, false);
|
||||||
}
|
}
|
||||||
|
@ -681,20 +679,6 @@ void SmartCardUpgrade(uint64_t arg0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SmartCardSetBaud(uint64_t arg0) {
|
void SmartCardSetBaud(uint64_t arg0) {
|
||||||
|
|
||||||
LED_D_ON();
|
|
||||||
clear_trace();
|
|
||||||
set_tracing(true);
|
|
||||||
I2C_Reset_EnterMainProgram();
|
|
||||||
|
|
||||||
bool isOK = true;
|
|
||||||
//uint16_t baud = arg0;
|
|
||||||
// Send SET BAUD
|
|
||||||
// start [C0 04] stop
|
|
||||||
//I2C_WriteByte(0x00, I2C_DEVICE_CMD_SETBAUD, I2C_DEVICE_ADDRESS_MAIN);
|
|
||||||
|
|
||||||
cmd_send(CMD_ACK, isOK, 0, 0, 0, 0);
|
|
||||||
LED_D_OFF();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SmartCardSetClock(uint64_t arg0) {
|
void SmartCardSetClock(uint64_t arg0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue