src/hsk_pwc/hsk_pwc.c
/**
 * This is the common implementation for soft capture events.
 *
 * @param channel
 *	The channel that was captured.
 * @param capture
 *	The value that was captured.
 * @private
 */
This is the common implementation for soft capture events.

@param channel
The channel that was captured.
@param capture
The value that was captured.
@private
This is the common implementation for soft capture events . @param channel The channel that was captured . @param capture The value that was captured . @private
void hsk_pwc_ccn(const hsk_pwc_channel channel, uword capture) {
	#define channel    channels[channel]
	capture -= channel.lastCapture;
	channel.lastCapture += capture;
	channel.sum -= channel.buffer[channel.pos];
	channel.buffer[channel.pos++] = capture;
	channel.pos %= channel.averageOver;
	channel.sum += capture;
	channel.overflow = overflows;
	if (channel.invalid) {
		channel.invalid--;
	}
	#undef channel
}
void hsk_pwc_ccn ( const hsk_pwc_channel channel , uword capture ) { #define channel     channels[channel]
 capture -= channel . lastCapture ; channel . lastCapture += capture ; channel . sum -= channel . buffer [ channel . pos ] ; channel . buffer [ channel . pos ++ ] = capture ; channel . pos %= channel . averageOver ; channel . sum += capture ; channel . overflow = overflows ; if ( channel . invalid ) { channel . invalid -- ; } #undef  channel
 }
This is the common implementation for soft capture events.
This is the common implementation for soft capture events .
/* Get the new value and store the current capture value for next
	 * time. */ /* Update the sum and buffer. */ /* Update the overflow count.. */ /* Update the invalidation count. */