~aleteoryx/muditaos

ref: 37c5c2fcc83cf7382610d8823a5f45e5066be83b muditaos/module-bsp/bsp/lpm/bsp_lpm.cpp -rw-r--r-- 694 bytes
37c5c2fc — Lucjan Bryndza [EGD-5153] Fix errors in generate image script 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "bsp_lpm.hpp"


#if defined(TARGET_RT1051)
#include "board/rt1051/bsp/lpm/RT1051LPM.hpp"
#elif defined(TARGET_Linux)
#include "board/linux/lpm/LinuxLPM.h"
#else
#error "Unsupported target"
#endif

namespace bsp{

    std::optional<std::unique_ptr<LowPowerMode>> LowPowerMode::Create() {

        std::unique_ptr<LowPowerMode> inst;

#if defined(TARGET_RT1051)
        inst = std::make_unique<bsp::RT1051LPM>();
#elif defined(TARGET_Linux)
        inst = std::make_unique<bsp::LinuxLPM>();
#else
#error "Unsupported target"
#endif

        return inst;
    }

    LowPowerMode::CpuFrequency LowPowerMode::GetCurrentFrequency() const noexcept
    {
    	return currentFrequency;
    }
}