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:
- 61:a56cca07d4a6
- Parent:
- 58:4bee89daccff
- Child:
- 63:7903a33e2fd4
--- a/main.cpp Mon Feb 22 18:29:36 2016 +0000 +++ b/main.cpp Mon Feb 22 19:45:04 2016 +0000 @@ -53,25 +53,83 @@ pc.printf("\r\n\r\n\r\n"); pdb_start(); - while(1) { - while(sampling_status == 0) - { - led_green = 1; - status_0 = 1; - } + while(1) + { + while(sampling_status == 0) + { + led_green = 1; + status_0 = 1; + } - sampling_status = 0; - led_green = 0; - status_0 = 0; + sampling_status = 0; + led_green = 0; + status_0 = 0; - status_1 = 1; - for(int i = 0; i < len; i++) { - static_output_array0[i] = static_input_array0[i] >> 4; - //pc.printf("%i\r\n", static_input_array0[i]); + status_1 = 1; + for(int i = 0; i < len; i++) + { + static_output_array0[i] = static_input_array0[i] >> 4; + //pc.printf("%i\r\n", static_input_array0[i]); + } + status_1 = 0; + } +} + + /* if(pc.readable() > 0) { + char temp = pc.getc(); + + switch(temp) { + case 'F': // clear the samples + case 'f': + for(int i = 0; i < len; i++) {sample_array0[i] = 0; sample_array1[i] = 0;} + pc.printf("Arrays cleared\r\n"); + // then display the samples + break; + case 'S': // display what's been sampled + case 's': + for(int i = 0; i < len; i++) pc.printf("%i: %f\t %f\t %f\t %f\r\n",i,sample_array0[i]*3.3/65535,sample_array1[i]*3.3/65535,static_input_array0[i]*3.3/65535,static_input_array1[i]*3.3/65535); + pc.printf("\r\n"); + break; + + case 'D': // DMA debug + case 'd': + pc.printf("DMA Status:\r\n"); + pc.printf("DMA_TCD0_SOFF: %x\r\n", DMA_TCD0_SOFF); + pc.printf("DMA_TCD1_SOFF: %x\r\n", DMA_TCD1_SOFF); + pc.printf("DMA_TCD0_CITER_ELINKNO: %x\r\n", DMA_TCD0_CITER_ELINKNO); + pc.printf("DMA_TCD0_BITER_ELINKNO: %x\r\n", DMA_TCD0_BITER_ELINKNO); + pc.printf("DMA_TCD1_CITER_ELINKNO: %x\r\n", DMA_TCD1_CITER_ELINKNO); + pc.printf("DMA_TCD1_BITER_ELINKNO: %x\r\n", DMA_TCD1_BITER_ELINKNO); + pc.printf("DMA_TCD2_CITER_ELINKNO: %x\r\n", DMA_TCD2_CITER_ELINKNO); + pc.printf("DMA_TCD2_BITER_ELINKNO: %x\r\n", DMA_TCD2_BITER_ELINKNO); + pc.printf("DMA_TCD3_CITER_ELINKNO: %x\r\n", DMA_TCD3_CITER_ELINKNO); + pc.printf("DMA_TCD3_BITER_ELINKNO: %x\r\n", DMA_TCD3_BITER_ELINKNO); + + break; + + + + + // Programmable Delay Block debug + case 'B': + case 'b': + pc.printf("Started PDB...samples being taken\r\n"); + pdb_start(); + break; + case 'K': + case 'k': + pc.printf("Stopped PDB\r\n"); + pdb_stop(); + break; + case 'V': + case 'v': + pc.printf("PDB: %i\r\n",PDB0_CNT); + break; + } + } - status_1 = 0; - } - - - -} \ No newline at end of file + + } + +} +*/ \ No newline at end of file