]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
ADD: using @holiman's "ubs_poll_validate_length() function in some device-side...
authoriceman1001 <iceman@iuse.se>
Wed, 22 Jul 2015 21:45:41 +0000 (23:45 +0200)
committericeman1001 <iceman@iuse.se>
Wed, 22 Jul 2015 21:45:41 +0000 (23:45 +0200)
-hitag2, -legicrf, HIDdemodFSK, CmDAWIDdemodFSK, CmdEM410xdemod, CmdIOdemodFSK

It should enable them to be aborted with a call to  "hw ping / hw status" instead of only button-press. Which is good when you are scripting stuff.

armsrc/apps.h
armsrc/hitag2.c
armsrc/legicrf.c
armsrc/lfops.c

index bb777eab552c292fd1b384e7d3fc354736bedf56..ff0b3472f2f7630007459ba00fc23313bb9f7344 100644 (file)
@@ -21,6 +21,7 @@
 #include "lfdemod.h"
 #include "BigBuf.h"
 #include "fpgaloader.h"
+#include "usb_cdc.h"
 #include "hitag2.h"
 #include "mifare.h"
 //#include "des.h"
index 7998d491ee602284efd1ef71c00a06e2f1e2e12a..7cc6b96434667d95b91d6a0508040808b5f14c26 100644 (file)
@@ -765,7 +765,7 @@ void SnoopHitag(uint32_t type) {
        bSkip = true;
        tag_sof = 4;
        
-       while(!BUTTON_PRESS()) {
+       while(!BUTTON_PRESS() && !usb_poll_validate_length()) {
                // Watchdog hit
                WDT_HIT();
                
@@ -992,7 +992,7 @@ void SimulateHitagTag(bool tag_mem_supplied, byte_t* data) {
        // Enable and reset counter
        AT91C_BASE_TC1->TC_CCR = AT91C_TC_CLKEN | AT91C_TC_SWTRG;
        
-       while(!BUTTON_PRESS()) {
+       while(!BUTTON_PRESS() && !usb_poll_validate_length()) {
                // Watchdog hit
                WDT_HIT();
                
index 074a0f7896333bc5ece3020bb63aaa989029eecc..68d4e7600356df9f6520cd9809deb14c6ebadde6 100644 (file)
@@ -711,7 +711,7 @@ void LegicRfSimulate(int phase, int frame, int reqresp)
 
    LED_B_ON();
    DbpString("Starting Legic emulator, press button to end");
-   while(!BUTTON_PRESS()) {
+   while(!BUTTON_PRESS() && !usb_poll_validate_length()) {
       int level = !!(AT91C_BASE_PIOA->PIO_PDSR & GPIO_SSC_DIN);
       int time = timer->TC_CV;
                 
index 0cdd12d5002de72196c2ac1fe15617e45f3c69bd..3c7a544ebf9f0a95c7995b51d74ae34338639155 100644 (file)
@@ -762,7 +762,7 @@ void CmdHIDdemodFSK(int findone, int *high, int *low, int ledcontrol)
        // Configure to go in 125Khz listen mode
        LFSetupFPGAForADC(95, true);
 
-       while(!BUTTON_PRESS()) {
+       while(!BUTTON_PRESS() && !usb_poll_validate_length()) {
 
                WDT_HIT();
                if (ledcontrol) LED_A_ON();
@@ -851,7 +851,7 @@ void CmdAWIDdemodFSK(int findone, int *high, int *low, int ledcontrol)
        // Configure to go in 125Khz listen mode
        LFSetupFPGAForADC(95, true);
 
-       while(!BUTTON_PRESS()) {
+       while(!BUTTON_PRESS() && !usb_poll_validate_length()) {
 
                WDT_HIT();
                if (ledcontrol) LED_A_ON();
@@ -942,7 +942,7 @@ void CmdEM410xdemod(int findone, int *high, int *low, int ledcontrol)
        // Configure to go in 125Khz listen mode
        LFSetupFPGAForADC(95, true);
 
-       while(!BUTTON_PRESS()) {
+       while(!BUTTON_PRESS() && !usb_poll_validate_length()) {
 
                WDT_HIT();
                if (ledcontrol) LED_A_ON();
@@ -1003,7 +1003,7 @@ void CmdIOdemodFSK(int findone, int *high, int *low, int ledcontrol)
        // Configure to go in 125Khz listen mode
        LFSetupFPGAForADC(95, true);
 
-       while(!BUTTON_PRESS()) {
+       while(!BUTTON_PRESS() && !usb_poll_validate_length()) {
                WDT_HIT();
                if (ledcontrol) LED_A_ON();
                DoAcquisition_default(-1,true);
Impressum, Datenschutz