Skip to content

gpio_callback ambiguity in union pin vs pin_mask  #11565

@pabigot

Description

@pabigot

I notice that the gpio_callback structure has a union that's documented as identifying the pins that trigger a callback, expressed as either a single ordinal (pin) or a mask of pins (pin_mask). The union documentation in the header explicitly states that the application may change the pins associated with the callback at any time. (Oddly, documentation for members of the struct does not appear to be generated.)

There's nothing in the structure that clearly indicates which union member is valid.

As best I can tell, the gpio_utils.h assumes that the pin_mask field is the one used; this is also the one initialized by gpio_init_callback().

However, gpio_intel_apl references the pin element.

Something's hinky here. Probably the union should be replaced by the pin_mask field, any resulting compilation errors fixed, and the suggestion that callbacks can be controlled by pin ordinals removed from the documentation.

Metadata

Metadata

Assignees

Labels

area: APIChanges to public APIsarea: GPIObugThe issue is a bug, or the PR is fixing a bugpriority: highHigh impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions