summaryrefslogtreecommitdiffstats
path: root/control/zone.cpp
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2017-06-28 15:29:50 -0500
committerMatthew Barth <msbarth@us.ibm.com>2017-07-06 17:25:12 -0500
commitb4a7cb99bb82f602d3cff848a1f14ade1da2ddb5 (patch)
treecabfb6c2da1fbf900e0945a5c0edc6f5f9b2cdef /control/zone.cpp
parent1ee48f2bf461575bbb0698084370a555f17f6bbf (diff)
downloadphosphor-fan-presence-b4a7cb99bb82f602d3cff848a1f14ade1da2ddb5.tar.gz
phosphor-fan-presence-b4a7cb99bb82f602d3cff848a1f14ade1da2ddb5.zip
Set target speed according to floor speed change
When the floor speed updates, a request to increase the target speed should be made when the target is now below the floor speed. Change-Id: Ib622bc717a952ef0c0703cbff40a4dc14b213416 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'control/zone.cpp')
-rw-r--r--control/zone.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/control/zone.cpp b/control/zone.cpp
index a4a0325..8f11393 100644
--- a/control/zone.cpp
+++ b/control/zone.cpp
@@ -92,6 +92,16 @@ void Zone::setActiveAllow(const Group* group, bool isActiveAllow)
}
}
+void Zone::setFloor(uint64_t speed)
+{
+ _floorSpeed = speed;
+ // Floor speed above target, update target to floor speed
+ if (_targetSpeed < _floorSpeed)
+ {
+ requestSpeedIncrease(_floorSpeed - _targetSpeed);
+ }
+}
+
void Zone::requestSpeedIncrease(uint64_t targetDelta)
{
// Only increase speed when delta is higher than
@@ -101,11 +111,6 @@ void Zone::requestSpeedIncrease(uint64_t targetDelta)
{
_targetSpeed = (targetDelta - _incSpeedDelta) + _targetSpeed;
_incSpeedDelta = targetDelta;
- //TODO Floor speed above target, update target to floor speed
- if (_targetSpeed < _floorSpeed)
- {
- _targetSpeed = _floorSpeed;
- }
// Target speed can not go above a defined ceiling speed
if (_targetSpeed > _ceilingSpeed)
{
OpenPOWER on IntegriCloud