Hello!
Im playing around with copying data from a large u_int8 array into a small u_int8 buffer.
the large arrays size is 31520 bytes, the buffer is 256 bytes wide.
Seems that my code does something really bad.
it compiles without warnings.
but gets the teensy into a RESET LOOP.
Nothing ever gets printet to the serial.
anyone an idea where i am beeing bad to the teensy?
Im playing around with copying data from a large u_int8 array into a small u_int8 buffer.
the large arrays size is 31520 bytes, the buffer is 256 bytes wide.
Seems that my code does something really bad.
it compiles without warnings.
but gets the teensy into a RESET LOOP.
Nothing ever gets printet to the serial.
anyone an idea where i am beeing bad to the teensy?
Code:
#include "valhala_sysex.h" // arrays with presets
void setup()
{
Serial.begin(115200); while (!Serial) {;} // wait for serial
// get lenghts of the sysexdata and the midi buffer
static uint16_t SYSEX_PRESET_LENGTH = sizeof(Valhala_B102)/sizeof(Valhala_B102[0]);
static uint8_t MIDI_BUFFER_LENGTH = sizeof(midi_buffer)/sizeof(midi_buffer[0]);
uint16_t sysex_preset_offset=0;
Serial.println("starting buffer test");
while ( sysex_preset_offset < SYSEX_PRESET_LENGTH)
{
memcpy(midi_buffer, Valhala_B102 + sysex_preset_offset, SYSEX_PRESET_LENGTH);
sysex_preset_offset = sysex_preset_offset + MIDI_BUFFER_LENGTH;
for (int element : midi_buffer)
{
Serial.print(element < 16 ? "0" : "");
Serial.print(element, HEX);
Serial.print(" ");
}
delay(100);
}
}
void loop()
{
}