diff --git a/firmware/src/lib/aime.c b/firmware/src/lib/aime.c index ed5340b..ca1fd6a 100644 --- a/firmware/src/lib/aime.c +++ b/firmware/src/lib/aime.c @@ -171,11 +171,6 @@ static void send_response() uint8_t sync = 0xe0; aime_putc(sync); - DEBUG(" -> %02x(%d)", response.status, response.status); - if (response.payload_len > 0) { - DEBUG(" [%d]", response.payload_len); - } - for (int i = 0; i < response.len; i++) { uint8_t c = response.raw[i]; checksum += c; @@ -188,6 +183,12 @@ static void send_response() } aime_putc(checksum); + + DEBUG("\n\033[33mResp %2d:%02x >>", response.payload_len, response.cmd); + for (int i = 0; i < response.payload_len; i++) { + DEBUG(" %02x", response.payload[i]); + } + DEBUG("\033[0m"); } static void send_simple_response(uint8_t status) @@ -379,6 +380,12 @@ static void cmd_led_rgb() static void handle_frame() { + DEBUG("\n\033[32mAime %d:%02x >>", request.payload_len, request.cmd); + for (int i = 0; i < request.payload_len; i++) { + DEBUG(" %02x", request.payload[i]); + } + DEBUG("\033[0m"); + switch (request.cmd) { case CMD_TO_NORMAL_MODE: DEBUG("\nAIME: cmd_to_normal"); diff --git a/firmware/src/lib/pn5180.c b/firmware/src/lib/pn5180.c index 08b3b11..f465eb3 100644 --- a/firmware/src/lib/pn5180.c +++ b/firmware/src/lib/pn5180.c @@ -369,9 +369,8 @@ bool pn5180_mifare_auth(const uint8_t uid[4], uint8_t block_id, uint8_t key_id, uint8_t response = 0; read_write(cmd, sizeof(cmd), &response, 1); - printf("\nAuth: block: %d, result:%d", block_id, response); if ((response == 1) || (response == 2)) { - printf("\nMifare auth failed: %d", response); + printf("\nMifare auth failed: %d, [%d:%d]", response, cmd[7], block_id); return false; } @@ -424,7 +423,6 @@ bool pn5180_felica_read(uint16_t svc_code, uint16_t block_id, uint8_t block_data return false; } - printf(" OK >> "); memcpy(block_data, out.data, 16); return true; }