Skip to content

Commit

Permalink
debug change
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoegenburg committed Nov 15, 2023
1 parent c9947fc commit 60176a3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions include/motor-control/core/tasks/motion_controller_task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,13 @@ class MotionControllerMessageHandler {
.severity = can::ids::ErrorSeverity::unrecoverable,
.error_code =
can::ids::ErrorCode::motor_driver_error_detected}); // delete
// TickTypet currentTick = xTaskGetTickCount();
// while(xTaskGetTickCount() – currentTick < pdMSTO_TICKS(1000))
vTaskDelay(pdMS_TO_TICKS(200)); // Need to act immediately?! Just decrease this?!
debounce_count++;
if (debounce_count > 10) { // send msg immediately, reset flags after delay?!
if (controller.read_tmc_diag0()) {
handle_message(
can::messages::MotorDriverErrorEncountered{.message_index = m.message_index});
motion_client.send_motion_controller_queue(can::messages::MotorDriverErrorEncountered{.message_index = m.message_index});
} else {
handle_message(can::messages::ResetMotorDriverErrorHandling{
.message_index = m.message_index});
motion_client.send_motion_controller_queue(can::messages::ResetMotorDriverErrorHandling{.message_index = m.message_index});
}
diag0_debounced = false;
debounce_count = 0;
Expand Down

0 comments on commit 60176a3

Please sign in to comment.