Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate and remove support for uncommon options in output_pin #6458

Merged
merged 5 commits into from
Jan 24, 2024

Conversation

KevinOConnor
Copy link
Collaborator

Over the last few years the output_pin module has gained a handful of options that have made it harder to maintain the the low-level backend code. This PR simplifies the output_pin module. The main changes are:

  1. The static_value parameter is deprecated. This option has little impact - it only saves a few bytes in the micro-controller. Going forward it is simple enough to just not specify it.
  2. The maximum_mcu_duration parameter is deprecated. The pwm_tool module is a better choice for tools that require this capability. It should be straight forward for users to change their configs from [output_pin mypin] to [pwm_tool mypin].
  3. The SET_PIN CYCLE_TIME=x g-code command for [output_pin mypin] config sections has been removed. Users can convert to a new [pwm_cycle_time mypin] config as a replacement. This change is setup to take effect immediately (no deprecation period).

This is the last PR as part of the pwm_tool series of changes (eg, #6369, #6410, #6420).

@Cirromulus - fyi.

-Kevin

@KevinOConnor KevinOConnor force-pushed the work-queuepin-20230113 branch from 33e82c4 to 8c99d99 Compare January 13, 2024 04:21
@Cirromulus
Copy link
Contributor

I think this change is good for code quality.
About the maximum_mcu_duration I personally only use it together with pwm_tool, but I can imagine that people might use it for something safety related. At the same time, they could just use pwm_tool instead, even if it is not actually a tool, so it is probably just fine.

Remove support for configuring "static" pins in output_pin module.  A
"static" pin only saves a few bytes of memory in the micro-controller.
The savings does not justify the increased code complexity.

Deprecate the static_value parameter to warn users.  In the interim, a
static_value parameter will set both value and shutdown_value
parameters.

Signed-off-by: Kevin O'Connor <[email protected]>
Update static_digital_output.py to directly configure static digital
pins.  There are no other users of "static" pins, so remove that
support from mcu.py, replicape.py, and sx1509.py.  This simplifies the
low-level pin handling code.

Signed-off-by: Kevin O'Connor <[email protected]>
Advise users to configure a pwm_tool config section if checking for
maximum mcu duration is required.

Signed-off-by: Kevin O'Connor <[email protected]>
Remove support for changing the cycle time of pwm pins from the
output_pin module.  Use a new pwm_cycle_time module that supports
setting dynamic cycle times.  This simplifies the output_pin code and
low-level pin update code.

Signed-off-by: Kevin O'Connor <[email protected]>
@KevinOConnor KevinOConnor force-pushed the work-queuepin-20230113 branch from 8c99d99 to 43a9685 Compare January 24, 2024 01:05
@KevinOConnor KevinOConnor merged commit 43a9685 into master Jan 24, 2024
2 checks passed
@KevinOConnor KevinOConnor deleted the work-queuepin-20230113 branch January 24, 2024 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants