Remove carriage return \r for better debug.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2024-04-17 11:21:10 +02:00
parent 3d0a27c834
commit 019c5929a2
7 changed files with 25 additions and 25 deletions

View File

@@ -157,7 +157,7 @@ int driver_process_usb_nopacket_ccid() {
int driver_process_usb_packet_ccid(uint8_t itf, uint16_t rx_read) {
if (rx_read >= 10) {
driver_init_ccid(itf);
//printf("%ld %d %x %x\r\n",ccid_header->dwLength,rx_read-10,ccid_header->bMessageType,ccid_header->bSeq);
//printf("%ld %d %x %x\n",ccid_header->dwLength,rx_read-10,ccid_header->bMessageType,ccid_header->bSeq);
if (ccid_header[itf]->dwLength <= rx_read - 10) {
size_t apdu_sent = 0;
if (ccid_header[itf]->bMessageType != CCID_SLOT_STATUS) {
@@ -180,7 +180,7 @@ int driver_process_usb_packet_ccid(uint8_t itf, uint16_t rx_read) {
ccid_response[itf]->bSeq = ccid_header[itf]->bSeq;
ccid_response[itf]->abRFU0 = 0;
ccid_response[itf]->abRFU1 = 0;
//printf("1 %x %x %x || %x %x %x\r\n",ccid_response->apdu,apdu.rdata,ccid_response,ccid_header,ccid_header->apdu,apdu.data);
//printf("1 %x %x %x || %x %x %x\n",ccid_response->apdu,apdu.rdata,ccid_response,ccid_header,ccid_header->apdu,apdu.data);
memcpy(&ccid_response[itf]->apdu, ccid_atr + 1, size_atr);
if (ccid_status == 1) {
card_start(apdu_thread);
@@ -284,19 +284,19 @@ uint8_t *driver_prepare_response_ccid(uint8_t itf) {
#define MAX_USB_POWER 1
static void ccid_init_cb(void) {
TU_LOG1("-------- CCID INIT\r\n");
TU_LOG1("-------- CCID INIT\n");
vendord_init();
}
static void ccid_reset_cb(uint8_t rhport) {
TU_LOG1("-------- CCID RESET\r\n");
TU_LOG1("-------- CCID RESET\n");
itf_num = 0;
vendord_reset(rhport);
}
static uint16_t ccid_open(uint8_t rhport, tusb_desc_interface_t const *itf_desc, uint16_t max_len) {
uint8_t *itf_vendor = (uint8_t *) malloc(sizeof(uint8_t) * max_len);
//TU_LOG1("-------- CCID OPEN\r\n");
//TU_LOG1("-------- CCID OPEN\n");
TU_VERIFY(
itf_desc->bInterfaceClass == TUSB_CLASS_SMART_CARD && itf_desc->bInterfaceSubClass == 0 && itf_desc->bInterfaceProtocol == 0,
0);
@@ -327,13 +327,13 @@ static bool ccid_control_xfer_cb(uint8_t __unused rhport,
uint8_t stage,
tusb_control_request_t const *request) {
// nothing to do with DATA & ACK stage
TU_LOG2("-------- CCID CTRL XFER\r\n");
TU_LOG2("-------- CCID CTRL XFER\n");
if (stage != CONTROL_STAGE_SETUP) {
return true;
}
if (request->wIndex == itf_num) {
TU_LOG2("-------- bmRequestType %x, bRequest %x, wValue %x, wLength %x\r\n",
TU_LOG2("-------- bmRequestType %x, bRequest %x, wValue %x, wLength %x\n",
request->bmRequestType,
request->bRequest,
request->wValue,
@@ -371,7 +371,7 @@ static bool ccid_xfer_cb(uint8_t rhport,
uint8_t ep_addr,
xfer_result_t result,
uint32_t xferred_bytes) {
//printf("------ CALLED XFER_CB\r\n");
//printf("------ CALLED XFER_CB\n");
return vendord_xfer_cb(rhport, ep_addr, result, xferred_bytes);
//return true;
}

View File

@@ -283,7 +283,7 @@ void usb_task() {
uint32_t m = 0x0;
bool has_m = queue_try_remove(&card_to_usb_q, &m);
//if (m != 0)
// printf("\r\n ------ M = %lu\r\n",m);
// printf("\n ------ M = %lu\n",m);
if (has_m) {
if (m == EV_EXEC_FINISHED) {
timeout_stop();

View File

@@ -349,7 +349,7 @@ bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_requ
if (request->bRequest == 0x22) {
web_serial_connected = (request->wValue != 0);
if (web_serial_connected) {
printf("\r\nWebUSB interface connected\r\n");
printf("\nWebUSB interface connected\n");
}
return tud_control_status(rhport, request);
}