A strange behavior when the buffer is filled with CopyTo and this is output with SignalGenerator.Write.
The board hangs and only a complete reset with Erase All and so on helps.
When debugging it can be seen that the buffer is filled the same as if I do it with the alternative of transferring every single element …
TimeSpan[] buffer = new TimeSpan[ tapeDataByte.Count ];
/// FAILED with SignalGenerator.Write
///
tapeDataByte.CopyTo( buffer );
/// SUCCEEDED with SignalGenerator.Write
///
ushort idx = 0;
foreach( TimeSpan timeSpan in tapeDataByte )
buffer[ idx++ ] = timeSpan;
tapeWritePin = GpioController.GetDefault().OpenPin( FEZDuino.GpioPin.PD0 );
tapeWriteSignal = new SignalGenerator( tapeWritePin )
{
DisableInterrupts = false,
IdleValue = GpioPinValue.Low
};
tapeWriteSignal.Write( buffer );