aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2019-11-15 14:27:46 -0800
committerJoel Challis <git@zvecr.com>2019-11-15 22:27:46 +0000
commitf6b5f6db7665512cece0223ce4d19c5b17455ef4 (patch)
tree0eb1313ba5d706819321b32effd9f5dc6d9fee62
parent381b73fcac169338a1dcf433694108a29870a57e (diff)
downloadqmk_firmware-f6b5f6db7665512cece0223ce4d19c5b17455ef4.tar.gz
qmk_firmware-f6b5f6db7665512cece0223ce4d19c5b17455ef4.zip
Improvements to Solenoid feature (#7369)
* Error out when Solenid pin is not defined Instead of defaulting to a (literally) random pin, error out instead. Because this pin may be used, or because that pin may not be exposed, or may not exist. * Remove 'SOLENOID_ACTIVE' setting since it's not used * Update documentation
-rw-r--r--docs/feature_haptic_feedback.md14
-rw-r--r--drivers/haptic/solenoid.h6
2 files changed, 10 insertions, 10 deletions
diff --git a/docs/feature_haptic_feedback.md b/docs/feature_haptic_feedback.md
index d9e445de8..227363322 100644
--- a/docs/feature_haptic_feedback.md
+++ b/docs/feature_haptic_feedback.md
@@ -41,11 +41,15 @@ First you will need a build a circuit to drive the solenoid through a mosfet as
41 41
42[Wiring diagram provided by Adafruit](https://playground.arduino.cc/uploads/Learning/solenoid_driver.pdf) 42[Wiring diagram provided by Adafruit](https://playground.arduino.cc/uploads/Learning/solenoid_driver.pdf)
43 43
44Select a pin that has PWM for the signal pin
45 44
46``` 45| Settings | Default | Description |
47#define SOLENOID_PIN *pin* 46|--------------------------|---------------|-------------------------------------------------------|
48``` 47|`SOLENOID_PIN` | *Not defined* |Configures the pin that the Solenoid is connected to. |
48|`SOLENOID_DEFAULT_DWELL` | `12` ms |Configures the default dwell time for the solenoid. |
49|`SOLENOID_MIN_DWELL` | `4` ms |Sets the lower limit for the dwell. |
50|`SOLENOID_MAX_DWELL` | `100` ms |Sets the upper limit for the dwell. |
51
52?> Dwell time is how long the "plunger" stays activated. The dwell time changes how the solenoid sounds.
49 53
50Beware that some pins may be powered during bootloader (ie. A13 on the STM32F303 chip) and will result in the solenoid kept in the on state through the whole flashing process. This may overheat and damage the solenoid. If you find that the pin the solenoid is connected to is triggering the solenoid during bootloader/DFU, select another pin. 54Beware that some pins may be powered during bootloader (ie. A13 on the STM32F303 chip) and will result in the solenoid kept in the on state through the whole flashing process. This may overheat and damage the solenoid. If you find that the pin the solenoid is connected to is triggering the solenoid during bootloader/DFU, select another pin.
51 55
@@ -151,4 +155,4 @@ This will set what sequence HPT_RST will set as the active mode. If not defined,
151 155
152### DRV2605L Continuous Haptic Mode 156### DRV2605L Continuous Haptic Mode
153 157
154This mode sets continuous haptic feedback with the option to increase or decrease strength. \ No newline at end of file 158This mode sets continuous haptic feedback with the option to increase or decrease strength.
diff --git a/drivers/haptic/solenoid.h b/drivers/haptic/solenoid.h
index 53dc626e3..dd6ececa6 100644
--- a/drivers/haptic/solenoid.h
+++ b/drivers/haptic/solenoid.h
@@ -29,12 +29,8 @@
29# define SOLENOID_MIN_DWELL 4 29# define SOLENOID_MIN_DWELL 4
30#endif 30#endif
31 31
32#ifndef SOLENOID_ACTIVE
33# define SOLENOID_ACTIVE false
34#endif
35
36#ifndef SOLENOID_PIN 32#ifndef SOLENOID_PIN
37# define SOLENOID_PIN F6 33# error SOLENOID_PIN not defined
38#endif 34#endif
39 35
40void solenoid_buzz_on(void); 36void solenoid_buzz_on(void);