app adc: allow hardwares to override the brake input

With this hook the brake can be overriden from the hw_*.c file without
polluting the app configuration UI.

Some examples of commanded braking:
* Tilt/crash sensor
* Gear shift sensor
* Emergency stop
* Kill switch

Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
This commit is contained in:
Marcos Chaparro 2021-04-19 11:33:57 -03:00
parent 14b25e9aa4
commit d8d2088137
1 changed files with 3 additions and 0 deletions

View File

@ -186,6 +186,9 @@ static THD_FUNCTION(adc_thread, arg) {
float brake = 0.0;
#endif
#ifdef HW_HAS_BRAKE_OVERRIDE
hw_brake_override(&brake);
#endif
read_voltage2 = brake;
// Optionally apply a mean value filter