Skip to content

Add missing reset function implementation in ODriveCAN.cpp #18

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

Merged
merged 1 commit into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/ODriveCAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ bool ODriveCAN::getPower(Get_Powers_msg_t& msg, uint16_t timeout_ms) {
return request(msg, timeout_ms);
}

bool ODriveCAN::reset(ResetAction action)
{
Reboot_msg_t msg;
msg.Action = action;

return send(msg);
}

void ODriveCAN::onReceive(uint32_t id, uint8_t length, const uint8_t* data) {
#ifdef DEBUG
int byte_index = length - 1;
Expand Down
8 changes: 4 additions & 4 deletions src/ODriveCAN.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ class ODriveCAN {
*/
bool getPower(Get_Powers_msg_t& msg, uint16_t timeout_ms = 10);

enum ResetAction {
Reboot,
SaveConfiguration,
EraseConfiguration
enum ResetAction : uint8_t {
Reboot = 0,
SaveConfiguration = 1,
EraseConfiguration = 2,
};

/**
Expand Down