Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Impedance_Fast_Circuitry by
Diff: main.cpp
- Revision:
- 70:8cd7a8a2c153
- Parent:
- 69:014d4bbd4e03
- Child:
- 72:0b554f5026b9
--- a/main.cpp Wed May 17 19:33:26 2017 +0000 +++ b/main.cpp Wed May 17 23:10:03 2017 +0000 @@ -8,6 +8,8 @@ // DSP #include "dsp.h" +#define PRINT_BUFFER_LENGTH 2000 + // for debug purposes Serial pc(USBTX, USBRX); @@ -74,6 +76,11 @@ pc.baud(230400); pc.printf("Starting\r\n"); + + uint16_t output_print_buffer[PRINT_BUFFER_LENGTH]; + uint16_t output_print_buffer2[PRINT_BUFFER_LENGTH]; + int print_buffer_count = 0; + pdb_init(); // Initalize PDB dac_init(); // initializes DAC adc_init(); // always initialize adc before dma @@ -87,7 +94,8 @@ pc.printf("\r\n\r\n\r\n"); pdb_start(); - while(1) + //while(print_buffer_count<PRINT_BUFFER_LENGTH) + while(1) { while(sampling_status == 0) { @@ -113,14 +121,24 @@ { //Default PASSTHROUGH Condition status_1 = 1; + //printf("%d\n\r",static_input_array0[0]); for(int i = 0; i < len; i++) { - static_output_array0[i] = static_input_array0[i] >> 4; + static_output_array0[i] = static_input_array0[i] >> 4; + + //printf("%d\n\r",static_input_array0[i]); + output_print_buffer[print_buffer_count+i] = static_input_array0[i]; + output_print_buffer2[print_buffer_count+i] = static_input_array1[i]; - - + if (i>4&&static_input_array0[i]==static_input_array0[i-1]&&static_input_array0[i]==static_input_array0[i-2]) + printf("Y"); + //if (print_buffer_count+i>=PRINT_BUFFER_LENGTH) + //{ + // break; + // } } + //print_buffer_count+=len; status_1 = 0; } else @@ -182,6 +200,14 @@ status_1 = 0; } + } + + for(int i = 0; i<PRINT_BUFFER_LENGTH; i++) + { + printf("%d %d\n\r",output_print_buffer[i],output_print_buffer2[i]); + } + + }