From 20c056e7d20d658a5cae1dc38668f45d64b39f37 Mon Sep 17 00:00:00 2001 From: bp Date: Fri, 31 Jan 2025 13:50:53 +0100 Subject: [PATCH] TMC-IC: RegistersGroups word-width shall be 32 bit by default if None is given --- pytrinamic/ic/tmc_ic.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pytrinamic/ic/tmc_ic.py b/pytrinamic/ic/tmc_ic.py index 08c42c9..ba4d3c8 100644 --- a/pytrinamic/ic/tmc_ic.py +++ b/pytrinamic/ic/tmc_ic.py @@ -136,11 +136,14 @@ class RegisterGroup: The registers are added in a derived class as object attributes. It also contains convenience functions. """ - def __init__(self, name, channel, block, width=32) -> None: + def __init__(self, name, channel, block, width) -> None: self.name = name self.channel = channel self.block = block - self.width = width + if width is None: + self.width = 32 + else: + self.width = width def find(self, name: str): for register in self.registers():