aboutsummaryrefslogtreecommitdiff
path: root/drivers/haptic/solenoid.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/haptic/solenoid.c')
-rw-r--r--drivers/haptic/solenoid.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/haptic/solenoid.c b/drivers/haptic/solenoid.c
index d645c379a..2975ef893 100644
--- a/drivers/haptic/solenoid.c
+++ b/drivers/haptic/solenoid.c
@@ -32,14 +32,6 @@ void solenoid_buzz_off(void) { haptic_set_buzz(0); }
32 32
33void solenoid_set_buzz(int buzz) { haptic_set_buzz(buzz); } 33void solenoid_set_buzz(int buzz) { haptic_set_buzz(buzz); }
34 34
35void solenoid_dwell_minus(uint8_t solenoid_dwell) {
36 if (solenoid_dwell > 0) solenoid_dwell--;
37}
38
39void solenoid_dwell_plus(uint8_t solenoid_dwell) {
40 if (solenoid_dwell < SOLENOID_MAX_DWELL) solenoid_dwell++;
41}
42
43void solenoid_set_dwell(uint8_t dwell) { solenoid_dwell = dwell; } 35void solenoid_set_dwell(uint8_t dwell) { solenoid_dwell = dwell; }
44 36
45void solenoid_stop(void) { 37void solenoid_stop(void) {
@@ -73,7 +65,7 @@ void solenoid_check(void) {
73 65
74 // Check whether to buzz the solenoid on and off 66 // Check whether to buzz the solenoid on and off
75 if (haptic_config.buzz) { 67 if (haptic_config.buzz) {
76 if (elapsed / SOLENOID_MIN_DWELL % 2 == 0) { 68 if ((elapsed % (SOLENOID_BUZZ_ACTUATED + SOLENOID_BUZZ_NONACTUATED)) < SOLENOID_BUZZ_ACTUATED) {
77 if (!solenoid_buzzing) { 69 if (!solenoid_buzzing) {
78 solenoid_buzzing = true; 70 solenoid_buzzing = true;
79 writePinHigh(SOLENOID_PIN); 71 writePinHigh(SOLENOID_PIN);