mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-04-20 15:07:17 -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
@@ -4,6 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "AlgorithmID.hpp"
|
||||
#include "AlgorithmChange.hpp"
|
||||
#include "SystemManager/SentinelView.hpp"
|
||||
#include "common.hpp"
|
||||
|
||||
@@ -16,15 +17,23 @@ namespace sys::cpu
|
||||
sentinel::View sentinel;
|
||||
};
|
||||
|
||||
struct AlgorithmResult
|
||||
{
|
||||
/// is change required by algorithm
|
||||
algorithm::Change change;
|
||||
// value requested by algorithm
|
||||
bsp::CpuFrequencyMHz value;
|
||||
};
|
||||
|
||||
class Algorithm
|
||||
{
|
||||
private:
|
||||
[[nodiscard]] virtual bsp::CpuFrequencyMHz calculateImplementation(const AlgorithmData &) = 0;
|
||||
[[nodiscard]] virtual AlgorithmResult calculateImplementation(const AlgorithmData &) = 0;
|
||||
virtual void resetImplementation()
|
||||
{}
|
||||
|
||||
public:
|
||||
[[nodiscard]] virtual bsp::CpuFrequencyMHz calculate(const AlgorithmData &) final;
|
||||
[[nodiscard]] virtual AlgorithmResult calculate(const AlgorithmData &) final;
|
||||
virtual void reset() final;
|
||||
|
||||
virtual ~Algorithm() = default;
|
||||
|
||||
Reference in New Issue
Block a user