Ale Mansut / Mbed 2 deprecated RF_000

Dependencies:   mbed

Revision:
0:ae9de0bbe204
Child:
1:2f4f6ea93f6b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Apr 30 08:48:57 2020 +0000
@@ -0,0 +1,57 @@
+#include "mbed.h"
+extern "C" {
+#include "fx.h"
+}
+
+#include <time.h>
+void sleepcp(int milliseconds);
+
+void sleepcp(int milliseconds) // Cross-platform sleep function
+{
+    clock_t time_end;
+    time_end = clock() + milliseconds * CLOCKS_PER_SEC/1000;
+    while (clock() < time_end) {
+    }
+}
+
+
+//------------------------------------
+// Hyperterminal configuration
+// 9600 bauds, 8-bit data, no parity
+//------------------------------------
+
+Serial pc(SERIAL_TX, SERIAL_RX);
+
+DigitalOut myled(LED1);
+
+int main()
+{
+
+    int Repetitions = 100;
+    int FxToCall = 50;
+
+    float x[20];
+    int count = 0;
+
+    while(1) {
+        pc.printf("Starting %d repetitions\r\n",Repetitions);
+
+        clock_t start, end;
+        double cpu_time_used;
+        start = clock();
+
+        count = 0;
+
+        for (int r=0; r<Repetitions; r++) {
+            for(int i=0; i<FxToCall; i++) {
+                count += fxList[i](x);
+            }
+        }
+
+        end = clock();
+        cpu_time_used = ((double) (end - start)) / (CLOCKS_PER_SEC * 1000);
+        pc.printf("Ticks elapsed: %d - Millisecs: %f",(end-start),cpu_time_used);
+
+
+    }
+}