replace macros with DEBUG_LEVEL aware timestamp function
This commit is contained in:
25
fido2/u2f.c
25
fido2/u2f.c
@@ -30,11 +30,6 @@ static CTAP_RESPONSE * _u2f_resp = NULL;
|
||||
void u2f_request(struct u2f_request_apdu* req, CTAP_RESPONSE * resp)
|
||||
{
|
||||
uint16_t rcode = 0;
|
||||
#ifdef ENABLE_U2F
|
||||
#if DEBUG_LEVEL > 0
|
||||
uint64_t t1,t2;
|
||||
#endif
|
||||
#endif
|
||||
uint32_t len = ((req->LC3) | ((uint32_t)req->LC2 << 8) | ((uint32_t)req->LC1 << 16));
|
||||
uint8_t byte;
|
||||
|
||||
@@ -62,26 +57,18 @@ void u2f_request(struct u2f_request_apdu* req, CTAP_RESPONSE * resp)
|
||||
}
|
||||
else
|
||||
{
|
||||
#if DEBUG_LEVEL > 0
|
||||
t1 = millis();
|
||||
#endif
|
||||
|
||||
timestamp();
|
||||
rcode = u2f_register((struct u2f_register_request*)req->payload);
|
||||
#if DEBUG_LEVEL > 0
|
||||
t2 = millis();
|
||||
printf1(TAG_TIME,"u2f_register time: %d ms\n", t2-t1);
|
||||
#endif
|
||||
printf1(TAG_TIME,"u2f_register time: %d ms\n", timestamp());
|
||||
|
||||
}
|
||||
break;
|
||||
case U2F_AUTHENTICATE:
|
||||
printf1(TAG_U2F, "U2F_AUTHENTICATE\n");
|
||||
#if DEBUG_LEVEL > 0
|
||||
t1 = millis();
|
||||
#endif
|
||||
timestamp();
|
||||
rcode = u2f_authenticate((struct u2f_authenticate_request*)req->payload, req->p1);
|
||||
#if DEBUG_LEVEL > 0
|
||||
t2 = millis();
|
||||
printf1(TAG_TIME,"u2f_authenticate time: %d ms\n", t2-t1);
|
||||
#endif
|
||||
printf1(TAG_TIME,"u2f_authenticate time: %d ms\n", timestamp());
|
||||
break;
|
||||
case U2F_VERSION:
|
||||
printf1(TAG_U2F, "U2F_VERSION\n");
|
||||
|
Reference in New Issue
Block a user