]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
make LF sampling ACK to fix USB timing issue in em410xwatch
authoradam@algroup.co.uk <adam@algroup.co.uk@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Thu, 4 Feb 2010 23:15:53 +0000 (23:15 +0000)
committeradam@algroup.co.uk <adam@algroup.co.uk@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Thu, 4 Feb 2010 23:15:53 +0000 (23:15 +0000)
armsrc/appmain.c
client/cmdlf.c
client/cmdmain.c

index ecf22adfed41b5e0990dc78452a123966675cfa1..f69bdccc16dee5aa9277f1580a48847bb32cef19 100644 (file)
@@ -568,11 +568,14 @@ void ListenReaderField(int limit)
 void UsbPacketReceived(BYTE *packet, int len)\r
 {\r
        UsbCommand *c = (UsbCommand *)packet;\r
+       UsbCommand ack;\r
 \r
        switch(c->cmd) {\r
 #ifdef WITH_LF\r
                case CMD_ACQUIRE_RAW_ADC_SAMPLES_125K:\r
                        AcquireRawAdcSamples125k(c->arg[0]);\r
+                       ack.cmd = CMD_ACK;\r
+                       UsbSendPacket((BYTE*)&ack, sizeof(ack));\r
                        break;\r
 #endif\r
 \r
@@ -719,7 +722,6 @@ void UsbPacketReceived(BYTE *packet, int len)
                }\r
 \r
                case CMD_DOWNLOADED_SIM_SAMPLES_125K: {\r
-                       UsbCommand ack;\r
                        BYTE *b = (BYTE *)BigBuf;\r
                        memcpy(b+c->arg[0], c->d.asBytes, 48);\r
                        //Dbprintf("copied 48 bytes to %i",b+c->arg[0]);\r
index e82e48aefce6e8108f3a4aa00d9cc1d3189e14c9..26bd5e4fd6b0d1a00c71da5d4cdc234db9bfe9d0 100644 (file)
@@ -266,6 +266,7 @@ int CmdLFRead(const char *Cmd)
     return 0;
   }
   SendCommand(&c);
+  WaitForResponse(CMD_ACK);
   return 0;
 }
 
index 3cdcd08937a8497d0258432aacf5352e4aea616a..30b431f55895b27248469c6d165b11081d2588d1 100644 (file)
@@ -125,6 +125,7 @@ void UsbCommandReceived(UsbCommand *UC)
       for(i=0; i<48; i++) sample_buf[i] = UC->d.asBytes[i];
       received_command = UC->cmd;
       return;
+    case CMD_ACQUIRE_RAW_ADC_SAMPLES_125K:
     case CMD_DOWNLOADED_SIM_SAMPLES_125K:
       if (UC->cmd != CMD_ACK) goto unexpected_response;
       // got ACK
Impressum, Datenschutz