Cobra 1 pins gone?

I’m revamping some cobra code from a few years ago (cobra I board) & upgraded to SDK4.2 & gadgeteer package 2014R1

the following code now generates an error:

static InputPort rdButtUp = new InputPort((Cpu.Pin)FEZ_Pin.Digital.ButtonDown, true, Port.ResistorMode.PullUp);

as the resource
using GHIElectronics.NETMF.FEZ seems to be gone

What resource should be added to support these pin names?

You can instantiate pin using:


Cpu.Pin p = GHI.Hardware.EMX.Pin.IO17;
InputPort ip = new InputPort(p, true, Port.ResistorMode.PullDown);

You just have to check in cobra pins description what is the correct pin for the down button.

Well…doesn’t that seem to be a step backwards? While I appreciate the tip, it doesn’t say much for upgrading to 4.2

you could create a set of equivalent fez.pin enums if you wanted to… or you could change them to use the new ghi.hardware enum… but it’s a once-off change.

And of course option 3 is to put the 4.1 firmware back on and your code will just continue to work.

Does this mean support for the cobra is gone from the sdk? This makes me worry that other things I used may be unavailable. Since it’s been about 3 years, I thought moving from 4.1 to 4.2 would be the right thing to do (to capture latest sdk bug fixes)…maybe not

these might help:
http://www.ghielectronics.com/downloads/FEZ/Cobra/FEZ%20Cobra_sch.pdf
http://www.ghielectronics.com/downloads/FEZ/Cobra/Broch_FEZ_Cobra.pdf
https://www.ghielectronics.com/downloads/man/Library_Documentation_v4.2/Premium/Index.html click on GHI.Hardware.EMX

Some removed constant does not mean that the board is not supported anymore.
GHI did some cleanup in the SDK from 4.1 to 4.2.
The pin constants are there, but only for the SoM’s (EMX, G120, …)

I haven’t heard anything that EMX, and by this Cobra I will not be supported anymore in near future.

Absolutely not. EMX is still a supported product, and Cobra 1 (and Spider) uses EMX as it’s heart.

All that has happened is a rationalisation of enumerations for pins. You still need to know where those pins physically are, you still need to know what you have connected to what, now you just need to know that you have to call them something slightly different.

And moving from 4.1 to 4.2 is very much the right thing to do - again, this is a one-time, remap your pins from one namespace to another, task. Once you’ve done that, you get everything there is that’s new and shiny in 4.2 And in a while, when the 4.3 port is complete, you’ll be able to do the same thing (and my bet is your pin definition code will not need to change at all).