41static FastMutex utilizationMutex;
42static Stats utilization;
43static volatile unsigned int update = 0;
47 Lock<FastMutex> l(utilizationMutex);
49 MemoryProfiling::getAbsoluteFreeHeap(),
50 MemoryProfiling::getCurrentFreeHeap(),
51 MemoryProfiling::getAbsoluteFreeStack(),
52 MemoryProfiling::getCurrentFreeStack());
57#ifdef ENABLE_CPU_METER
59static void cpuMeterThread(
void*)
68 float delta = t2 - t1;
70 Lock<FastMutex> l(utilizationMutex);
71 utilization.
add(100.f * (1.f -
static_cast<float>(
period) / delta));
80static void watchdogThread(
void*)
82 for (
unsigned int previous = update;; previous = update)
85 if (previous == update)
87 Lock<FastMutex>
l(utilizationMutex);
88 utilization.
add(100.0);
101 Thread::create(cpuMeterThread,
skywardStack(STACK_MIN), 0,
nullptr);
102 Thread::create(watchdogThread,
skywardStack(STACK_MIN), MAIN_PRIORITY,
107static CpuMeterLauncher launcher;
static StackLogger & getInstance()
void updateStack(uint8_t threadId)
Computes on-line statistics of a dataset.
StatsResult getStats() const
Return statistics of the elements added so far.
void resetCpuStats()
Resets the cpu utilization statistics.
CpuMeterData getCpuStats()
long long getOldTick()
Get the current time in milliseconds.
uint64_t getTimestamp()
Returns the current timer value in microseconds.
Driver for the VN100S IMU.
unsigned int skywardStack(unsigned int stack)