From d8d2088137cadcb8d4a3ca5326f9d8e0f93ec610 Mon Sep 17 00:00:00 2001 From: Marcos Chaparro Date: Mon, 19 Apr 2021 11:33:57 -0300 Subject: [PATCH] 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 --- applications/app_adc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/applications/app_adc.c b/applications/app_adc.c index e247ae90..735b133f 100644 --- a/applications/app_adc.c +++ b/applications/app_adc.c @@ -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