]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/appmain.c
Add @Iceman1001 s cotag read
[proxmark3-svn] / armsrc / appmain.c
index eded359e0da364906aef836339d13ee34c9d6152..ec133c7a81551dc4752679a9d3805f1f865c252e 100644 (file)
@@ -37,8 +37,6 @@
  #include "iso14443a.h"
 #endif
 
-#define abs(x) ( ((x)<0) ? -(x) : (x) )
-
 //=============================================================================
 // A buffer where we can queue things up to be sent through the FPGA, for
 // any purpose (fake tag, as reader, whatever). We go MSB first, since that
@@ -867,7 +865,7 @@ void ListenReaderField(int limit)
 
                if (limit != HF_ONLY) {
                        if(mode == 1) {
-                               if (abs(lf_av - lf_baseline) > REPORT_CHANGE) 
+                               if (ABS(lf_av - lf_baseline) > REPORT_CHANGE) 
                                        LED_D_ON();
                                else
                                        LED_D_OFF();
@@ -875,7 +873,7 @@ void ListenReaderField(int limit)
 
                        lf_av_new = AvgAdc(ADC_CHAN_LF);
                        // see if there's a significant change
-                       if(abs(lf_av - lf_av_new) > REPORT_CHANGE) {
+                       if(ABS(lf_av - lf_av_new) > REPORT_CHANGE) {
                                Dbprintf("LF 125/134kHz Field Change: %5dmV", (MAX_ADC_LF_VOLTAGE * lf_av_new) >> 10);
                                lf_av = lf_av_new;
                                if (lf_av > lf_max)
@@ -885,7 +883,7 @@ void ListenReaderField(int limit)
 
                if (limit != LF_ONLY) {
                        if (mode == 1){
-                               if (abs(hf_av - hf_baseline) > REPORT_CHANGE)   
+                               if (ABS(hf_av - hf_baseline) > REPORT_CHANGE)   
                                        LED_B_ON();
                                else
                                        LED_B_OFF();
@@ -893,7 +891,7 @@ void ListenReaderField(int limit)
 
                        hf_av_new = AvgAdc(ADC_CHAN_HF);
                        // see if there's a significant change
-                       if(abs(hf_av - hf_av_new) > REPORT_CHANGE) {
+                       if(ABS(hf_av - hf_av_new) > REPORT_CHANGE) {
                                Dbprintf("HF 13.56MHz Field Change: %5dmV", (MAX_ADC_HF_VOLTAGE * hf_av_new) >> 10);
                                hf_av = hf_av_new;
                                if (hf_av > hf_max)
@@ -1030,6 +1028,9 @@ void UsbPacketReceived(uint8_t *packet, int len)
                case CMD_VIKING_CLONE_TAG:
                        CopyVikingtoT55xx(c->arg[0], c->arg[1], c->arg[2]);
                        break;
+               case CMD_COTAG:
+                       Cotag(c->arg[0]);
+                       break;
 #endif
 
 #ifdef WITH_HITAG
Impressum, Datenschutz