I’m experiencing some odd behavior here when compiling the PedalTemplate (or Verb, or any other Petal based code) in Visual Studio with Visual GDB…
My inputs are swapped when reading from an interleaved block. in[i] gives the right channel input, in[i + 1] gives the left channel input.
If I compile the exact same code with GCC I get the correct behavior (in[i] gives left channel, in[i + 1] gives right channel).
The only changes I’ve made to the project are adding “libDaisy/Drivers/CMSIS/Include” to the include paths, and I had to substitute the ARM Toolchain (com.sysprogs.gnuarm.arm-eabi 9.2.1/8.0/r1) with the default ARM toolchain in Visual GDB (GCC 9.3.1, GDB 9.2.0, Revision 1)
Anyone else experience this, or have any idea what is going on?
The code is vanilla code from the DaisyExamples archive, but just for the sake of posterity:
// Basic Template for DaisyPetal
#include "daisy_petal.h"
using namespace daisy;
DaisyPetal hw;
void AudioCallback(float *in, float *out, size_t size)
{
hw.DebounceControls();
hw.UpdateAnalogControls();
for(size_t i = 0; i < size; i += 2)
{
out[i] = in[i];
out[i + 1] = in[i + 1];
}
}
int main(void)
{
hw.Init();
hw.StartAdc();
hw.StartAudio(AudioCallback);
for(;;) {}
}