-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add new id call #19
add new id call #19
Conversation
for id in motor_ids { | ||
if id == motor_id { | ||
let mut pack = CanPack { | ||
ex_id: ExId { | ||
id: motor_id, | ||
data: 0, | ||
mode: CanComMode::MotorId, | ||
res: 0, | ||
}, | ||
len: 8, | ||
data: vec![0; 8], | ||
}; | ||
|
||
pack.ex_id.data = ((new_motor_id as u16) << 8) | (motor_id as u16); | ||
self.send_command(&pack); | ||
break; | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't we just get the motor by the index in the dictionary?
data: vec![0; 8], | ||
}; | ||
|
||
pack.ex_id.data = ((new_motor_id as u16) << 8) | (motor_id as u16); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems wrong - shouldn't it just be new_motor_id
(not motor_id
), also, i think we should be able to do something like new_motor_id.to_le_bytes()
deleted upstream code |
No description provided.