output_pin: Fix bug in setting of self.resend_interval

Only set resend_interval if a mcu_duration is specified.  This fixes a
bug introduced in commit 861144d8.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2021-03-27 14:50:32 -04:00
parent 20c96a8300
commit 00706dec21
1 changed files with 2 additions and 1 deletions

View File

@ -41,7 +41,8 @@ class PrinterOutputPin:
minval=0.500, minval=0.500,
maxval=MAX_SCHEDULE_TIME) maxval=MAX_SCHEDULE_TIME)
self.mcu_pin.setup_max_duration(max_mcu_duration) self.mcu_pin.setup_max_duration(max_mcu_duration)
self.resend_interval = max_mcu_duration - RESEND_HOST_TIME if max_mcu_duration:
self.resend_interval = max_mcu_duration - RESEND_HOST_TIME
self.last_value = config.getfloat( self.last_value = config.getfloat(
'value', 0., minval=0., maxval=self.scale) / self.scale 'value', 0., minval=0., maxval=self.scale) / self.scale