Hello guys,
Spider version 4.1.7.0
if you have an SD Card and the T35 Display plugged in and configured via the designer… for some reason the SD Card Mounted Event never gets raised upon boot… while the card is in the slot…
here is the code:
// This method is run when the mainboard is powered up or reset.
void ProgramStarted()
{
sdCard.SDCardMounted += new SDCard.SDCardMountedEventHandler(sdCard_SDCardMounted);
button.ButtonPressed += new Button.ButtonEventHandler(button_ButtonPressed);
Debug.Print("Program Started");
}
when stepping thought the code i noticed that the even in SDCard.cs get called but SDCardMounted is null…
/// <summary>
/// Raises the <see cref="SDCardMounted"/> event.
/// </summary>
/// <param name="sender">The <see cref="SDCard"/> object that raised the event.</param>
/// <param name="SDCard">A storage device that can be used to access the SD non-volatile memory card.</param>
protected virtual void OnSDCardMountedEvent(SDCard sender, StorageDevice SDCard)
{
if (_OnSDCardMounted == null) _OnSDCardMounted = new SDCardMountedEventHandler(OnSDCardMountedEvent);
if (Program.CheckAndInvoke([b]SDCardMounted[/b], _OnSDCardMounted, sender, SDCard))
{
SDCardMounted(sender, SDCard);
}
}
this is SDCardMounted null which is why it never raises the event.
removing the Display causes the event to raise as it should.
PS: the event works when you physically remove and reinsert the card. so the above fails when the system recycles power…
THIS IS A BUG since the SD card even will never be accessed if i reboot the system…
cheers,
Jay