Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug in GPIO Port constructor

62 views
Skip to first unread message

Martin D.

unread,
May 11, 2010, 10:11:01 AM5/11/10
to
We think we found a bug in
Library_spot_hardware_native_Microsoft_SPOT_Hardware_Port when trying to
construct a new OutputPort on a already reserved pin.

The testcode throws the following exception when entering thread.sleep()
after a forced garbage collector:

#### Exception System.Exception - CLR_E_WRONG_TYPE (3) ####
#### Microsoft.SPOT.Hardware.Port::Dispose [IP: 0000] ####
#### Microsoft.SPOT.Hardware.NativeEventDispatcher::Finalize [IP: 0005]
####
An unhandled exception of type 'System.Exception' occurred in
Microsoft.SPOT.Hardware.dll


public void DeviceGarbageCollectorTest()
{
try
{
//calling slave method
DeviceGarbageCollectorTest_Slave();

//the object testPort will now dispose
Debug.GC(true);

//now CLR_E_WRONG_TYPE will be thrown
Thread.Sleep(1000);
}
catch
{
Debug.Print("exception was thrown!");
}
}

private void DeviceGarbageCollectorTest_Slave()
{
//Reserve a Pin
Port.ReservePin(Cpu.Pin.GPIO_Pin14, true);
try
{
//try to create a OutputPort Object using the same pin
//OutputPort testPort = new OutputPort(Cpu.Pin.GPIO_Pin14,
true);
}
catch
{
//CLR_E_PIN_UNAVAILABLE will be thrown, everything seems to
be alright
}
}

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?mid=dcd92bdc-99a9-4d97-804c-5613c0e6a2bc&dg=microsoft.public.dotnet.framework.microframework.porting

Lorenzo Tessiore

unread,
May 18, 2010, 7:16:03 PM5/18/10
to
Thank you for reportign this issue, we will investigate it
Lorenzo
0 new messages