Skip to content

shiftIn return value misleading #116

Closed
@oclyke

Description

@oclyke

According to the shiftIn documentation the return parameter should be byte. For symmetry with the shiftOut function it would make sense to return uint8_t.

In this API the return value is currently specified as pin_size_t which can be either uint8_t or uint32_t

#ifdef EXTENDED_PIN_MODE
// Platforms who wnat to declare more than 256 pins need to define EXTENDED_PIN_MODE globally
typedef uint32_t pin_size_t;
#else
typedef uint8_t pin_size_t;
#endif

Suggest changing the declaration from:

pin_size_t shiftIn(pin_size_t dataPin, pin_size_t clockPin, BitOrder bitOrder);

to:

uint8_t shiftIn(pin_size_t dataPin, pin_size_t clockPin, BitOrder bitOrder);

Any reason not to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions