diff options
author | Drashna Jaelre <drashna@live.com> | 2022-05-15 04:24:35 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-15 21:24:35 +1000 |
commit | f090881aebbd7af74294b53fabdf55a35004f190 (patch) | |
tree | 53d786c3be9bf1b2823bdee7bf6a55686d8b1461 /drivers/haptic/solenoid.h | |
parent | 4d107feca9621ee3f342507136b04f176e8f2320 (diff) |
[Feature] Add support for multiple switchs/solenoids to Haptic Feedback engine (#15657)
Diffstat (limited to 'drivers/haptic/solenoid.h')
-rw-r--r-- | drivers/haptic/solenoid.h | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/haptic/solenoid.h b/drivers/haptic/solenoid.h index 653148154f..952f86e922 100644 --- a/drivers/haptic/solenoid.h +++ b/drivers/haptic/solenoid.h @@ -45,26 +45,24 @@ # define SOLENOID_BUZZ_NONACTUATED SOLENOID_MIN_DWELL #endif -#ifndef SOLENOID_PIN -# error SOLENOID_PIN not defined +#ifndef SOLENOID_PINS +# ifdef SOLENOID_PIN +# define SOLENOID_PINS \ + { SOLENOID_PIN } +# else +# error SOLENOID_PINS array not defined +# endif #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 solenoidbuzz_on(void); void solenoid_buzz_off(void); -void solenoid_set_buzz(int buzz); +void solenoid_set_buzz(uint8_t buzz); void solenoid_set_dwell(uint8_t dwell); -void solenoid_stop(void); -void solenoid_fire(void); +void solenoid_stop(uint8_t index); +void solenoid_fire(uint8_t index); +void solenoid_fire_handler(void); void solenoid_check(void); |