You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: usermods/PWM_fan/usermod_PWM_fan.h
+24-15Lines changed: 24 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -26,11 +26,6 @@ class PWMFanUsermod : public Usermod {
26
26
27
27
bool initDone = false;
28
28
bool enabled = true;
29
-
30
-
constint numberOfInterrupsInOneSingleRotation = 2; // Number of interrupts ESP32 sees on tacho signal on a single fan rotation. All the fans I've seen trigger two interrups.
31
-
constint pwmMinimumValue = 120;
32
-
constint pwmStep = 10;
33
-
34
29
unsignedlong msLastTachoMeasurement = 0;
35
30
uint16_t last_rpm = 0;
36
31
#ifdef ARDUINO_ARCH_ESP32
@@ -46,6 +41,8 @@ class PWMFanUsermod : public Usermod {
46
41
int8_t pwmPin = -1;
47
42
uint8_t tachoUpdateSec = 30;
48
43
float targetTemperature = 25.0;
44
+
uint8_t minPWMValuePct = 50;
45
+
uint8_t numberOfInterrupsInOneSingleRotation = 2; // Number of interrupts ESP32 sees on tacho signal on a single fan rotation. All the fans I've seen trigger two interrups.
49
46
50
47
// strings to reduce flash memory usage (used more than twice)
51
48
staticconstchar _name[];
@@ -54,6 +51,8 @@ class PWMFanUsermod : public Usermod {
54
51
staticconstchar _pwmPin[];
55
52
staticconstchar _temperature[];
56
53
staticconstchar _tachoUpdateSec[];
54
+
staticconstchar _minPWMValuePct[];
55
+
staticconstchar _IRQperRotation[];
57
56
58
57
voidinitTacho(void) {
59
58
if (tachoPin < 0 || !pinManager.allocatePin(tachoPin, false, PinOwner::UM_Unspecified)){
@@ -80,7 +79,7 @@ class PWMFanUsermod : public Usermod {
0 commit comments