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 <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2022-04-12 14:16:17 -04:00
parent 5ff2ce1c4a
commit 11e96a8f3e
No known key found for this signature in database
GPG Key ID: 7027245FBBDDF59A

View File

@ -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