mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-14 10:36:58 -07:00
EVM fixes and additions (RRG repository PRs 78-82 by @merlokk) (#776)
This commit is contained in:
parent
fb27c73313
commit
4cdd63b245
11 changed files with 433 additions and 104 deletions
11
armsrc/i2c.c
11
armsrc/i2c.c
|
@ -257,10 +257,11 @@ static void I2C_Reset_EnterBootloader(void) {
|
|||
WaitMS(10);
|
||||
}
|
||||
|
||||
// Wait max 300ms or until SCL goes LOW.
|
||||
// Wait max 1800ms or until SCL goes LOW.
|
||||
// It timeout reading response from card
|
||||
// Which ever comes first
|
||||
static bool WaitSCL_L_300ms(void) {
|
||||
volatile uint16_t delay = 310;
|
||||
bool WaitSCL_L_timeout(void){
|
||||
volatile uint16_t delay = 1800;
|
||||
while ( delay-- ) {
|
||||
// exit on SCL LOW
|
||||
if (!SCL_read)
|
||||
|
@ -272,8 +273,8 @@ static bool WaitSCL_L_300ms(void) {
|
|||
}
|
||||
|
||||
static bool I2C_WaitForSim() {
|
||||
// variable delay here.
|
||||
if (!WaitSCL_L_300ms())
|
||||
// wait for data from card
|
||||
if (!WaitSCL_L_timeout())
|
||||
return false;
|
||||
|
||||
// 8051 speaks with smart card.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue