mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-02-07 07:51:49 +08:00
14 lines
408 B
C++
14 lines
408 B
C++
#include <odrive_main.h>
|
|
|
|
void MechanicalBrake::engage() {
|
|
if (odrv.config_.gpio_modes[config_.gpio_num] == ODriveIntf::GPIO_MODE_MECH_BRAKE){
|
|
get_gpio(config_.gpio_num).write(config_.is_active_low ? 0 : 1);
|
|
}
|
|
}
|
|
|
|
void MechanicalBrake::release() {
|
|
if (odrv.config_.gpio_modes[config_.gpio_num] == ODriveIntf::GPIO_MODE_MECH_BRAKE){
|
|
get_gpio(config_.gpio_num).write(config_.is_active_low ? 1 : 0);
|
|
}
|
|
}
|