Skip to content

Commit 86b2fa7

Browse files
ellenspTracy Spiva
authored and
Tracy Spiva
committed
🔨 Fix 'step' type in createTemperatureLookupMarlin.py (MarlinFirmware#25455)
1 parent 7d6c1a4 commit 86b2fa7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

buildroot/share/scripts/createTemperatureLookupMarlin.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def __init__(self, rp, t1, r1, t2, r2, t3, r3):
5050

5151
if c < 0:
5252
print("//////////////////////////////////////////////////////////////////////////////////////")
53-
print("// WARNING: negative coefficient 'c'! Something may be wrong with the measurements! //")
53+
print("// WARNING: Negative coefficient 'c'! Something may be wrong with the measurements! //")
5454
print("//////////////////////////////////////////////////////////////////////////////////////")
5555
c = -c
5656
self.c1 = a # Steinhart-Hart coefficients
@@ -93,8 +93,8 @@ def main(argv):
9393
r2 = 1641.9 # resistance at middle temperature (1.6 KOhm)
9494
t3 = 250 # high temperature in Kelvin (250 degC)
9595
r3 = 226.15 # resistance at high temperature (226.15 Ohm)
96-
rp = 4700; # pull-up resistor (4.7 kOhm)
97-
num_temps = 36; # number of entries for look-up table
96+
rp = 4700 # pull-up resistor (4.7 kOhm)
97+
num_temps = 36 # number of entries for look-up table
9898

9999
try:
100100
opts, args = getopt.getopt(argv, "h", ["help", "rp=", "t1=", "t2=", "t3=", "num-temps="])
@@ -125,13 +125,13 @@ def main(argv):
125125
num_temps = int(arg)
126126

127127
t = Thermistor(rp, t1, r1, t2, r2, t3, r3)
128-
increment = int((ARES-1)/(num_temps-1));
129-
step = (TMIN-TMAX) / (num_temps-1)
130-
low_bound = t.temp(ARES-1);
131-
up_bound = t.temp(1);
128+
increment = int((ARES - 1) / (num_temps - 1))
129+
step = int((TMIN - TMAX) / (num_temps - 1))
130+
low_bound = t.temp(ARES - 1)
131+
up_bound = t.temp(1)
132132
min_temp = int(TMIN if TMIN > low_bound else low_bound)
133133
max_temp = int(TMAX if TMAX < up_bound else up_bound)
134-
temps = list(range(max_temp, TMIN+step, step));
134+
temps = list(range(max_temp, TMIN + step, step))
135135

136136
print("// Thermistor lookup table for Marlin")
137137
print("// ./createTemperatureLookupMarlin.py --rp=%s --t1=%s:%s --t2=%s:%s --t3=%s:%s --num-temps=%s" % (rp, t1, r1, t2, r2, t3, r3, num_temps))

0 commit comments

Comments
 (0)