Skip to content

Commit

Permalink
IMPROVEMENT: only set ESC protocol if no ESC was found in the serial …
Browse files Browse the repository at this point in the history
…ports
  • Loading branch information
amilcarlucas committed Aug 26, 2024
1 parent 2a34075 commit 90bdb5d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion MethodicConfigurator/frontend_tkinter_component_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,18 @@ def set_serial_type_and_protocol_from_fc_parameters(self, fc_parameters: dict, d
except ValueError:
logging_error("Invalid non-integer value for MOT_PWM_TYPE %f", mot_pwm_type)
mot_pwm_type = 0
if esc == 1:
if esc == 1: # only set ESC protocol if no ESC was found in the serial ports
if fc_parameters['SERVO1_FUNCTION'] in [33, 34, 35, 36] or \
fc_parameters['SERVO2_FUNCTION'] in [33, 34, 35, 36] or \
fc_parameters['SERVO3_FUNCTION'] in [33, 34, 35, 36] or \
fc_parameters['SERVO4_FUNCTION'] in [33, 34, 35, 36] or \
fc_parameters['SERVO5_FUNCTION'] in [33, 34, 35, 36] or \
fc_parameters['SERVO6_FUNCTION'] in [33, 34, 35, 36] or \
fc_parameters['SERVO7_FUNCTION'] in [33, 34, 35, 36] or \
fc_parameters['SERVO8_FUNCTION'] in [33, 34, 35, 36]:
self.data['Components']['ESC']['FC Connection']['Type'] = "Main Out"
else:
self.data['Components']['ESC']['FC Connection']['Type'] = "AIO"
self.data['Components']['ESC']['FC Connection']['Protocol'] = \
doc['MOT_PWM_TYPE']['values'][str(mot_pwm_type)]

Expand Down

0 comments on commit 90bdb5d

Please sign in to comment.