diff core/RTAudio.cpp @ 41:4255ecbb9bec ultra-staging

Timers to measure performances, ultra experimental
author Giulio Moro <giuliomoro@yahoo.it>
date Tue, 19 May 2015 16:41:07 +0100
parents ad5cd8dd99b3
children 3068421c0737
line wrap: on
line diff
--- a/core/RTAudio.cpp	Wed May 13 12:23:37 2015 +0100
+++ b/core/RTAudio.cpp	Tue May 19 16:41:07 2015 +0100
@@ -70,6 +70,13 @@
 int gNumAnalogChannels = 0;
 int gNumDigitalChannels = 0;
 
+
+void printIntervals(){
+	rt_printf("\n");
+	gPRU->renderTimer.print();
+	gPRU->sleepTimer.print();
+}
+
 // initAudio() prepares the infrastructure for running PRU-based real-time
 // audio, but does not actually start the calculations.
 // periodSize indicates the number of _sensor_ frames per period: the audio period size
@@ -190,7 +197,7 @@
 		cout << "Couldn't initialise audio rendering\n";
 		return 1;
 	}
-
+	gPRU->printIntervalsTask=createAuxiliaryTaskLoop(*printIntervals, 10, "transmit-receive-data");
 	return 0;
 }
 
@@ -213,7 +220,7 @@
 	}
 	else {
 		if(gPRU->start(gPRUFilename)) {
-			rt_printf("Error: unable to start PRU from file %s\n", gPRUFilename);
+			rt_printf("Error: unable to start PRU %s\n", gPRUFilename);
 			gShouldStop = 1;
 		}
 		else {