1) What happens if i call "get_usb_power" first with no arguments and immediately call it again with the argument 3, does it still keep the number of pulses last detected or the first with no argument call erase all relevant data?
The first call will return the pulse width of the most recent pulse and reset the pulse width value. The second call will return the pulse count and clear the pulse counter. Calling one does not reset the other.
2) what is the maximum usb power pulse width that can be measured, 250ms (25) or more?
The pulse width measurement continues for as long as USB power is applied. So it will go to 327.67 seconds before the value "wraps" and goes negative. This is potentially a bug - I should probably change the code to clamp the measurement at some point - 5 minutes maybe ?
3) Someone told me that CHDK can measure analog voltages is it true? From where?
Not to my knowledge. Although with some external hardware you could rig a simple voltage to pulse width circuit.