Main Site Documentation

TinyCLR OS - GPIO Event Thread


#1

Hi Guys,

I was under the impression that externally initiated events were raised on their own thread (GPIO, CAN etc) hence the need for the dispatcher in NETMF but when I execute the following code the managed thread id in the event handler is always 0.

var controller = GpioController.GetDefault();

var button = controller.OpenPin(G120E.GpioPin.P2_10);

button.SetDriveMode(GpioPinDriveMode.InputPullUp);

button.ValueChanged += delegate {
Debug.WriteLine(Thread.CurrentThread.ManagedThreadId.ToString());
};

Does anybody know why?


#2

This is probably the same issue as https://github.com/ghi-electronics/TinyCLR-Ports/issues/197


#3

Thanks John,

So its known bug that has been fixed in the next release (Version 1?)

Do you know what the time frame on that release is?


#4

If it is indeed the same bug it has been fixed for the next release, yes. The roadmap talks about our release timeline.


#5

Do all event handlers run on the same thread? That is, a single event handler thread. I believe MF had a single thread for events.


#6

The event handler behavior is unchanged from NETMF at this time.