Skip to content

Commit

Permalink
fixed2 C0325 (superfluous-parens)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chr157i4n committed Nov 7, 2023
1 parent 412e3ec commit f37a60e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/TMC_2209/TMC_2209_StepperDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ def get_direction_reg(self):
returns the motor shaft direction: 0 = CCW; 1 = CW
"""
gconf = self.tmc_uart.read_int(reg.GCONF)
return (gconf & reg.shaft)
return gconf & reg.shaft



Expand Down Expand Up @@ -628,7 +628,7 @@ def get_internal_rsense(self):
1: High sensitivity, low sense resistor voltage
"""
gconf = self.tmc_uart.read_int(reg.GCONF)
return (gconf & reg.internal_rsense)
return gconf & reg.internal_rsense



Expand Down Expand Up @@ -747,7 +747,7 @@ def get_spreadcycle(self):
return whether spreadcycle (1) is active or stealthchop (0)
"""
gconf = self.tmc_uart.read_int(reg.GCONF)
return (gconf & reg.en_spreadcycle)
return gconf & reg.en_spreadcycle



Expand Down Expand Up @@ -919,7 +919,7 @@ def set_vactual(self, vactual, duration=0, acceleration=0, show_stallguard_resul
if duration != 0:
self._starttime = time.time()
current_time = time.time()
while (current_time < self._starttime+duration):
while current_time < self._starttime+duration:
if self._stop == StopMode.HARDSTOP:
break
if acceleration != 0:
Expand Down
3 changes: 1 addition & 2 deletions src/TMC_2209/TMC_2209_uart.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ def read_reg(self, register):

time.sleep(self.communication_pause)

return(rtn)
#return(rtn)
return rtn



Expand Down
2 changes: 1 addition & 1 deletion tests/test_script_04_stallguard.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def my_callback(channel):
# finishedsuccessfully = tmc.set_vactual_rpm(30, revolutions=10)


if(finishedsuccessfully == True):
if finishedsuccessfully == True:
print("Movement finished successfully")
else:
print("Movement was not completed")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_script_07_threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@


# while the motor is still moving
while(tmc1.get_movement_phase() != MovementPhase.STANDSTILL):
while tmc1.get_movement_phase() != MovementPhase.STANDSTILL:
# print the current movement phase
print(tmc1.get_movement_phase())
time.sleep(0.02)
Expand Down

0 comments on commit f37a60e

Please sign in to comment.