[En-Nut-Discussion] Set Idle Heartbeat on entry and reset on leave of idle function
Ulrich Prinz
uprinz2 at netscape.net
Thu Apr 29 20:51:59 CEST 2010
Hi Uwe,
I like this patch. Can you upload both to sourceforge and please correct
one minor thing. The naming convention should be xxx_yyy_PORT and
xxx_yyy_PIN for Port and Pin of a CPU.
In the NutConf file you name it IDLE_HEARTBEAT_DDR, while in the code
you name it IDLE_HEARTBEAT_BIT. I thing the DDR
(Data-Direction-Register) is intrinsically defined by the Port and Pin.
Is there a reason for not making this available to all CPUs?
Best regards, Ulrich
Am 29.04.2010 12:46, schrieb Uwe Bonnes:
> Hello,
>
> at present, in arch/avr/os/nutinit.c the idle heartbeat function toggles the
> heartbeat bit once in the idle function. That way, you can't see, how long
> the CPU stays idle.
>
> Appended patch clears the heartbeart bit on idle-entry and sets on
> idle-leave. That way, you can see on the scope how long the CPU is idle.
> It also saves a byte on the stack and probably doesn't increas cycle usage.
>
More information about the En-Nut-Discussion
mailing list