inc timeout of card's response
This commit is contained in:
10
common/i2c.c
10
common/i2c.c
@@ -161,10 +161,11 @@ bool WaitSCL_L(void) {
|
|||||||
return WaitSCL_L_delay(15000);
|
return WaitSCL_L_delay(15000);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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
|
// Which ever comes first
|
||||||
bool WaitSCL_L_300ms(void){
|
bool WaitSCL_L_timeout(void){
|
||||||
volatile uint16_t delay = 310;
|
volatile uint16_t delay = 1800;
|
||||||
while ( delay-- ) {
|
while ( delay-- ) {
|
||||||
// exit on SCL LOW
|
// exit on SCL LOW
|
||||||
if (!SCL_read)
|
if (!SCL_read)
|
||||||
@@ -193,7 +194,8 @@ bool I2C_Start(void) {
|
|||||||
|
|
||||||
bool I2C_WaitForSim() {
|
bool I2C_WaitForSim() {
|
||||||
|
|
||||||
if (!WaitSCL_L_300ms())
|
// wait for data from card
|
||||||
|
if (!WaitSCL_L_timeout())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// 8051 speaks with smart card.
|
// 8051 speaks with smart card.
|
||||||
|
|||||||
Reference in New Issue
Block a user