mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-07-30 01:38:48 -04:00
[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:
committed by
Adam Dobrowolski
parent
aacd665eb9
commit
43cd960523
@@ -32,7 +32,7 @@ namespace sys::cpu
|
||||
return freq;
|
||||
}
|
||||
|
||||
bsp::CpuFrequencyMHz FrequencyStepping::calculateImplementation(const AlgorithmData &data)
|
||||
AlgorithmResult FrequencyStepping::calculateImplementation(const AlgorithmData &data)
|
||||
{
|
||||
const auto load = data.CPUload;
|
||||
const auto startFrequency = data.curentFrequency;
|
||||
@@ -58,11 +58,11 @@ namespace sys::cpu
|
||||
else if (aboveThresholdCounter >= powerProfile.maxAboveThresholdCount) {
|
||||
if (startFrequency < bsp::CpuFrequencyMHz::Level_4) {
|
||||
reset();
|
||||
return bsp::CpuFrequencyMHz::Level_4;
|
||||
return {algorithm::Change::UpScaled, bsp::CpuFrequencyMHz::Level_4};
|
||||
}
|
||||
else {
|
||||
reset();
|
||||
return bsp::CpuFrequencyMHz::Level_6;
|
||||
return {algorithm::Change::UpScaled, bsp::CpuFrequencyMHz::Level_6};
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -70,11 +70,11 @@ namespace sys::cpu
|
||||
: powerProfile.maxBelowThresholdCount) &&
|
||||
startFrequency > min.frequency) {
|
||||
reset();
|
||||
return stepDown(startFrequency, powerProfile);
|
||||
return {algorithm::Change::Downscaled, stepDown(startFrequency, powerProfile)};
|
||||
}
|
||||
}
|
||||
|
||||
return startFrequency;
|
||||
return {algorithm::Change::NoChange, startFrequency};
|
||||
}
|
||||
|
||||
void FrequencyStepping::resetImplementation()
|
||||
|
||||
Reference in New Issue
Block a user