Skip to content

Commit bac57e3

Browse files
committedMar 2, 2025·
small fixes
1 parent ed2ec0a commit bac57e3

File tree

10 files changed

+12
-8
lines changed

10 files changed

+12
-8
lines changed
 

‎.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
pip install pyserial
4747
- name: Analysing the code with pylint
4848
run: |
49-
pylint $(git ls-files '*.py') --disable=C0103 --disable=W0511 --disable=W0012 --extension-pkg-whitelist=RPi --max-line-length=160
49+
pylint $(find -wholename './src/*.py') --disable=C0103 --disable=W0511 --disable=W0012 --extension-pkg-whitelist=RPi --max-line-length=160
5050
5151
5252
unittest:

‎demo/debug_script_01_uart_connection.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
tmc = Tmc2209(None, None)
3434
else:
3535
# just in case
36-
tmc = Tmc2209(None)
36+
tmc = Tmc2209(None, None)
3737

3838

3939
if BOARD == Board.RASPBERRY_PI:
File renamed without changes.

‎src/tmc_driver/com/_tmc_com_spi.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ def __init__(self,
2929
_tmc_logger (class): TMCLogger class
3030
mtr_id (int, optional): driver address [0-3]. Defaults to 0.
3131
"""
32-
self._tmc_logger = tmc_logger
33-
self.mtr_id = mtr_id
32+
super().__init__(mtr_id, tmc_logger)
33+
raise NotImplementedError
3434

3535

3636

‎src/tmc_driver/com/_tmc_com_uart.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def __init__(self,
4444
baudrate (int): baudrate
4545
mtr_id (int, optional): driver address [0-3]. Defaults to 0.
4646
"""
47-
self._tmc_logger = tmc_logger
47+
super().__init__(mtr_id, tmc_logger)
48+
4849
if serialport is None:
4950
return
5051
try:
@@ -60,7 +61,6 @@ def __init__(self,
6061
You may need to add your user to the dialout group
6162
with \"sudo usermod -a -G dialout pi\"""")
6263

63-
self.mtr_id = mtr_id
6464
# adjust per baud and hardware. Sequential reads without some delay fail.
6565
self.communication_pause = 500 / baudrate
6666

File renamed without changes.

‎src/tmc_driver/motion_control/__init__ .py

Whitespace-only changes.

‎src/tmc_driver/motion_control/_tmc_mc_vactual.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#pylint: disable=too-many-instance-attributes
2+
#pylint: disable=too-many-arguments
3+
#pylint: disable=too-many-public-methods
4+
#pylint: disable=too-many-branches
5+
#pylint: disable=too-many-positional-arguments
26
"""
37
VActual Motion Control module
48
"""

‎src/tmc_driver/tmc_2209.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def stallguard_callback(self, gpio_pin):
8181

8282

8383

84-
def do_homing(self, diag_pin, revolutions = 10, threshold = None, speed_rpm = None):
84+
def do_homing(self, diag_pin, revolutions = 10, threshold = None, speed_rpm = None) -> bool:
8585
"""homes the motor in the given direction using stallguard.
8686
this method is using vactual to move the motor and an interrupt on the DIAG pin
8787
@@ -97,7 +97,7 @@ def do_homing(self, diag_pin, revolutions = 10, threshold = None, speed_rpm = No
9797
"""
9898
if self.tmc_com is None:
9999
self.tmc_logger.log("do_homing only works with VActual register control via COM", Loglevel.ERROR)
100-
return
100+
return False
101101

102102
if threshold is not None:
103103
self._sg_threshold = threshold

0 commit comments

Comments
 (0)
Please sign in to comment.