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

@@ -1359,9 +1359,6 @@ uint8_t ctap_request(uint8_t * pkt_raw, int length, CTAP_RESPONSE * resp)
CborEncoder encoder;
uint8_t status = 0;
uint8_t cmd = *pkt_raw;
#if DEBUG_LEVEL > 0
uint64_t t1,t2;
#endif
pkt_raw++;
length--;
@@ -1394,14 +1391,9 @@ uint8_t ctap_request(uint8_t * pkt_raw, int length, CTAP_RESPONSE * resp)
case CTAP_MAKE_CREDENTIAL:
device_set_status(CTAPHID_STATUS_PROCESSING);
printf1(TAG_CTAP,"CTAP_MAKE_CREDENTIAL\n");
#if DEBUG_LEVEL > 0
t1 = millis();
#endif
timestamp();
status = ctap_make_credential(&encoder, pkt_raw, length);
#if DEBUG_LEVEL > 0
t2 = millis();
printf1(TAG_TIME,"make_credential time: %d ms\n", t2-t1);
#endif
printf1(TAG_TIME,"make_credential time: %d ms\n", timestamp());
resp->length = cbor_encoder_get_buffer_size(&encoder, buf);
dump_hex1(TAG_DUMP, buf, resp->length);
@@ -1410,14 +1402,9 @@ uint8_t ctap_request(uint8_t * pkt_raw, int length, CTAP_RESPONSE * resp)
case CTAP_GET_ASSERTION:
device_set_status(CTAPHID_STATUS_PROCESSING);
printf1(TAG_CTAP,"CTAP_GET_ASSERTION\n");
#if DEBUG_LEVEL > 0
t1 = millis();
#endif
timestamp();
status = ctap_get_assertion(&encoder, pkt_raw, length);
#if DEBUG_LEVEL > 0
t2 = millis();
printf1(TAG_TIME,"get_assertion time: %d ms\n", t2-t1);
#endif
printf1(TAG_TIME,"get_assertion time: %d ms\n", timestamp());
resp->length = cbor_encoder_get_buffer_size(&encoder, buf);