Skip to content

digitalPinToBitMask doesn't work with high number (>8) pins  #437

Description

@robotiko

At least tested with pins 13 and 14 don't return expected values.

define digitalPinToBitMask(P) ( (int)P < 8 ? _BV((int)P) : ( P < 16 ? _BV( (int)P-8 ) : 1) )

Fast look: when pin value is >=8 it is applying _BV( (int)P-8.. that will not return a good value.
Looks like code is oriented for 8 bit reg compatibility design with Arduino, however doesn't work for direct 32bit pin assignments needed for functions like GPIO_REG_WRITE.

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