~aleteoryx/muditaos

ref: cbe1ed63e541777a46109bcb1240a45e678fb2ec muditaos/module-sys/SystemManager/cpu/algorithm/ImmediateUpscale.cpp -rw-r--r-- 556 bytes
cbe1ed63 — Maciej Gibowicz [BH-1801] Fix incorrect calculation of requested CPU frequency 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Copyright (c) 2017-2023, 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.minFrequency;
        const auto was = data.curentFrequency;
        if (now > was) {
            return {algorithm::Change::UpScaled, now};
        }
        return {algorithm::Change::NoChange, was};
    }
} // namespace sys::cpu