From 76fb54403ccd3ebaf1ca49c5172335e3593c5c5c Mon Sep 17 00:00:00 2001 From: Purdea Andrei Date: Tue, 2 Nov 2021 07:54:29 +0200 Subject: haptic: Feature to disable it when usb port is not configured or suspended. (#12692) This also add support for specifying a LED pin to indicate haptic status, and also adds support for a haptic-enable pin, which is useful to turn off the boost converter on the solenoid driver. --- drivers/haptic/solenoid.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/haptic/solenoid.h') diff --git a/drivers/haptic/solenoid.h b/drivers/haptic/solenoid.h index f2a3bc4c30..653148154f 100644 --- a/drivers/haptic/solenoid.h +++ b/drivers/haptic/solenoid.h @@ -49,6 +49,14 @@ # error SOLENOID_PIN not defined #endif +#ifdef SOLENOID_PIN_ACTIVE_LOW +# define SOLENOID_PIN_WRITE_ACTIVE() writePinLow(SOLENOID_PIN) +# define SOLENOID_PIN_WRITE_INACTIVE() writePinHigh(SOLENOID_PIN) +#else +# define SOLENOID_PIN_WRITE_ACTIVE() writePinHigh(SOLENOID_PIN) +# define SOLENOID_PIN_WRITE_INACTIVE() writePinLow(SOLENOID_PIN) +#endif + void solenoid_buzz_on(void); void solenoid_buzz_off(void); void solenoid_set_buzz(int buzz); -- cgit v1.2.3