I am not sure if anyone already noticed this bug, and I would love that someone tries to reproduce this behavior.
For me it's pretty easy to repro, using a snippet like this one:
var sda = new TristatePort(Pins.GPIO_PIN_D11, false, false, Port.ResistorMode.Disabled); sda.Active = true; sda.Active = false; sda.Active = false; //InvalidOperationException
In brief, it seems that it is raised an exception when you set the same value already present in the "Active" property.
I did not find relationship to the I/O used, nor the boolean value assigned: just the same.
Of course, the workaround is pretty easy, but until I did not understand the cause I experienced something like:
- the debugger is not able to give me info about the "sda" instance, but any other variable/instance does. Go to "Watch" pane and type the "sda" instance, it yields the following result:
Unable to evaluate the expression. An error occurred that usually indicates a corrupt installation (code 0x80004002). If the problem persists, repair your Visual Studio installation via 'Add or Remove Programs' in Control Panel.
- Under certain circumstances such the above (once only, thus hard to repro) the N+2 frozen and there was no way to rescue it by pushing the reset button. During the deployment, which seemed broken, I unplugged the USB cable and my PC blued the screen (kernel exception), then restarted completely the machine (without let me choose).
Let me know.
Cheers
Biggest fault of Netduino? It runs by electricity.