Main Site Documentation

Add "none" to FEZ_Pin enums


This is a fairly simple suggestion:

Could “none” members be added to the pin enum types in “GHIElectronics.NETMF.FEZ” class “FEZ_Pin”? This would make it easier to write optional features in managed code device drivers. For example, I am writing a driver for RF remote controls. I want to specify:

public static void Configure(FEZ_Pin.Interrupt rxpin, FEZ_Pin.Digital txpin = none, FEZ_Pin.Digital ledpin = none)

So the user will be able to specify receive only, transmit only or both receive and transmit and will also be able to specify whether or not to drive an indicator LED.


Good suggestion.

Enum values that mean “not selected”, like “none” or “undefined”, are useful for initializing variables as well.