replace macros with DEBUG_LEVEL aware timestamp function

This commit is contained in:
Conor Patrick
2019-02-12 20:28:48 -05:00
parent e7e83820a9
commit 831976f3a2
6 changed files with 30 additions and 61 deletions

View File

@@ -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");