problem with memcpy (p, b, 128)? Queue.playBuffer()?
Hello everyone!
I need your help! I am using Teensy3.2
I am trying to analyze a low frequency signal and therefore for communication
with the AudioAnalyzeFFT1024 object, I use the AudioPlayQueue object.
My problem with initializing pointer variables and calling functions
Queue.getBuffer () memcpy (p, b, 128) Queue.playBuffer ()
this error message
...... rRead.ino: 113: 16: warning: invalid conversion from 'short unsigned int *' to 'int16_t * {aka short int *}' [-fpermissive]
Hello everyone!
I need your help! I am using Teensy3.2
I am trying to analyze a low frequency signal and therefore for communication
with the AudioAnalyzeFFT1024 object, I use the AudioPlayQueue object.
My problem with initializing pointer variables and calling functions
Queue.getBuffer () memcpy (p, b, 128) Queue.playBuffer ()
Code:
here are the code fragments that relate to the problem
AudioPlayQueue Queue; // xy = 266.286
AudioAnalyzeFFT1024 fft; // xy = 458.286
AudioConnection patchCord1 (Queue, fft);
#define BUFFER_SIZE 128
unsigned short int buffer_0 [BUFFER_SIZE];
uint16_t buffer_0_count = 0;
void setup ()
{
AudioMemory (20);
void timer0_callback (void)
{
adc-> adc0-> startSingleRead (A2);
digitalWrite (22,! digitalRead (22)); // for test
}
void adc0_isr ()
{
buffer_0 [buffer_0_count] = adc-> adc0-> readSingle ();
buffer_0_count ++;
if (buffer_0_count> = 128) // ned 0-128
{
buffer_0_count = 0;
int16_t * b = buffer_0;
int16_t * p = Queue.getBuffer ();
memcpy (p, b, 128); // is there a problem here?
Queue.playBuffer (); // or maybe here?
}
digitalWrite (23,! digitalRead (23)); // for test
}
this error message
...... rRead.ino: 113: 16: warning: invalid conversion from 'short unsigned int *' to 'int16_t * {aka short int *}' [-fpermissive]
Last edited: