Skip to content

Empty destructors code of HW drivers #3106

Open
@nvlsianpu

Description

@nvlsianpu

Description of defect

Most of driver has empty destructor code. The consequence is that there is no possible to de-initialize corresponding hardware in uC. It might caused malfunction when uC common hw part (e.g. GPIO) were used for few peripherial or so. It also might cause incresed power consumption because there is no entry to disable Hardware.

For example on nRF5 target we can use a pin as AnalogIn an after that as DigitalInOut. Once a pin was configured as analog pin, such a pin was assigned to the ADC and the Digital part was disabled. Because of lack of destructor there is no entry to de-initialize analog part of a pin HW or disabling ADC at all. This cause that this pin will be unable to work well if we try to reuse it for DigitalInOut.

example of use case:
https://github.com/ARMmbed/ci-test-shield/blob/master/TESTS/API/AnalogIn/AnalogIn.cpp

Target(s) affected by this defect ?

all

Toolchain(s) (name and version) displaying this defect ?

Not relevant

What version of Mbed-os are you using (tag or sha) ?

mbed-os-6.15

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

Not relevant

How is this defect reproduced ?

See the dtor for drivers

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions