Skip to content

Commit

Permalink
Move display array into function using it
Browse files Browse the repository at this point in the history
  • Loading branch information
bettse committed Jul 27, 2024
1 parent 3361e70 commit 61724f9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions seader_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
(FURI_HAL_NFC_LL_TXRX_FLAGS_CRC_TX_MANUAL | FURI_HAL_NFC_LL_TXRX_FLAGS_AGC_ON | \
FURI_HAL_NFC_LL_TXRX_FLAGS_PAR_RX_REMV | FURI_HAL_NFC_LL_TXRX_FLAGS_CRC_RX_KEEP)

char display[SEADER_UART_RX_BUF_SIZE * 2 + 1] = {0};

// Forward declaration
void seader_send_card_detected(SeaderUartBridge* seader_uart, CardDetails_t* cardDetails);

Expand Down Expand Up @@ -117,11 +115,14 @@ bool seader_worker_process_sam_message(Seader* seader, uint8_t* apdu, uint32_t l
if(len < 2) {
return false;
}
memset(display, 0, sizeof(display));

char* display = malloc(len * 2 + 1);
memset(display, 0, len * 2 + 1);
for(uint8_t i = 0; i < len; i++) {
snprintf(display + (i * 2), sizeof(display), "%02x", apdu[i]);
}
FURI_LOG_I(TAG, "APDU: %s", display);
free(display);

uint8_t SW1 = apdu[len - 2];
uint8_t SW2 = apdu[len - 1];
Expand Down

0 comments on commit 61724f9

Please sign in to comment.