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
master
Drashna Jaelre 2019-11-15 14:27:46 -08:00 committed by Joel Challis
parent 381b73fcac
commit f6b5f6db76
2 changed files with 10 additions and 10 deletions

View File

@ -41,11 +41,15 @@ First you will need a build a circuit to drive the solenoid through a mosfet as
[Wiring diagram provided by Adafruit](https://playground.arduino.cc/uploads/Learning/solenoid_driver.pdf) [Wiring diagram provided by Adafruit](https://playground.arduino.cc/uploads/Learning/solenoid_driver.pdf)
Select a pin that has PWM for the signal pin
``` | Settings | Default | Description |
#define SOLENOID_PIN *pin* |--------------------------|---------------|-------------------------------------------------------|
``` |`SOLENOID_PIN` | *Not defined* |Configures the pin that the Solenoid is connected to. |
|`SOLENOID_DEFAULT_DWELL` | `12` ms |Configures the default dwell time for the solenoid. |
|`SOLENOID_MIN_DWELL` | `4` ms |Sets the lower limit for the dwell. |
|`SOLENOID_MAX_DWELL` | `100` ms |Sets the upper limit for the dwell. |
?> Dwell time is how long the "plunger" stays activated. The dwell time changes how the solenoid sounds.
Beware 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. Beware 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.
@ -151,4 +155,4 @@ This will set what sequence HPT_RST will set as the active mode. If not defined,
### DRV2605L Continuous Haptic Mode ### DRV2605L Continuous Haptic Mode
This mode sets continuous haptic feedback with the option to increase or decrease strength. This mode sets continuous haptic feedback with the option to increase or decrease strength.

View File

@ -29,12 +29,8 @@
# define SOLENOID_MIN_DWELL 4 # define SOLENOID_MIN_DWELL 4
#endif #endif
#ifndef SOLENOID_ACTIVE
# define SOLENOID_ACTIVE false
#endif
#ifndef SOLENOID_PIN #ifndef SOLENOID_PIN
# define SOLENOID_PIN F6 # error SOLENOID_PIN not defined
#endif #endif
void solenoid_buzz_on(void); void solenoid_buzz_on(void);