[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
This commit is contained in:
Adam Dobrowolski
2022-03-08 16:48:14 +01:00
committed by Adam Dobrowolski
parent aacd665eb9
commit 43cd960523
17 changed files with 230 additions and 47 deletions

View File

@@ -5,10 +5,13 @@
namespace sys::cpu
{
bsp::CpuFrequencyMHz ImmediateUpscale::calculateImplementation(const AlgorithmData &data)
AlgorithmResult ImmediateUpscale::calculateImplementation(const AlgorithmData &data)
{
const auto now = data.sentinel.frequency;
const auto was = data.curentFrequency;
return std::max(now, was);
if (now > was) {
return {algorithm::Change::UpScaled, now};
}
return {algorithm::Change::NoChange, was};
}
} // namespace sys::cpu