mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-07-18 20:14:12 -04:00
Gets data from freertos and prints on frequency change depending if it's important. Gathering is not costly, printing is though. For less intrusive checks I would rather disable names gathering as in worst case scenario it hangs rtos context switching till thread id is found.
42 lines
937 B
C++
42 lines
937 B
C++
#include "common.hpp"
|
|
|
|
namespace bsp{
|
|
const char *c_str(const Board &board)
|
|
{
|
|
switch (board) {
|
|
case Board::RT1051:
|
|
return "RT1051";
|
|
break;
|
|
case Board::Linux:
|
|
return "Linux";
|
|
break;
|
|
case Board::none:
|
|
default:
|
|
return "none";
|
|
break;
|
|
}
|
|
}
|
|
|
|
uint8_t CpuMHZToLevel(enum CpuFrequencyMHz val)
|
|
{
|
|
switch (val) {
|
|
case CpuFrequencyMHz::Level_0:
|
|
return 0;
|
|
case CpuFrequencyMHz::Level_1:
|
|
return 1;
|
|
case CpuFrequencyMHz::Level_2:
|
|
return 2;
|
|
case CpuFrequencyMHz::Level_3:
|
|
return 3;
|
|
case CpuFrequencyMHz::Level_4:
|
|
return 4;
|
|
case CpuFrequencyMHz::Level_5:
|
|
return 5;
|
|
case CpuFrequencyMHz::Level_6:
|
|
return 6;
|
|
}
|
|
return -1;
|
|
}
|
|
};
|
|
|