Ivan Scherbakov / Mbed 2 deprecated last_2_1_0_interchange_208_byte

Dependencies:   mbed FastPWM

Files at this revision

API Documentation at this revision

Comitter:
vanenzo
Date:
Tue Jul 23 08:43:23 2019 +0000
Parent:
16:41e558cc18f1
Commit message:
Show me your warface!

Changed in this revision

FastPWM.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 41e558cc18f1 -r e2f843372f7b FastPWM.lib
--- a/FastPWM.lib	Wed Jun 07 08:44:26 2017 +0000
+++ b/FastPWM.lib	Tue Jul 23 08:43:23 2019 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/Sissors/code/FastPWM/#e880dcb178f4
+http://mbed.org/users/Sissors/code/FastPWM/#c0b2265cff9c
diff -r 41e558cc18f1 -r e2f843372f7b main.cpp
--- a/main.cpp	Wed Jun 07 08:44:26 2017 +0000
+++ b/main.cpp	Tue Jul 23 08:43:23 2019 +0000
@@ -18,7 +18,7 @@
 //основные пины
 Serial serial(USBTX,USBRX);
 FastPWM mclk(PA_15);
-FastPWM sq(PB_7);
+PwmOut sq(PB_7);
 SPI DDS(PC_12, NC, PC_10);
 SPI DAC(PC_12, NC, PC_10);
 DigitalOut SYNC1(PC_11);//amp dac
@@ -75,7 +75,7 @@
 int j; //inject I
 int k; //measure I
 int belt;
-float yprint[2560];
+float yprint[2080];
 
 
 void mux();//универсальная процедура выбора канала
@@ -206,7 +206,7 @@
 {   
     IEN = 1;
     adzero = 0;
-    serial.baud(230400);
+    serial.baud(921600);
         ddsstop;dacstop;
         DDS.frequency(400000);
         DDS.format(16,2);
@@ -228,6 +228,7 @@
         else {wait_us(10); printf("7\r\n"); fflush (stdout); wait_us(100);};
         ddsreset;
         request();
+        int amountOfByte = sizeof(float) * 208 * belt;
         while(true){
         t.reset();
         t.start();
@@ -235,9 +236,10 @@
         mux_group();
         t.stop(); 
         i2g;
+        write(1, yprint, amountOfByte);
         //fout();
         //////////////////////////
-        for (yp = 0; yp < (256*belt); yp++) {printf("%.6f\r\n",yprint[yp]);};
+       // for (yp = 0; yp < (208*belt); yp++) {printf("%.6f\r\n",yprint[yp]);};
         /////////////////////////
    // printf("1000r useconds %i\r\n", t.read_ms());
           wait_us(1);
@@ -277,9 +279,9 @@
     printf("\r\n");
     printf("# name: meas_volts\r\n");
     printf("# type: matrix\r\n");
-    printf("# rows: 256\r\n");
+    printf("# rows: 208\r\n");
     printf("# columns: 1\r\n");
-    for (yp = 0; yp < 256*belt; yp++) {printf("%.6g\r\n",yprint[yp]);};
+    for (yp = 0; yp < 208*belt; yp++) {printf("%.6g\r\n",yprint[yp]);};
     memset(yprint,0,sizeof yprint);
     printf("\r\n");
     printf("# name: time\r\n");
@@ -374,10 +376,10 @@
 
 void freqsq ()
 {
-    float period;
-    period = 1000/freqdata;
+    int period;
+    period = (int) 1000/freqdata;
     sq.period_us(period);
-    sq.pulsewidth_us(period/2);
+    sq.pulsewidth_us((int)period/2);
 }
 
 void sinus()
@@ -534,7 +536,7 @@
        //if ((j==0)&&(IE==0)){wait_ms(1);}
         for (k = 0; k<16; k++) {
                 if (k==15) {DI1 = k;DI2 = 0;} else {DI1 = k; DI2 = k+1; }
-                if ((DI1==II)||(DI1==IG)||(DI2==II)||(DI2==IG)){yprint[yp]=(0);yp++;continue;}
+                if ((DI1==II)||(DI1==IG)||(DI2==II)||(DI2==IG)){continue;}
                 DI1mux(); 
                 DI2mux();
                 wait_us(10);
diff -r 41e558cc18f1 -r e2f843372f7b mbed.bld
--- a/mbed.bld	Wed Jun 07 08:44:26 2017 +0000
+++ b/mbed.bld	Tue Jul 23 08:43:23 2019 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/6f327212ef96
\ No newline at end of file
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file