Jared Baxter / Mbed 2 deprecated Impedance_Fast_Circuitry_print_V_I

Dependencies:   mbed-dsp mbed

Fork of Impedance_Fast_Circuitry by Jared Baxter

Revision:
57:7b8c49e1c1f6
Parent:
56:7e08cbc3a4f1
Child:
58:4bee89daccff
--- a/main.cpp	Thu Feb 18 23:05:07 2016 +0000
+++ b/main.cpp	Thu Feb 18 23:20:49 2016 +0000
@@ -22,6 +22,8 @@
 extern uint16_t static_output_array0[];
 extern uint16_t output_array0[];
 
+extern uint16_t sampling_status;
+
 using namespace std;
  
 int main() {
@@ -49,47 +51,7 @@
     pc.printf("\r\n\r\n\r\n");
     
     while(1) {
-        //DMA_TCD2_CSR
-        //int counter = 0;
-        //pc.printf("Sample_array0[1]:%d\r\n",sample_array0[counter]);
-        //ADC0_SC1A = 0x0C; //AIEN = 0, DIFF = 0, Channel = AD12 (PTB2)
-        //ADC1_SC1A = 0x0E; //AIEN = 0, DIFF = 0, Channel = AD14 (PTB10)  
-        //while( (ADC0_SC1A&ADC_SC1_COCO_MASK)) {}
-        //while( (ADC1_SC1A&ADC_SC1_COCO_MASK)) {}
-        //pc.printf("ADC0_RA:%d\r\n", ADC0_RA);
-        //pc.printf("ADC1_RA:%d\r\n", ADC1_RA);
         
-        //for(int i = 0; i < len; i++) pc.printf("A%i: %d\t %d\r\n",i,sample_array0[i],sample_array1[i]);
-        //for(int i = 0; i < len; i++) pc.printf("B%i: %d\t %d\r\n",i,static_input_array0[i],static_input_array1[i]);
-        
-        //wait_ms(1000);
-/*        int store_var = DMA_TCD2_CSR;
-        if (store_var == 0x220)
-            {
-                DAC0_DAT0H = 0x0F;
-                wait_us(10);
-                //DMA_TCD0_CSR = 0x260;
-            }
-        if (store_var == 0x260)
-            {
-                DAC0_DAT0H = 0x00;
-                wait_us(10);
-            }
-        
-        //int store_var = DMA_TCD0_CSR;
-        //pc.printf("DMA0: %x\r\n", DMA_TCD0_CSR);
-        //pc.printf("DMA1: %x\r\n", DMA_TCD1_CSR);
-        //pc.printf("DMA2: %x\r\n", DMA_TCD2_CSR);
-        //pc.printf("DMA3: %x\r\n", DMA_TCD3_CSR);
-        
-        //for(int i = 0; i < len; i++) pc.printf("B%i: %d\t %d\r\n",i,static_input_array0[i],static_input_array1[i]);
-        for (int i = 0: i < len; i++) 
-        {
-            static_output_array[i] = static_input_array0[i] >> 4;
-        }
-        
-        //wait_us(100);
-  */
         if(pc.readable() > 0) {
             char temp = pc.getc();
             
@@ -98,6 +60,8 @@
                 case 'f':
                     for(int i = 0; i < len; i++) {sample_array0[i] = 0; sample_array1[i] = 0;}
                     pc.printf("Arrays cleared\r\n");
+                    sampling_status = 0;
+                    pc.printf("Sampling status cleared\r\n");
                     // then display the samples
                     break;
                 case 'S': // display what's been sampled
@@ -145,6 +109,8 @@
                     //ptr = DMA_TCD2_SADDR;
                     //ptr = DMA_TCD2_SADDR;
                     pc.printf("Value at SADDR: %i\r\n", *((uint32_t *)DMA_TCD2_SADDR));
+                    
+                    pc.printf("Value of sampling_status: %i\r\n", sampling_status);                    
                     break;
                 
                 case 'A': // analog out