From 7a8dbfeed10132df303f88824a97dad3c1c0d1a9 Mon Sep 17 00:00:00 2001 From: pmoegenburg Date: Thu, 25 Jan 2024 16:49:25 -0500 Subject: [PATCH] fixed tests and HAL_GPIO_EXTI_Callback --- gripper/firmware/motor_hardware_shared.c | 6 +----- include/motor-control/tests/mock_motor_driver_client.hpp | 4 ++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gripper/firmware/motor_hardware_shared.c b/gripper/firmware/motor_hardware_shared.c index 2017fd2e3..f6118af8b 100644 --- a/gripper/firmware/motor_hardware_shared.c +++ b/gripper/firmware/motor_hardware_shared.c @@ -228,11 +228,7 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { (*diag0_callback)(); } } - } -} - -void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { - if (GPIO_Pin == ESTOP_IN_PIN) { + } else if (GPIO_Pin == ESTOP_IN_PIN) { #if PCBA_PRIMARY_REVISION != 'b' && PCBA_PRIMARY_REVISION != 'a' HAL_GPIO_WritePin(EBRAKE_PORT, EBRAKE_PIN, GPIO_PIN_RESET); #endif diff --git a/include/motor-control/tests/mock_motor_driver_client.hpp b/include/motor-control/tests/mock_motor_driver_client.hpp index ac760bc14..d9651bb69 100644 --- a/include/motor-control/tests/mock_motor_driver_client.hpp +++ b/include/motor-control/tests/mock_motor_driver_client.hpp @@ -11,6 +11,10 @@ struct MockMotorDriverClient { messages.push_back(m); } + void send_motor_driver_queue_isr(const tmc::tasks::TaskMessage& m) { + messages.push_back(m); + } + std::vector messages{}; };