Skip to content

Resolve ambiguity in PWM module #406

@josiah-tesfu

Description

@josiah-tesfu

In the PWM module, a few functions must be executed in a specific order before continuing. Specifically, init_pwm must be called and followed by set_config, which itself requires that all configurations are set. After this, functions can be called normally (and set_config can be called with any number of parameters).

This is logical to someone familiar with PWM. However, since failling to do so causes ambiguous error messages that don't point to the cause, more documentation should be provided. In addition to better documentation, we might consider enhancing error messages to be clearer, especially for set_config. For example, when functions (like enable) were called after set_config was not configurated with all parameters, an exception triggered with the message "PWM closed unexpectedly." This is ambiguous and doesn't give any hint as to the source of the error.

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