Skip to content

Commit

Permalink
Check vtx_amp_pwm is a DAC pin if possible
Browse files Browse the repository at this point in the history
warn if it's not
  • Loading branch information
pkendall64 committed Jan 23, 2024
1 parent 4254c6e commit b14045e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ def validate(target, layout, device):
had_error |= validate_backpack(target, layout)
had_error |= validate_joystick(target, layout)
had_error |= validate_pwm_outputs(target, layout)
had_error |= validate_vtx_amp_pwm(target, layout, device['platform'])
return had_error


Expand Down Expand Up @@ -318,3 +319,11 @@ def validate_pin_function(target, layout, field, platform):
print(f'device "{target}" pin for {field} must be assigned to a pin that supports INPUT')
return True
return False


def validate_vtx_amp_pwm(target, layout, platform):
if platform == 'esp32' and 'vtx_amp_pwm' in layout:
function = get_pin_function(platform, layout['vtx_amp_pwm'])
if function is not None and function & 8 != 8:
print(f'device "{target}" "vtx_amp_pwm" is preferred to be a DAC pin if possible, but PWM output is supported')
return False

0 comments on commit b14045e

Please sign in to comment.