Skip to content

Commit

Permalink
Merge branch 'release/1.0.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
GiorgioAresu committed Jan 25, 2020
2 parents c35da04 + 36b6c00 commit 785590a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
20 changes: 13 additions & 7 deletions FanController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
#include <analogWrite.h>
#endif

#if defined(ESP8266)
#define ISR_PREFIX ICACHE_RAM_ATTR
#else
#define ISR_PREFIX
#endif

FanController::FanController(byte sensorPin, unsigned int sensorThreshold, byte pwmPin)
{
_sensorPin = sensorPin;
Expand Down Expand Up @@ -40,8 +46,8 @@ unsigned int FanController::getSpeed() {
_halfRevs = 0;
_lastMillis = millis();
_attachInterrupt();
return _lastReading;
}
return _lastReading;
}

void FanController::setDutyCycle(byte dutyCycle) {
Expand Down Expand Up @@ -93,9 +99,9 @@ void FanController::_triggerCaller(byte instance)
}
}

void FanController::_triggerExt0() { FanController::_triggerCaller(0); }
void FanController::_triggerExt1() { FanController::_triggerCaller(1); }
void FanController::_triggerExt2() { FanController::_triggerCaller(2); }
void FanController::_triggerExt3() { FanController::_triggerCaller(3); }
void FanController::_triggerExt4() { FanController::_triggerCaller(4); }
void FanController::_triggerExt5() { FanController::_triggerCaller(5); }
ISR_PREFIX void FanController::_triggerExt0() { FanController::_triggerCaller(0); }
ISR_PREFIX void FanController::_triggerExt1() { FanController::_triggerCaller(1); }
ISR_PREFIX void FanController::_triggerExt2() { FanController::_triggerCaller(2); }
ISR_PREFIX void FanController::_triggerExt3() { FanController::_triggerCaller(3); }
ISR_PREFIX void FanController::_triggerExt4() { FanController::_triggerCaller(4); }
ISR_PREFIX void FanController::_triggerExt5() { FanController::_triggerCaller(5); }
2 changes: 1 addition & 1 deletion FanController.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class FanController
static FanController *_instances[6];
byte _sensorPin;
byte _sensorInterruptPin;
byte _sensorThreshold;
unsigned int _sensorThreshold;
byte _pwmPin;
byte _pwmDutyCycle;
byte _instance;
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"maintainer": true
}
],
"version": "1.0.5",
"version": "1.0.6",
"frameworks": "arduino",
"platforms": "*"
}
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=FanController
version=1.0.5
version=1.0.6
author=Giorgio Aresu <[email protected]>
maintainer=Giorgio Aresu <[email protected]>
sentence=Arduino Library for controlling PC fans
Expand Down

0 comments on commit 785590a

Please sign in to comment.