updates
This commit is contained in:
@@ -361,6 +361,7 @@ void ctaphid_handle_packet(uint8_t * pkt_raw)
|
||||
uint32_t newcid;
|
||||
static CTAPHID_WRITE_BUFFER wb;
|
||||
uint32_t active_cid;
|
||||
uint32_t t1,t2;
|
||||
|
||||
CTAP_RESPONSE ctap_resp;
|
||||
|
||||
@@ -542,9 +543,13 @@ void ctaphid_handle_packet(uint8_t * pkt_raw)
|
||||
wb.cmd = CTAPHID_CBOR;
|
||||
wb.bcnt = (ctap_resp.length+1);
|
||||
|
||||
|
||||
t1 = millis();
|
||||
ctaphid_write(&wb, &status, 1);
|
||||
ctaphid_write(&wb, ctap_resp.data, ctap_resp.length);
|
||||
ctaphid_write(&wb, NULL, 0);
|
||||
t2 = millis();
|
||||
printf1(TAG_TIME,"CBOR writeback: %d ms\n",(uint32_t)(t2-t1));
|
||||
break;
|
||||
|
||||
case CTAPHID_MSG:
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
void device_init();
|
||||
|
||||
uint64_t millis();
|
||||
uint32_t millis();
|
||||
|
||||
// HID message size in bytes
|
||||
#define HID_MESSAGE_SIZE 64
|
||||
|
23
fido2/main.c
23
fido2/main.c
@@ -5,7 +5,7 @@
|
||||
#include "cbor.h"
|
||||
#include "device.h"
|
||||
#include "ctaphid.h"
|
||||
#include "bsp.h"
|
||||
//#include "bsp.h"
|
||||
#include "util.h"
|
||||
#include "log.h"
|
||||
#include "ctap.h"
|
||||
@@ -16,23 +16,24 @@
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
int count = 0;
|
||||
uint64_t t1 = 0;
|
||||
uint64_t t2 = 0;
|
||||
uint64_t accum = 0;
|
||||
uint32_t t1 = 0;
|
||||
uint32_t t2 = 0;
|
||||
uint32_t accum = 0;
|
||||
uint32_t dt = 0;
|
||||
uint8_t hidmsg[64];
|
||||
|
||||
set_logging_mask(
|
||||
/*0*/
|
||||
TAG_GEN|
|
||||
// TAG_GEN|
|
||||
/*TAG_MC |*/
|
||||
/*TAG_GA |*/
|
||||
/*TAG_CP |*/
|
||||
TAG_CTAP|
|
||||
TAG_HID|
|
||||
// TAG_CTAP|
|
||||
// TAG_HID|
|
||||
/*TAG_U2F|*/
|
||||
/*TAG_PARSE |*/
|
||||
/*TAG_TIME|*/
|
||||
TAG_DUMP|
|
||||
TAG_TIME|
|
||||
// TAG_DUMP|
|
||||
/*TAG_GREEN|*/
|
||||
/*TAG_RED|*/
|
||||
TAG_ERR
|
||||
@@ -67,7 +68,9 @@ int main(int argc, char * argv[])
|
||||
t2 = millis();
|
||||
ctaphid_handle_packet(hidmsg);
|
||||
accum += millis() - t2;
|
||||
printf1(TAG_TIME,"accum: %lu\n", (uint32_t)accum);
|
||||
printf1(TAG_TIME,"accum: %d\n", (uint32_t)accum);
|
||||
printf1(TAG_TIME,"dt: %d\n", t2 - dt);
|
||||
dt = t2;
|
||||
memset(hidmsg, 0, sizeof(hidmsg));
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user