Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
 into xfw-dev
  • Loading branch information
Willy-JL committed May 29, 2023
2 parents 5c02038 + 7b426b9 commit 75b939a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions lib/digital_signal/digital_signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,12 @@ void digital_signal_prepare_arr(DigitalSignal* signal) {
uint32_t edge_scaled = (internals->factor * signal->edge_timings[pos]) / (1024 * 1024);
uint32_t pulse_duration = edge_scaled + internals->reload_reg_remainder;
if(pulse_duration < 10 || pulse_duration > 10000000) {
FURI_LOG_D(
/*FURI_LOG_D(
TAG,
"[prepare] pulse_duration out of range: %lu = %lu * %llu",
pulse_duration,
signal->edge_timings[pos],
internals->factor);
internals->factor);*/
pulse_duration = 100;
}
uint32_t pulse_ticks = (pulse_duration + T_TIM_DIV2) / T_TIM;
Expand Down Expand Up @@ -482,13 +482,13 @@ static void digital_sequence_finish(DigitalSequence* sequence) {
prev_timer = DWT->CYCCNT;
}
if(DWT->CYCCNT - prev_timer > wait_ticks) {
FURI_LOG_D(
/*FURI_LOG_D(
TAG,
"[SEQ] hung %lu ms in finish (ARR 0x%08lx, read %lu, write %lu)",
wait_ms,
TIM2->ARR,
dma_buffer->read_pos,
dma_buffer->write_pos);
dma_buffer->write_pos);*/
break;
}
} while(1);
Expand Down Expand Up @@ -516,13 +516,13 @@ static void digital_sequence_queue_pulse(DigitalSequence* sequence, uint32_t len
prev_timer = DWT->CYCCNT;
}
if(DWT->CYCCNT - prev_timer > wait_ticks) {
FURI_LOG_D(
/*FURI_LOG_D(
TAG,
"[SEQ] hung %lu ms in queue (ARR 0x%08lx, read %lu, write %lu)",
wait_ms,
TIM2->ARR,
dma_buffer->read_pos,
dma_buffer->write_pos);
dma_buffer->write_pos);*/
break;
}
} while(1);
Expand Down
24 changes: 12 additions & 12 deletions lib/nfc/protocols/nfcv.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ReturnCode nfcv_read_blocks(NfcVReader* reader, NfcVData* nfcv_data) {
uint16_t received = 0;
for(size_t block = 0; block < nfcv_data->block_num; block++) {
uint8_t rxBuf[32];
FURI_LOG_D(TAG, "Reading block %d/%d", block, (nfcv_data->block_num - 1));
//FURI_LOG_D(TAG, "Reading block %d/%d", block, (nfcv_data->block_num - 1));

ReturnCode ret = ERR_NONE;
for(int tries = 0; tries < NFCV_COMMAND_RETRIES; tries++) {
Expand All @@ -64,18 +64,18 @@ ReturnCode nfcv_read_blocks(NfcVReader* reader, NfcVData* nfcv_data) {
}
}
if(ret != ERR_NONE) {
FURI_LOG_D(TAG, "failed to read: %d", ret);
//FURI_LOG_D(TAG, "failed to read: %d", ret);
return ret;
}
memcpy(
&(nfcv_data->data[block * nfcv_data->block_size]), &rxBuf[1], nfcv_data->block_size);
FURI_LOG_D(
/*FURI_LOG_D(
TAG,
" %02X %02X %02X %02X",
nfcv_data->data[block * nfcv_data->block_size + 0],
nfcv_data->data[block * nfcv_data->block_size + 1],
nfcv_data->data[block * nfcv_data->block_size + 2],
nfcv_data->data[block * nfcv_data->block_size + 3]);
nfcv_data->data[block * nfcv_data->block_size + 3]);*/
}

return ERR_NONE;
Expand All @@ -86,7 +86,7 @@ ReturnCode nfcv_read_sysinfo(FuriHalNfcDevData* nfc_data, NfcVData* nfcv_data) {
uint16_t received = 0;
ReturnCode ret = ERR_NONE;

FURI_LOG_D(TAG, "Read SYSTEM INFORMATION...");
//FURI_LOG_D(TAG, "Read SYSTEM INFORMATION...");

for(int tries = 0; tries < NFCV_COMMAND_RETRIES; tries++) {
/* TODO: needs proper abstraction via fury_hal(_ll)_* */
Expand All @@ -110,7 +110,7 @@ ReturnCode nfcv_read_sysinfo(FuriHalNfcDevData* nfc_data, NfcVData* nfcv_data) {
nfcv_data->block_num = rxBuf[NFCV_UID_LENGTH + 4] + 1;
nfcv_data->block_size = rxBuf[NFCV_UID_LENGTH + 5] + 1;
nfcv_data->ic_ref = rxBuf[NFCV_UID_LENGTH + 6];
FURI_LOG_D(
/*FURI_LOG_D(
TAG,
" UID: %02X %02X %02X %02X %02X %02X %02X %02X",
nfc_data->uid[0],
Expand All @@ -128,10 +128,10 @@ ReturnCode nfcv_read_sysinfo(FuriHalNfcDevData* nfc_data, NfcVData* nfcv_data) {
nfcv_data->afi,
nfcv_data->block_num,
nfcv_data->block_size,
nfcv_data->ic_ref);
nfcv_data->ic_ref);*/
return ret;
}
FURI_LOG_D(TAG, "Failed: %d", ret);
//FURI_LOG_D(TAG, "Failed: %d", ret);

return ret;
}
Expand Down Expand Up @@ -1081,9 +1081,9 @@ void nfcv_emu_sniff_packet(
break;
}

if(strlen(nfcv_data->last_command) > 0) {
/*if(strlen(nfcv_data->last_command) > 0) {
FURI_LOG_D(TAG, "Received command %s", nfcv_data->last_command);
}
}*/
}

void nfcv_emu_init(FuriHalNfcDevData* nfc_data, NfcVData* nfcv_data) {
Expand Down Expand Up @@ -1137,7 +1137,7 @@ void nfcv_emu_init(FuriHalNfcDevData* nfc_data, NfcVData* nfcv_data) {
}
}

FURI_LOG_D(TAG, "Starting NfcV emulation");
/*FURI_LOG_D(TAG, "Starting NfcV emulation");
FURI_LOG_D(
TAG,
" UID: %02X %02X %02X %02X %02X %02X %02X %02X",
Expand All @@ -1148,7 +1148,7 @@ void nfcv_emu_init(FuriHalNfcDevData* nfc_data, NfcVData* nfcv_data) {
nfc_data->uid[4],
nfc_data->uid[5],
nfc_data->uid[6],
nfc_data->uid[7]);
nfc_data->uid[7]);*/

switch(nfcv_data->sub_type) {
case NfcVTypeSlixL:
Expand Down

0 comments on commit 75b939a

Please sign in to comment.