Hi Kam.
Hooks to the inside of OSSched() are required to accurately reflect the ratio of eligible task executions to idle hook calls. That's where Salvo Pro comes in handy ...
However, you can probably get a decent approximation doing something like this in your main():
code:
for (;;)
{
OSSched();
if (OSAnyEligibleTasks())
{
BIT = 1;
ctxCount++;
}
else
{
BIT = 0;
idleCount++;
}
}
With this setup, you can watch BIT with a scope or logic analyzer and from its average duty cycle infer the running/idle ratio. And you can also look at the ratio of ctxCount to idleCount ...
This setup will be biased towards the idle hook -- it will accurately report frequency of the idle task running, but will underreport the frequency of tasks executing (it has to do with how OSSched() works, and is complicated). But when Salvo Pro isn;t available, this is probably the best you can do.
Oh, another thing you can do is invoke sleep mode from OSIdlingHook((), and leave sleep mode from each ISR that has a call to a Salvo service. Set/clear bits those places, and that will give you an accurate reflection of the percentage of time that it's sleeping (and therefore idle).
Salvo v4 is coming out soon (ARM distribution is first). That might be a good time to upgrade to Pro ...
------------------