output_pin: Deprecate the maximum_mcu_duration parameter

Advise users to configure a pwm_tool config section if checking for
maximum mcu duration is required.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2024-01-12 22:52:32 -05:00
parent 7abafb575b
commit 1baa45913f
3 changed files with 14 additions and 9 deletions

View File

@ -8,6 +8,10 @@ All dates in this document are approximate.
## Changes
20240123: The output_pin `maximum_mcu_duration` parameter is
deprecated. Use a [pwm_tool config section](Config_Reference.md#pwm_tool)
instead. The option will be removed in the near future.
20240123: The output_pin `static_value` parameter is deprecated.
Replace with `value` and `shutdown_value` parameters. The option will
be removed in the near future.

View File

@ -3102,13 +3102,6 @@ pin:
#shutdown_value:
# The value to set the pin to on an MCU shutdown event. The default
# is 0 (for low voltage).
#maximum_mcu_duration:
# The maximum duration a non-shutdown value may be driven by the MCU
# without an acknowledge from the host.
# If host can not keep up with an update, the MCU will shutdown
# and set all pins to their respective shutdown values.
# Default: 0 (disabled)
# Usual values are around 5 seconds.
#cycle_time: 0.100
# The amount of time (in seconds) per PWM cycle. It is recommended
# this be 10 milliseconds or greater when using software based PWM.
@ -3128,8 +3121,9 @@ pin:
# then the 'value' parameter can be specified using the desired
# amperage for the stepper. The default is to not scale the 'value'
# parameter.
#maximum_mcu_duration:
#static_value:
# This option is deprecated and should no longer be specified.
# These options are deprecated and should no longer be specified.
```
### [pwm_tool]
@ -3144,9 +3138,15 @@ extended [g-code commands](G-Codes.md#output_pin).
[pwm_tool my_tool]
pin:
# The pin to configure as an output. This parameter must be provided.
#maximum_mcu_duration:
# The maximum duration a non-shutdown value may be driven by the MCU
# without an acknowledge from the host.
# If host can not keep up with an update, the MCU will shutdown
# and set all pins to their respective shutdown values.
# Default: 0 (disabled)
# Usual values are around 5 seconds.
#value:
#shutdown_value:
#maximum_mcu_duration:
#cycle_time: 0.100
#hardware_pwm: False
#scale:

View File

@ -36,6 +36,7 @@ class PrinterOutputPin:
maxval=MAX_SCHEDULE_TIME)
self.mcu_pin.setup_max_duration(max_mcu_duration)
if max_mcu_duration:
config.deprecate('maximum_mcu_duration')
self.resend_interval = max_mcu_duration - RESEND_HOST_TIME
# Determine start and shutdown values
static_value = config.getfloat('static_value', None,