diff options
| author | Selene ToyKeeper | 2021-08-16 05:02:55 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2021-08-16 05:02:55 -0600 |
| commit | a3b9b7df2ad634f9351a2e4e2fa2ee72d01cf17b (patch) | |
| tree | 00b21bfcc58dba56750cae488193702425593ab0 /bin | |
| parent | made dynamic PWM phase-correct; replaced brute-force phase reset to avoid fli... (diff) | |
| download | anduril-a3b9b7df2ad634f9351a2e4e2fa2ee72d01cf17b.tar.gz anduril-a3b9b7df2ad634f9351a2e4e2fa2ee72d01cf17b.tar.bz2 anduril-a3b9b7df2ad634f9351a2e4e2fa2ee72d01cf17b.zip | |
fixed spurious warnings in level_calc on multi-channel lights
(also fixed reported values being too low by a factor of channel.pwm_min)
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/level_calc.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/level_calc.py b/bin/level_calc.py index 9d72d45..2998b44 100755 --- a/bin/level_calc.py +++ b/bin/level_calc.py @@ -202,10 +202,12 @@ def multi_pwm(answers, channels): pwms = [] for c, channel in enumerate(channels): top = channel.modes[i] - channel.pwm_min + if top < 0: top = 0 bot = max_pwms[i] - channel.pwm_min ratio = 100 * (int(round(top)) / float(bot)) + top, bot = channel.modes[i], max_pwms[i] pwms.append('%.2f/%i (%.3f%%)' % (top, bot, ratio)) - if ratio < prev_ratios[c]: + if (ratio < prev_ratios[c]) and (ratio > 0): pwms.append('WARN') prev_ratios[c] = ratio print('%i: visually %.2f (%.2f lm): %s' % |
