Skip to content

Few questions about freeing MXP I2C port #2536

Open
@kjaget

Description

@kjaget

I don't have a test case so I'm not 100% positive on these, hence questions rather than statements.

if (i2CMXPObjCount-- == 0) {

It looks like the highlighted code should be a pre-decrement, or maybe a compare against 1 instead of 0? Same potential issue with the case for the onboard port.

Also, should the HAL_FreeDIOPort() calls be inside the if() block here - seems like releasing them when objCount>0 might be wrong.

Might also be good to have a check that count isn't already 0 before decrementing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: halHardware Abstraction Layertype: bugSomething isn't working.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions