Getting CPU load percentage on #209
Unanswered
Rian-De-Rous-Cspect
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I’m trying to use TaskScheduler’s CPU load monitoring (getCpuLoadCycle(), getCpuLoadIdle(), getCpuLoadTotal()) to understand how much time my MCU actually spends running tasks vs being idle.
Board: Arduino UNO R4 WiFi .
I enabled the compiler options:
`#define _TASK_SLEEP_ON_IDLE_RUN
#define _TASK_TIMECRITICAL
#include <TaskScheduler.h>
...
#ifdef _TASK_SLEEP_ON_IDLE_RUN
runner.setSleepMethod(&schedulerIdleSleep);
#endif
....
void loop() {
runner.execute();
}
`
I have about 7 tasks which run from every 100ms to every 5 seconds.
I verified with a print debug statement and the schedulerIdleSleep is executed regularly, meaning i must have plenty of time that my microcontroller is waiting....
Beta Was this translation helpful? Give feedback.
All reactions