diff core/PRU.cpp @ 235:3d41a6fa1830

Merge
author Giulio Moro <giuliomoro@yahoo.it>
date Sun, 10 Apr 2016 04:08:06 +0200
parents c0bf6157f67e
children 33e0e4831763 88cf310417cd
line wrap: on
line diff
--- a/core/PRU.cpp	Sat Feb 13 01:51:01 2016 +0000
+++ b/core/PRU.cpp	Sun Apr 10 04:08:06 2016 +0200
@@ -99,7 +99,7 @@
 const unsigned int PRU::kPruGPIOTestPin2 = 31;	// GPIO0(31); P9-13
 const unsigned int PRU::kPruGPIOTestPin3 = 26;	// GPIO0(26); P8-14
 
-extern bool gShouldStop;
+extern int gShouldStop;
 extern int gRTAudioVerbose;
 
 // Constructor: specify a PRU number (0 or 1)
@@ -561,12 +561,12 @@
 		// Convert short (16-bit) samples to float
 		// TODO: NEON
 		for(unsigned int n = 0; n < 2 * context->audioFrames; n++)
-			context->audioIn[n] = (float)pru_buffer_audio_adc[n + pru_audio_offset] / 32768.0;
+			context->audioIn[n] = (float)pru_buffer_audio_adc[n + pru_audio_offset] / 32768.0f;
 
 		if(analog_enabled) {
 			// TODO: NEON
 			for(unsigned int n = 0; n < context->analogChannels * context->analogFrames; n++)
-				context->analogIn[n] = (float)pru_buffer_spi_adc[n + pru_spi_offset] / 65536.0;
+				context->analogIn[n] = (float)pru_buffer_spi_adc[n + pru_spi_offset] / 65536.0f;
 
 			if(context->flags & BEAGLERT_FLAG_ANALOG_OUTPUTS_PERSIST) {
 				// Initialize the output buffer with the values that were in the last frame of the previous output
@@ -614,7 +614,7 @@
 
 			// Convert float back to short for SPI output
 			for(unsigned int n = 0; n < context->analogChannels * context->analogFrames; n++) {
-				int out = context->analogOut[n] * 65536.0;
+				int out = context->analogOut[n] * 65536.0f;
 				if(out < 0) out = 0;
 				else if(out > 65535) out = 65535;
 				pru_buffer_spi_dac[n + pru_spi_offset] = (uint16_t)out;
@@ -630,7 +630,7 @@
         // Convert float back to short for audio
 		// TODO: NEON
 		for(unsigned int n = 0; n < 2 * context->audioFrames; n++) {
-			int out = context->audioOut[n] * 32768.0;
+			int out = context->audioOut[n] * 32768.0f;
 			if(out < -32768) out = -32768;
 			else if(out > 32767) out = 32767;
 			pru_buffer_audio_dac[n + pru_audio_offset] = (int16_t)out;