summaryrefslogtreecommitdiff
path: root/openpicc/application/ssc_picc.c
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-12-15 12:52:35 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-12-15 12:52:35 +0000
commitbcc75d30ce0fb09618f82bb70cdde82094e86ed8 (patch)
tree88a5f5859842ccd5215607914c4e3e231cd27899 /openpicc/application/ssc_picc.c
parent5a29168eaddaaa47909f2ae84c41d0743996215f (diff)
Fix consistency check
Fix miller decoder for the case of a buffer containing only zeroes git-svn-id: https://svn.openpcd.org:2342/trunk@388 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application/ssc_picc.c')
-rw-r--r--openpicc/application/ssc_picc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/openpicc/application/ssc_picc.c b/openpicc/application/ssc_picc.c
index 085fa48..721989f 100644
--- a/openpicc/application/ssc_picc.c
+++ b/openpicc/application/ssc_picc.c
@@ -199,9 +199,15 @@ static ssc_dma_rx_buffer_t* __ramfunc __ssc_rx_unload(int secondary)
u_int16_t remaining_transfers = (secondary ? rx_pdc->PDC_RNCR : rx_pdc->PDC_RCR);
u_int8_t* next_transfer_location = (u_int8_t*)(secondary ? rx_pdc->PDC_RNPR : rx_pdc->PDC_RPR);
- u_int32_t remaining_size = buffer->reception_mode->transfersize * remaining_transfers;
+ u_int16_t elapsed_transfers = buffer->reception_mode->transfers - remaining_transfers;
+ u_int32_t elapsed_size = buffer->reception_mode->transfersize/8 * elapsed_transfers;
+
/* Consistency check */
- if( next_transfer_location - remaining_size != buffer->data ) {
+ if( next_transfer_location - elapsed_size != buffer->data ) {
+ int i=usb_print_set_default_flush(0);
+ DumpStringToUSB("!!! "); DumpUIntToUSB((int)next_transfer_location); DumpStringToUSB(" ");
+ DumpUIntToUSB(elapsed_size); DumpStringToUSB(" "); DumpUIntToUSB((int)buffer->data); DumpStringToUSB(" ");
+ usb_print_set_default_flush(i);
ssc_buffer_errors++;
if(buffer->state == PENDING) buffer->state = FREE;
ssc_state.buffer[secondary] = NULL;
personal git repositories of Harald Welte. Your mileage may vary