> Then, to denormalize the values I think I have to do this:
>
> power_consumption_CPU (mW) = (diff.cpu / TICKS_PER_SECOND) * ( 1.8
> / UPDATE_PERIOD ) * Vcc;
>
> I am not sure what is UPDATE_PERIOD, it should be UPDATE_PERIOD=1 ?
>
You can just remove UPDATE_PERIOD from the formula. It is set as "final"
to 1 in the energest example, but its purpose is unclear to me.
> Finally, in energest.c and energest.h there are a lot of statements
> depending on the definition of ENERGEST_CONF_LEVELDEVICE_LEVELS. Do I
> need to define somewhere ENERGEST_CONF_LEVELDEVICE_LEVELS? What is the
> meaning of it?
It is suitable when a device has several energy levels. An example of
its use is when changing radio transmission power, but its not needed in
most measurements.
Nicolas
------------------------------------------------------------------------------
_______________________________________________
Contiki-developers mailing list
Contiki-d...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/contiki-developers
The purpose is probably to update the energest time counter in order to
get a fresh starting value. That is fine since the CPU is on in that
case, but if you do the same with the radio, leds, sensors, and other
devices that are off, you will attribute too much time to those. The
proper way to update all counters before a measurement is to call
energest_flush.