Have GPIO input override commands from USB

Hey! We have been using the ODrive v3.6 56V module with our autonomous ground vehicle for a while now. The setup uses one of the Nvidia Jetson boards sending commands to the ODrive (using the Native protocol) via USB, and it works well.

Now, going forward, we would like to add a feature where direct brake and throttle inputs (via a physical brake lever and a throttle potentiometer) on the ground vehicle should override commands from the Jetson and have an immediate effect on the speed of the motors being controlled by the ODrive.

As per our understanding, there is no stock firmware functionality to achieve this. The closest thing we could achieve is to use the analog input mapping feature to have a throttle potentiometer control the motor directly. However, this would stop motor control through commands from the Jetson.

What my question here is, can we get any hints to where it would be best for us to include additional code to read analog values from the GPIO, compare it with a threshold, and use it to override input_vel commands from the Jetson if needed?

(if throttle not pressed) : Jetson -----> ODrive
(if throttle pressed) : Jetson —X–> ODrive <----- Throttle value

I believe that we would have to call the get_adc_voltage() function in low_level.cpp somewhere. The firmware files are a bit involved with all the multithreading tasks going around, and we would appreciate any help to focus our efforts.