changeset 476:838a4a4a8580 prerelease

Removed warnings, now libpd_render can compile with Clang as well
author Giulio Moro <giuliomoro@yahoo.it>
date Mon, 20 Jun 2016 21:20:28 +0100
parents faa5f58c71af
children 5934790c7c15
files core/I2c_Codec.cpp core/default_libpd_render.cpp include/DigitalChannelManager.h
diffstat 3 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/core/I2c_Codec.cpp	Mon Jun 20 20:39:00 2016 +0100
+++ b/core/I2c_Codec.cpp	Mon Jun 20 21:20:28 2016 +0100
@@ -166,7 +166,7 @@
 
 //set fractional part(between 0 and 9999) of the numerator mutliplier of the PLL
 int I2c_Codec::setPllD(unsigned int d){
-	if(d<0 || d>9999)
+	if(d  >9999)
 		return 1;
 	if(writeRegister(0x05, (d>>6)&255)){ // PLL register C: part 1 : 8 most significant bytes of a 14bit integer
 		printf("I2C error while writing PLL d part 1 : %d", d);
--- a/core/default_libpd_render.cpp	Mon Jun 20 20:39:00 2016 +0100
+++ b/core/default_libpd_render.cpp	Mon Jun 20 21:20:28 2016 +0100
@@ -126,16 +126,19 @@
 static unsigned int gLibpdBlockSize;
 // 2 audio + (up to)8 analog + (up to) 16 digital + 4 scope outputs
 static const unsigned int gChannelsInUse = 30;
-static const unsigned int gFirstAudioChannel = 0;
+//static const unsigned int gFirstAudioChannel = 0;
 static const unsigned int gFirstAnalogChannel = 2;
 static const unsigned int gFirstDigitalChannel = 10;
 static const unsigned int gFirstScopeChannel = 26;
 
 Scope scope;
 unsigned int gScopeChannels = 4;
+float* gScopeOut;
+
 bool setup(BelaContext *context, void *userData)
 {
     scope.setup(gScopeChannels, context->audioSampleRate);
+    gScopeOut = new float[gScopeChannels];
 
 	// Check first of all if file exists. Will actually open it later.
 	char file[] = "_main.pd";
@@ -385,11 +388,10 @@
 		}
 		//scope
 		for (j = 0, p0 = gOutBuf; j < gLibpdBlockSize; ++j, ++p0) {
-			float scopeOut[gScopeChannels]={0};
 			for (k = 0, p1 = p0  + gLibpdBlockSize * gFirstScopeChannel; k < gScopeChannels; k++, p1 += gLibpdBlockSize) {
-				scopeOut[k] = *p1;
+				gScopeOut[k] = *p1;
 			}
-			scope.log(scopeOut[0], scopeOut[1], scopeOut[2], scopeOut[3]);
+			scope.log(gScopeOut[0], gScopeOut[1], gScopeOut[2], gScopeOut[3]);
 		}
 
 
@@ -425,4 +427,5 @@
 
 void cleanup(BelaContext *context, void *userData)
 {
+	delete [] gScopeOut;
 }
--- a/include/DigitalChannelManager.h	Mon Jun 20 20:39:00 2016 +0100
+++ b/include/DigitalChannelManager.h	Mon Jun 20 21:20:28 2016 +0100
@@ -232,7 +232,6 @@
 	virtual ~DigitalChannelManager();
 private:
 	bool callbackEnabled;
-	void* callbackArg;
 	void* callbackArguments[16];
 	void (*stateChangedCallback)(bool value, unsigned int delay, void* arg);
 	uint32_t clearDataOut;