]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
shorten em4x05 capture samples
authormarshmellow42 <marshmellowrf@gmail.com>
Mon, 20 Feb 2017 22:39:39 +0000 (17:39 -0500)
committermarshmellow42 <marshmellowrf@gmail.com>
Mon, 20 Feb 2017 22:39:39 +0000 (17:39 -0500)
add cap option for 4469
add sample size option for  DoAcquisition so i can limit how many
samples i want to collect.
use with DoPartialAcquisition

armsrc/lfops.c
armsrc/lfsampling.c
armsrc/lfsampling.h
client/cmdlfem4x.c

index cfe032fc45eab9277995a94843604886fa980094..35f220c0eff94bff4e504ca085e6b51fe1b57650 100644 (file)
@@ -1628,7 +1628,7 @@ void EM4xReadWord(uint8_t Address, uint32_t Pwd, uint8_t PwdMode) {
        SendForward(fwd_bit_count);
 
        // Now do the acquisition
-       doT55x7Acquisition(6000);
+       DoPartialAcquisition(20, true, 5500);
        
        FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF); // field off
        LED_A_OFF();
@@ -1656,10 +1656,10 @@ void EM4xWriteWord(uint32_t flag, uint32_t Data, uint32_t Pwd) {
        SendForward(fwd_bit_count);
 
        //Wait for write to complete
-       SpinDelay(10);
+       //SpinDelay(10);
 
        //Capture response if one exists
-       DoAcquisition_default(20, TRUE);
+       DoPartialAcquisition(20, true, 5500);
 
        FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF); // field off
        LED_A_OFF();
index 72aabe00fda46318b1959d93c5150e626a1a8d9a..aff31e9eaf28d86db3663bb2a6e7341c051b0e07 100644 (file)
@@ -119,11 +119,11 @@ void LFSetupFPGAForADC(int divisor, bool lf_field)
  * @param silent - is true, now outputs are made. If false, dbprints the status
  * @return the number of bits occupied by the samples.
  */
-uint32_t DoAcquisition(uint8_t decimation, uint32_t bits_per_sample, bool averaging, int trigger_threshold, bool silent)
+uint32_t DoAcquisition(uint8_t decimation, uint32_t bits_per_sample, bool averaging, int trigger_threshold, bool silent, int bufsize)
 {
        //.
        uint8_t *dest = BigBuf_get_addr();
-    int bufsize = BigBuf_max_traceLen();
+       bufsize = (bufsize > 0 && bufsize < BigBuf_max_traceLen()) ? bufsize : BigBuf_max_traceLen();
 
        //memset(dest, 0, bufsize); //creates issues with cmdread (marshmellow)
 
@@ -213,7 +213,7 @@ uint32_t DoAcquisition(uint8_t decimation, uint32_t bits_per_sample, bool averag
  */
 uint32_t DoAcquisition_default(int trigger_threshold, bool silent)
 {
-       return DoAcquisition(1,8,0,trigger_threshold,silent);
+       return DoAcquisition(1,8,0,trigger_threshold,silent,0);
 }
 uint32_t DoAcquisition_config( bool silent)
 {
@@ -221,7 +221,12 @@ uint32_t DoAcquisition_config( bool silent)
                                  ,config.bits_per_sample
                                  ,config.averaging
                                  ,config.trigger_threshold
-                                 ,silent);
+                                 ,silent
+                                 ,0);
+}
+
+uint32_t DoPartialAcquisition(int trigger_threshold, bool silent, int sample_size) {
+       return DoAcquisition(1,8,0,trigger_threshold,silent,sample_size);
 }
 
 uint32_t ReadLF(bool activeField, bool silent)
index ba4fc3f7fdc150174b52ebcdde38b8991f7b413a..cd774c155f007cef3a81d38216987b1b38b4f76f 100644 (file)
@@ -24,9 +24,11 @@ uint32_t SampleLF(bool silent);
 * Initializes the FPGA for snoop-mode (field off), and acquires the samples.
 * @return number of bits sampled
 **/
-
 uint32_t SnoopLF();
 
+// adds sample size to default options
+uint32_t DoPartialAcquisition(int trigger_threshold, bool silent, int sample_size);
+
 /**
  * @brief Does sample acquisition, ignoring the config values set in the sample_config.
  * This method is typically used by tag-specific readers who just wants to read the samples
index e0c415bb30abaca040c6b97eca274f46053f063e..6208e63caaca604ed0d5882af69d279f52586481 100644 (file)
@@ -823,8 +823,9 @@ void printEM4x05info(uint8_t chipType, uint8_t cap, uint16_t custCode, uint32_t
 
        switch (cap) {
                case 3: PrintAndLog(" Cap Type:   %u | 330pF",cap); break;
-               case 2: PrintAndLog(" Cap Type:   %u | 210pF",cap); break;
+               case 2: PrintAndLog(" Cap Type:   %u | %spF",cap, (chipType==2)? "75":"210"); break;
                case 1: PrintAndLog(" Cap Type:   %u | 250pF",cap); break;
+               case 0: PrintAndLog(" Cap Type:   %u | no resonant capacitor",cap); break;
                default: PrintAndLog(" Cap Type:   %u | unknown",cap); break;
        }
 
Impressum, Datenschutz