← Back to team overview

kicad-developers team mailing list archive

ElectricPinType vs TypeSheetLabel

 

Hi,

I'm cleaning up a bit in the codebase, and found that the ERC silently
treats the ElectricPinType and TypeSheetLabel enums the same.

typedef enum {                          enum ElectricPinType {
    NET_INPUT,                              PIN_INPUT,
    NET_OUTPUT,                             PIN_OUTPUT,
    NET_BIDI,                               PIN_BIDI,
    NET_TRISTATE,                           PIN_TRISTATE,
    NET_UNSPECIFIED,                        PIN_PASSIVE,
    NET_TMAX        /* Last value */        PIN_UNSPECIFIED,
} TypeSheetLabel;                           PIN_POWER_IN,
                                            PIN_POWER_OUT,
                                            PIN_OPENCOLLECTOR,
                                            PIN_OPENEMITTER,
                                            PIN_NC,
                                            PIN_NMAX
                                        };

I don't like this at all, because it depends on the enum definitions
being consistent (which they aren't, because PASSIVE != UNSPECIFIED),
but cleaning this up isn't straightforward either.

For just the ERC, it would be easy to map the label type to a pin type,
but I'm not sure that this is sufficient.

Can anyone who understands the ERC shed some light on this?

   Simon

Attachment: signature.asc
Description: OpenPGP digital signature