aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorGabriel Hart2022-04-11 09:29:31 -0500
committerGabriel Hart2022-04-11 09:29:31 -0500
commit4d558992d4cc6434ec3ee94d535cd4b61a92a128 (patch)
tree8ffc3723da4657518aa340dca5fdd7ef7fc8ad28 /bin
parentTweak a few MT35Mini settings (diff)
parentrevert spurious change to version.h (diff)
downloadanduril-4d558992d4cc6434ec3ee94d535cd4b61a92a128.tar.gz
anduril-4d558992d4cc6434ec3ee94d535cd4b61a92a128.tar.bz2
anduril-4d558992d4cc6434ec3ee94d535cd4b61a92a128.zip
Merge from TK's main A2 branch thru Rev 647 which includes several patches for the Sofirn SP10 Pro after TK merge that branch in
Diffstat (limited to 'bin')
-rwxr-xr-xbin/level_calc.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/level_calc.py b/bin/level_calc.py
index 2998b44..60416db 100755
--- a/bin/level_calc.py
+++ b/bin/level_calc.py
@@ -65,10 +65,16 @@ def main(args):
dpwm_steps = int(parts[1])
dpwn_max = int(parts[2])
dpwn_min = int(parts[3])
+ dpwm_shape = 'linear'
+ if parts[4]:
+ dpwm_shape = float(parts[4])
max_pwms = [dpwn_min] * answers.num_levels
for i in range(dpwm_steps):
span = dpwn_max - dpwn_min
- x = dpwn_min + (span * (float(dpwm_steps - i) / dpwm_steps))
+ if dpwm_shape == 'linear':
+ x = dpwn_min + (span * (float(dpwm_steps - i) / dpwm_steps))
+ else: # variable curve
+ x = dpwn_min + (span * ((float(dpwm_steps - i) / dpwm_steps) ** dpwm_shape))
max_pwms[i] = int(x)
max_pwm = dpwn_min
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.