mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
minor adaptations to timings
This commit is contained in:
parent
e364d7e03d
commit
4c9c0b5264
1 changed files with 6 additions and 4 deletions
10
armsrc/i2c.c
10
armsrc/i2c.c
|
@ -167,7 +167,7 @@ static bool WaitSCL_H_delay(uint32_t delay) {
|
||||||
// 5000 * 3.07us = 15350us. 15.35ms
|
// 5000 * 3.07us = 15350us. 15.35ms
|
||||||
// 15000 * 3.07us = 46050us. 46.05ms
|
// 15000 * 3.07us = 46050us. 46.05ms
|
||||||
static bool WaitSCL_H(void) {
|
static bool WaitSCL_H(void) {
|
||||||
return WaitSCL_H_delay(15000);
|
return WaitSCL_H_delay(5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool WaitSCL_L_delay(uint32_t delay) {
|
static bool WaitSCL_L_delay(uint32_t delay) {
|
||||||
|
@ -179,19 +179,21 @@ static bool WaitSCL_L_delay(uint32_t delay) {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 5000 * 3.07us = 15350us. 15.35ms
|
// 5000 * 3.07us = 15350us. 15.35ms
|
||||||
|
// 15000 * 3.07us = 46050us. 46.05ms
|
||||||
static bool WaitSCL_L(void) {
|
static bool WaitSCL_L(void) {
|
||||||
return WaitSCL_L_delay(15000);
|
return WaitSCL_L_delay(5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait max 1800ms or until SCL goes LOW.
|
// Wait max 1800ms or until SCL goes LOW.
|
||||||
// It timeout reading response from card
|
// It timeout reading response from card
|
||||||
// Which ever comes first
|
// Which ever comes first
|
||||||
static bool WaitSCL_L_timeout(void) {
|
static bool WaitSCL_L_timeout(void) {
|
||||||
volatile uint32_t delay = 1700;
|
volatile uint32_t delay = 200;
|
||||||
while (delay--) {
|
while (delay--) {
|
||||||
// exit on SCL LOW
|
// exit on SCL LOW
|
||||||
if (!SCL_read)
|
if (SCL_read == false)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
WaitMS(1);
|
WaitMS(1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue