Skip to content

Commit 160c81b

Browse files
committed
Cosmetics [black].
1 parent 7f8ab9f commit 160c81b

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

canopen/pdo/base.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,11 @@ def save(self) -> None:
403403
logger.info("Skip saving %s: COB-ID was never set", self.com_record.od.name)
404404
return
405405
logger.info("Setting COB-ID 0x%X and temporarily disabling PDO", self.cob_id)
406-
self.com_record[1].raw = self.cob_id | PDO_NOT_VALID | (RTR_NOT_ALLOWED if not self.rtr_allowed else 0x0)
406+
self.com_record[1].raw = (
407+
self.cob_id
408+
| PDO_NOT_VALID
409+
| (RTR_NOT_ALLOWED if not self.rtr_allowed else 0)
410+
)
407411

408412
def _set_com_record(
409413
subindex: int, value: Optional[int], log_fmt: str, log_factor: int = 1
@@ -432,8 +436,13 @@ def _set_com_record(
432436
for var, entry in zip(self.map, self.map_array):
433437
if not entry.writable:
434438
continue
435-
logger.info("Writing %s (0x%04X:%02X, %d bits) to PDO map",
436-
var.name, var.index, var.subindex, var.length)
439+
logger.info(
440+
"Writing %s (0x%04X:%02X, %d bits) to PDO map",
441+
var.name,
442+
var.index,
443+
var.subindex,
444+
var.length,
445+
)
437446
if getattr(self.pdo_node.node, "curtis_hack", False):
438447
# Curtis HACK: mixed up field order
439448
entry.raw = var.index | var.subindex << 16 | var.length << 24

0 commit comments

Comments
 (0)