From 11e96a8f3e93d335b42d44c06ee2dffcc9dd2880 Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Tue, 12 Apr 2022 14:16:17 -0400 Subject: [PATCH] canbus: remove get_node_id() method This method isn't necessary as the bootloader shouldnt need to discover multiple node ids. Change the decoded node ID offset to 0x200 in an effort to avoid collisions with nodes assigned by Klipper. Signed-off-by: Eric Callahan --- src/generic/canbus.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/generic/canbus.c b/src/generic/canbus.c index 8779c5e..504dc82 100644 --- a/src/generic/canbus.c +++ b/src/generic/canbus.c @@ -102,18 +102,10 @@ can_check_uuid(uint32_t id, uint32_t len, uint8_t *data) return len >= 7 && memcmp(&data[1], canbus_uuid, sizeof(canbus_uuid)) == 0; } -// Helpers to encode/decode a CAN identifier to a 1-byte "nodeid" -static int -can_get_nodeid(void) -{ - if (!canbus_assigned_id) - return 0; - return (canbus_assigned_id - 0x100) >> 1; -} static uint32_t can_decode_nodeid(int nodeid) { - return (nodeid << 1) + 0x100; + return (nodeid << 1) + 0x200; } static void