Files
MuditaOS/module-sys/SystemManager/cpu/algorithm/ImmediateUpscale.cpp
Adam Dobrowolski 43cd960523 [MOS-278] Fixed frequency hold algorithm behaviour
fixed hold frequency algorithm behaviour
added basic tests for frequecy changing
updated catch for newer gcc
tests added
2022-03-15 17:26:09 +01:00

18 lines
553 B
C++

// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "ImmediateUpscale.hpp"
namespace sys::cpu
{
AlgorithmResult ImmediateUpscale::calculateImplementation(const AlgorithmData &data)
{
const auto now = data.sentinel.frequency;
const auto was = data.curentFrequency;
if (now > was) {
return {algorithm::Change::UpScaled, now};
}
return {algorithm::Change::NoChange, was};
}
} // namespace sys::cpu