Legic: fixed write (#655)
authorAntiCat <contiki@anticat.ch>
Tue, 21 Aug 2018 03:08:06 +0000 (05:08 +0200)
committerpwpiwi <pwpiwi@users.noreply.github.com>
Tue, 21 Aug 2018 03:08:06 +0000 (05:08 +0200)
Due to an oversight the bytes to be written were fetched
from the wrong location. This is fixed now.

armsrc/legicrf.c

index a611c74168586460de032bf5652ce082005772fe..2a236b6ff9e04ad0d6373560a4f20aea08ccf5b5 100644 (file)
@@ -476,7 +476,7 @@ void LegicRfWriter(int bytes, int offset) {
 
   // write in reverse order, only then is DCF (decremental field) writable
   while(bytes-- > 0 && !BUTTON_PRESS()) {
-    if(!write_byte(bytes + offset, BigBuf[bytes], card.addrsize)) {
+    if(!write_byte(bytes + offset, BigBuf[bytes + offset], card.addrsize)) {
       Dbprintf("operation failed @ 0x%03.3x", bytes);
       goto OUT;
     }
Impressum, Datenschutz