Skip to content

Commit

Permalink
debug update
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoegenburg committed Nov 14, 2023
1 parent daf6e2d commit 4c85967
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions include/motor-control/core/tasks/motion_controller_task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,13 @@ class MotionControllerMessageHandler {
void handle(const can::messages::RouteMotorDriverInterrupt& m) {
// delay after first message, check/act on pin after delay. Deal with/discard all messgaes during delay
if (!diag0_debounced) {
can_client.send_can_message(
can::ids::NodeId::host,
can::messages::ErrorMessage{
.message_index = 1,
.severity = can::ids::ErrorSeverity::unrecoverable,
.error_code =
can::ids::ErrorCode::motor_driver_error_detected}); // delete
motion_client.send_motion_controller_queue(can::messages::DebounceMotorDriverError{.message_index = m.message_index});
diag0_debounced = true;
}
Expand Down Expand Up @@ -214,6 +221,13 @@ class MotionControllerMessageHandler {

// combine with Route msg?
void handle(const can::messages::DebounceMotorDriverError& m) {
can_client.send_can_message(
can::ids::NodeId::host,
can::messages::ErrorMessage{
.message_index = static_cast<uint32_t>(debounce_count) + 2,
.severity = can::ids::ErrorSeverity::unrecoverable,
.error_code =
can::ids::ErrorCode::motor_driver_error_detected}); // delete
vTaskDelay(300); // Need to act immediately?! Just decrease this?
debounce_count++;
if (debounce_count > 10) {
Expand Down

0 comments on commit 4c85967

Please sign in to comment.